-
Notifications
You must be signed in to change notification settings - Fork 115
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
Make task arguments match the new flag names #619
Conversation
318be2b
to
f57a0e6
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.
Mostly looks good, just a couple questions from me! ❓
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.
Added some thoughts about consistency across tasks as well
bindings: bindings_parser.parse, | ||
logger: logger, | ||
max_watch_seconds: ::Krane::DurationParser.new(options["global-timeout"]).parse!.to_i, | ||
global_timeout: ::Krane::DurationParser.new(options["global-timeout"]).parse!.to_i, | ||
selector: selector, | ||
protected_namespaces: protected_namespaces, | ||
) |
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 can't comment on line 73. But should allow_protected_ns: !protected_namespaces.empty?,
be renamed too?
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.
This actually could be removed from the public interface, right? This is maintained as an argument mostly for backwards compatibility with kubernetes-deploy
.
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.
allow_protected_ns
can be removed.
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.
OK, will remove on #622.
9a0f7af
to
6bbb909
Compare
6bbb909
to
86f0aa9
Compare
Added a commit with changes to the migration guide. |
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 think we need to merge #622, then rebase this before a final review. Otherwise I fear we're going to miss something. (In general its looking good).
# @param selector [Hash] Selector(s) parsed by Krane::LabelSelector | ||
# @param verify_result [Boolean] Wait for completion and verify success | ||
# | ||
# @return [nil] | ||
def run!(deployments_names = nil, selector: nil, verify_result: true) | ||
def run!(deployments: nil, selector: nil, verify_result: true) |
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 think deployments is the right name here. There was talk about supporting DS's as well, under a new keyword. I think that's better than a generic resources
where we have to manually fetch both and check to see what exists.
lib/krane/render_task.rb
Outdated
@@ -12,13 +12,13 @@ class RenderTask | |||
# | |||
# @param logger [Object] Logger object (defaults to an instance of Krane::FormattedLogger) | |||
# @param current_sha [String] The SHA of the commit | |||
# @param template_dir [String] Path to a directory with templates to render (deprecated) | |||
# @param template_paths [Array<String>] An array of template paths to render | |||
# @param template_dir [String] Path to a directory with templates to render (*deprecated*) |
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.
Are you 🔥 this in a different PR?
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.
Yes, on #622
86f0aa9
to
b4d3edf
Compare
b4d3edf
to
149aaca
Compare
WDYT about the fact we still have |
Thanks for the rebase! I think it makes sense; I'll just send a separate commit bringing back the information about the removed arguments in the tables we're using to describe the renames.
Hmmm... well, the filename is the name of the file containing a template, so I think that TemplateSets still make sense. We could arguably change the OptionsHelper method but I wouldn't consider this a blocker for this issue, as our main goal here is to update the public interface of the Task classes. Unless you feel strongly that we should change this in this PR, I'd rather make this change afterwards. |
Added to the tech debt tracking issue: |
lib/krane/cli/run_command.rb
Outdated
@@ -19,10 +19,11 @@ class RunCommand | |||
}, | |||
"verify-result" => { type: :boolean, desc: "Wait for completion and verify pod success", default: true }, | |||
"command" => { type: :array, desc: "Override the default command in the container image" }, | |||
"template" => { | |||
"filename" => { |
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 thought we decided against this #568
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.
Good catch, thank you! I wasn't aware of that. I'll update this PR undoing this particular change.
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.
Done. This is ready for another review.
c0e60e1
to
8994eb1
Compare
18b841f
to
564c3cc
Compare
c23250b
to
b59a0bd
Compare
What are you trying to accomplish with this PR?
How is this accomplished?
By changing the public task interfaces so their argument names would match the respective flag names, and updating the test setup accordingly.