-
Notifications
You must be signed in to change notification settings - Fork 253
store cluster version into clusterdeployment status #120
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
store cluster version into clusterdeployment status #120
Conversation
755d0ab to
afaf711
Compare
|
|
||
| // ClusterVersion locally stores the remote cluster's clusterversion.status.current.version field | ||
| ClusterVersion string `json:"clusterVersion"` | ||
|
|
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.
Realistically I think treating this as just a string will probably get us into a spot where we need to break API compatibility in the near future. We should make this a struct, the Update struct also has a Payload which looks really interesting for our purposes as well and we should.
Should we pull the FULL ClusterVersionStatus? Or just make our own and copy over parts of it? Looking through https://github.com/openshift/api/blob/master/config/v1/types_cluster_version.go#L75 we're not really interested in the Generation or VersionHash but the Conditions and the AvailableUpdates could be extremely useful. I'd be tempted to re-use their type and copy the whole thing.
Thoughts?
CC @csrwng in case he has ideas as well.
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 agree, I think there's usefulness in embedding the entire status struct
| object.SetFinalizers(finalizers.List()) | ||
| } | ||
|
|
||
| func buildRemoteClusterAPIClient(secretData string) (client.Client, 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.
We should probably get this refactored out to a common utility as this is probably the second usage.
| assert.Equal(t, cd.Status.APIURL, "https://bar-api.clusters.example.com:6443") | ||
| assert.Equal(t, cd.Status.WebConsoleURL, "https://bar-api.clusters.example.com:6443/console") | ||
| assert.Equal(t, "https://bar-api.clusters.example.com:6443", cd.Status.APIURL) | ||
| assert.Equal(t, "https://bar-api.clusters.example.com:6443/console", cd.Status.WebConsoleURL) |
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.
| return err | ||
| } | ||
|
|
||
| cdLog.Debugf("remote desired version for cluster %v: %+v", cd.Name, remoteClusterVersion.Status.Current) |
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.
If you want to report the desired version, it should be remoteCusterVersion.Spec.DesiredUpdate.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.
yep. i meant to print the current version out of status, not the desired version in spec
afaf711 to
77acb73
Compare
|
Now storing the entirety of the clusterversion.Status as suggested. Have a temporary hack commit to get around needing to allow empty clusterversion.Status.AvailableVersion[]. Waiting for openshift/api#143 (or something like it) to merge, and then can re-vendor openshift/api. |
|
/retest |
|
Looks like a legit compile error, missing a package. |
77acb73 to
2b188c5
Compare
|
Still a problem, looks like a missing omit empty. |
0cd0688 to
db32e31
Compare
db32e31 to
e453029
Compare
|
/retest |
when we have a kubeconfig for the remote cluster, fetch the ClusterVersion.Status and store it in ClusterDeployment.Status.ClusterVersionStatus handle nil values for fields in clusterVersion.Status (so we can pass object validation) update test cases to work with new need to mock up remote ClusterVersion object refactor the building of a remotecluster kubeclient (and update remotemachineset controller accordingly)
d97a1dd to
2cdff7e
Compare
6220829 to
6b498e0
Compare
|
/retest |
|
/lgtm |
when we have a kubeconfig for the remote cluster, fetch the ClusterVersion.Status and store it in ClusterDeployment.Status.ClusterVersionStatus
handle nil values for fields in clusterVersion.Status (so we can pass object validation)
update test cases to work with new need to mock up remote ClusterVersion object
refactor the building of a remotecluster kubeclient (and update remotemachineset controller accordingly)
build on top of #127 to get beyond the gomock issues