-
Notifications
You must be signed in to change notification settings - Fork 4.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
Require extra flag when updating cluster with downgraded kops version #9362
Conversation
pkg/apis/kops/registry/registry.go
Outdated
@@ -29,6 +29,8 @@ const ( | |||
PathCluster = "config" | |||
// Path for completed cluster spec in the state store | |||
PathClusterCompleted = "cluster.spec" | |||
// PathKopsVersion is the path for the version of kops last used to apply the cluster. | |||
PathKopsVersionApplied = "kops-version-applied.txt" |
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 this would be closer to cluster.spec
, master-a
, config
that are in the bucket root.
PathKopsVersionApplied = "kops-version-applied.txt" | |
PathKopsVersionApplied = "kops.version" |
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.
Having the well-known .txt
extension helps with troubleshooting.
upup/pkg/fi/cloudup/apply_cluster.go
Outdated
if err == nil { | ||
version, err := semver.Parse(strings.TrimSpace(string(kopsVersionApplied))) | ||
if err != nil { | ||
return fmt.Errorf("error parsing last kops version applied: %v", err) |
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.
return fmt.Errorf("error parsing last kops version applied: %v", err) | |
return fmt.Errorf("error parsing last kops version last used to update: %v", err) |
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.
It's not the last version used. One can use a downrev or uprev kops to edit the cluster or ig specs; it only matters which version of kops last did an apply_cluster
without dryrun.
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 understand this, but it's more from the developer's point of view. "Used" is more user oriented.
In any case, even using "last kops version used to apply changes" would be a bit better.
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.
Perhaps "updated", since the CLI command is kops update cluster --yes
. The apply_cluster.go
is mixing terminology a bit.
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.
That would be even better.
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.
Went with the "updated" terminology.
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.
Probably you want to update this message also.
pkg/apis/kops/registry/registry.go
Outdated
// PathKopsVersion is the path for the version of kops last used to apply the cluster. | ||
PathKopsVersionApplied = "kops-version-applied.txt" |
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.
// PathKopsVersion is the path for the version of kops last used to apply the cluster. | |
PathKopsVersionApplied = "kops-version-applied.txt" | |
// PathKopsVersionUsed is the path for the version of kops last used to apply the cluster. | |
PathKopsVersionUsed = "kops.version" |
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.
Again, it's not the last kops version used.
23c5843
to
4b08534
Compare
pkg/apis/kops/registry/registry.go
Outdated
@@ -29,6 +29,8 @@ const ( | |||
PathCluster = "config" | |||
// Path for completed cluster spec in the state store | |||
PathClusterCompleted = "cluster.spec" | |||
// PathKopsVersionUpdated is the path for the version of kops last used to apply the cluster. | |||
PathKopsVersionUpdated = "kops-version-updated.txt" |
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.
Should be enough without updated.
PathKopsVersionUpdated = "kops-version-updated.txt" | |
PathKopsVersionUpdated = "kops-version.txt" |
4b08534
to
d06f98d
Compare
/lgtm |
d06f98d
to
56272d4
Compare
/retest |
1 similar comment
/retest |
56272d4
to
c662e6d
Compare
/lgtm |
Agreed during office hours that this is good to merge as-is |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: johngmyers, rifelpet The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
c662e6d
to
903030d
Compare
903030d
to
3201cc4
Compare
/lgtm |
No description provided.