-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: add secret survey variable on opentofu task issue #2322 #3083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -67,13 +67,23 @@ func (t *LocalJob) SetCommit(hash, message string) { | |||||||||||||||||||
func (t *LocalJob) getEnvironmentExtraVars(username string, incomingVersion *string) (extraVars map[string]any, err error) { | ||||||||||||||||||||
|
||||||||||||||||||||
extraVars = make(map[string]any) | ||||||||||||||||||||
extraSecretVars := make(map[string]any) | ||||||||||||||||||||
|
||||||||||||||||||||
if t.Environment.JSON != "" { | ||||||||||||||||||||
err = json.Unmarshal([]byte(t.Environment.JSON), &extraVars) | ||||||||||||||||||||
if err != nil { | ||||||||||||||||||||
return | ||||||||||||||||||||
} | ||||||||||||||||||||
} | ||||||||||||||||||||
if t.Secret != "" { | ||||||||||||||||||||
err = json.Unmarshal([]byte(t.Secret), &extraSecretVars) | ||||||||||||||||||||
if err != nil { | ||||||||||||||||||||
return | ||||||||||||||||||||
} | ||||||||||||||||||||
} | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||
t.Secret = "{}" | ||||||||||||||||||||
|
||||||||||||||||||||
maps.Copy(extraVars, extraSecretVars) | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Secret variables are being copied into
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||
|
||||||||||||||||||||
taskDetails := make(map[string]any) | ||||||||||||||||||||
|
||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition
t.Secret != ""
may not handle the case wheret.Secret
is"{}"
(empty JSON object). Consider checking for both empty string and empty JSON object, or use a more robust validation method.Copilot uses AI. Check for mistakes.