mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-07 00:01:49 +00:00
fix: linked variable already being a variable
This commit is contained in:
@@ -264,20 +264,23 @@
|
||||
const resourceValue = args
|
||||
|
||||
if (!manual || linkedSecret != undefined) {
|
||||
await VariableService.createVariable({
|
||||
workspace: $workspaceStore!,
|
||||
requestBody: {
|
||||
path,
|
||||
value: manual ? args[linkedSecret ?? ''] : value,
|
||||
is_secret: true,
|
||||
description: emptyString(description)
|
||||
? `${manual ? 'Token' : 'OAuth token'} for ${resource_type}`
|
||||
: description,
|
||||
is_oauth: !manual,
|
||||
account: account
|
||||
}
|
||||
})
|
||||
resourceValue[linkedSecret ?? 'token'] = `$var:${path}`
|
||||
let v = manual ? args[linkedSecret ?? ''] : value
|
||||
if (!v.startsWith('$var:')) {
|
||||
await VariableService.createVariable({
|
||||
workspace: $workspaceStore!,
|
||||
requestBody: {
|
||||
path,
|
||||
value: v,
|
||||
is_secret: true,
|
||||
description: emptyString(description)
|
||||
? `${manual ? 'Token' : 'OAuth token'} for ${resource_type}`
|
||||
: description,
|
||||
is_oauth: !manual,
|
||||
account: account
|
||||
}
|
||||
})
|
||||
resourceValue[linkedSecret ?? 'token'] = `$var:${path}`
|
||||
}
|
||||
}
|
||||
|
||||
await ResourceService.createResource({
|
||||
|
||||
@@ -91,18 +91,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
function setDurationStatus(key: string, value: DurationStatus) {
|
||||
if (!deepEqual($localDurationStatuses[key], value)) {
|
||||
$localDurationStatuses[key] = value
|
||||
globalDurationStatuses.forEach((s) => {
|
||||
s.update((x) => {
|
||||
x[key] = JSON.parse(JSON.stringify(value))
|
||||
return x
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function setDurationStatusByJob(key: string, id: string, value: any) {
|
||||
if (!deepEqual($localDurationStatuses[key]?.byJob[id], value)) {
|
||||
$localDurationStatuses[key].byJob[id] = value
|
||||
|
||||
Reference in New Issue
Block a user