-
Notifications
You must be signed in to change notification settings - Fork 326
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 "consul-k8s install fails: now can't re-install or upgrade" #1115
Conversation
Just starting to look through this. There are a lot of places where you are looking for args and if they don't exist you use default args. Would it be easier or more correct to merge the provided args onto the default args and use that merged map? (I am not saying it is easier or more correct, but just that with default values and supplied values, that's the common pattern I see.) |
Interesting question. I can definitely look at that. I can give that a shot with an |
ok, i said map, but now that you mention it and i look again you are setting the extra args for each function and its an array. I don't think you need to bother changing that structure. What I was getting at is you may want to take default args and append the passed in args to get the working set of args and that would represent better how default and user specified options are merged together. |
Hm, if I do that, I will actually use a map and then flatten it because some flags take a value and others do not. I can map |
So, when I did that I remembered why I went with |
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.
🎉 🙏 awesome find and fix! Minor nit on file name and wont' block on the ongoing conversation about merging args since everything works and don't want to draw this out too much.
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.
Nice fix, Thomas!
I'm leaving some comments and questions in-line.
Co-authored-by: Iryna Shustava <ishustava@users.noreply.github.com>
194e8f5
to
00e6848
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.
Looks good!
Fixes #1005
Changes proposed in this PR:
HelmCluster
andCLICluster
to accept arguments onCreate
,Update
, andDelete
actions.default
namespace.How I've tested this PR:
Both using scenario tests and by debugging the upgrade command when an install was present in the
default
namespace.How I expect reviewers to test this PR:
The scenario tests may be run from the
acceptance
directory withgo test -timeout 15m github.com/hashicorp/consul-k8s/acceptance/tests/cli -v
Checklist: