-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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 service update --env-add
issue
#25427
Conversation
d6d2e98
to
2b7b359
Compare
Seems like it's been a punctual error: 03:57:26 ---> Making bundle: validate-dco (in bundles/1.13.0-dev/validate-dco) Can you trigger the build again manually? |
out, err = d.Cmd("service", "inspect", "--format", "{{ .Spec.TaskTemplate.ContainerSpec.Env }}", name) | ||
c.Assert(err, checker.IsNil) | ||
c.Assert(strings.TrimSpace(out), checker.Equals, "[A=b]") | ||
} |
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.
I don't think this needs to be an integration test.
We can fully test this change as a unit test. in api/client/service/update_test.go
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.
Thanks @dnephin. The integration test has been removed and replaced with a unit test.
This fix tries to address the issue in 25404 where updating environmental variable in `service update --env-add` will not work. The issue is because `--env-add` will only append the env, not update if the same env already exist. This fix tracks the env variable with a map and update if the variable is the same. An integration test has been added. This fix fixes 25404. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2b7b359
to
c6de8ad
Compare
LGTM |
retest this please |
LGTM |
- What I did
This fix tries to address the issue in #25404 where updating environmental variable in
service update --env-add
will not work.The issue is because
--env-add
will only append the env, not update if the same env already exist.- How I did it
This fix tracks the env variable with a map and update if the variable is the same.
- How to verify it
An integration test has been added.
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)
This fix fixes #25404.
Signed-off-by: Yong Tang yong.tang.github@outlook.com