-
Notifications
You must be signed in to change notification settings - Fork 29
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
Release charts update cmd #464
Release charts update cmd #464
Conversation
b2a785f
to
ea03c74
Compare
e253f9a
to
4d16e09
Compare
d227123
to
24523a8
Compare
cmd/release/cmd/update.go
Outdated
|
||
var branch, chart, version string | ||
var found bool | ||
var err error |
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 can be a problem when an error is checked and the action is not to return which leaves this value potentially untouched on a subsequent check causing issues. Let's not define a catch-all error value here.
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.
Implemented
release/charts/arguments.go
Outdated
@@ -0,0 +1,132 @@ | |||
package charts |
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.
What's the context for the name arguments? If it's related to the command(s) being ran, that's an implementation leak and should be renamed to represent the business logic and now how the logic is used.
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.
Implemented a fix from what I could at understand at:
"changing naming strategy from arguments.go -> chart_management.go"
Commit.
release/charts/arguments.go
Outdated
|
||
// BranchArgs will return the list of available branch version lines | ||
func BranchArgs() []string { | ||
return []string{"2.9", "2.8"} |
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.
Can this be part of configuration to avoid code changes when things 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.
Implementing
cmd/release/cmd/update.go
Outdated
@@ -3,7 +3,10 @@ package cmd | |||
import ( | |||
"context" | |||
"errors" | |||
"fmt" | |||
"log" |
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.
Let's remove this in favor of regular CLI outut. We don't have anything consuming these logs and they're created at the time of execution so their timestamp values don't give us any extra value.
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.
Implemented
Issue:
#446
Solution:
After implementing: rancher/charts-build-scripts#145
This is the integration between:
charts-build-scripts
commandrelease
ecm-distro-tools
commandrelease update charts
Result example:
Extra
Implemented auto-completion for the 3 arguments on the command:
<branch>
has 2 options:2.8 and 2.9
<chart>
will auto-complete all available charts in the repo.<version>
will check the state.json file generated from the list command, look in real-time for available release versions, and auto-complete that.This extra is very very useful!