-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix(controller/cli): Resolve global artifacts created in nested workflows #6422
Conversation
Signed-off-by: Huan-Cheng Chang <changhc84@gmail.com>
1dd0aa5
to
ec79405
Compare
Codecov Report
@@ Coverage Diff @@
## master #6422 +/- ##
==========================================
+ Coverage 48.74% 48.75% +0.01%
==========================================
Files 253 253
Lines 18217 18218 +1
==========================================
+ Hits 8880 8883 +3
+ Misses 8367 8363 -4
- Partials 970 972 +2
Continue to review full report at Codecov.
|
…lows Signed-off-by: Huan-Cheng Chang <changhc84@gmail.com>
ed094e9
to
ec6f149
Compare
@@ -548,7 +548,8 @@ func resolveAllVariables(scope map[string]interface{}, tmplStr string) error { | |||
return nil | |||
} | |||
_, ok := scope[tag] | |||
if !ok { | |||
_, isGlobal := globalParams[tag] | |||
if !ok && !isGlobal { |
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.
tests?
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.
Sorry. Added a test case to workflow/validate/validate_test.go
and verified that it failed without the changes in this PR.
Also added more details about the root cause to the PR description.
1f941e5
to
46ce0ad
Compare
Signed-off-by: Huan-Cheng Chang <changhc84@gmail.com>
46ce0ad
to
2c593c5
Compare
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.
LGTM
- Remove copied code from argo watch cmd. Now `capact act watch` command can be stopped via `ctrl+c` and it also prints the status icons. - Bump to Argo Helm Chart - Remove custom Argo images as the bug was resolved, see: argoproj/argo-workflows#6422 - Bump k8s deps in `go.mod` - Change step name to lowercase as it's used for k8s pod name: ``` Pod "e2e-test-1-8081-output-testUpload-3658329211" is invalid: metadata.name: Invalid value: "e2e-test-1-8081-output-testUpload-3658329211": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*') ```` Change was introduced in: argoproj/argo-workflows@8897fff
Checklist:
Fixes #4772. Basically the problem is that the global parameters/artefacts are captured and stored in the template validation context normally, but the only the template scope, which does not contain the captured global params/artefacts, is checked in
resolveAllVariables
.resolveAllVariables
checks the current scope, but nested templates have their own scope, and the global parameters/artefacts captured are not reflected in the upper level scope (only in the template validation context). Therefore, when a template is being validated byresolveAllVariables
, it cannot find in the current scope the global parameters/artefacts resolved in templates in the next level.Test
Executed the sample workflow mentioned in the issue successfully.