Skip to content
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

report release image version in clusterdeployment status #1278

Conversation

abhinavdahiya
Copy link
Contributor

The release image today include the metadata (cincinatti metadata) for version
information in release-metadata file, see 1.

The update-installer-image job today reads the release image contents and then
extracts images for installer and cli for each cluster deployment. Since it already
interacts with release image once per cluster deployment, it seems like the right place
to also include code to extract and report the release image version.

  • the install image set job init container now copies /release-image/release-metadata file
    in additions to the image-references file.

  • the update-installer-image command reads this release-metadata file and reports the version
    to the status like the installer, cli images.

NOTE: oc uses the release metadata to get the version field and fallback to image stream name
from the image-references 2 and update-installer-image keeps the same behavior.

xref: https://issues.redhat.com/browse/HIVE-1350

/assign @dgoodwin

// ReleaseVersion is the version of OpenShift as reported by the release image
// resolved for the installation.
// +optional
ReleaseVersion *string `json:"releaseVersion,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is ReleaseVersion sufficiently differentiated from the clusters current version? Maybe "is the initial version of OpenShift that was installed, as reported..." would help a little.

Would InstallVersion or InstallReleaseVersion be better? InitialReleaseVersion?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used InstallVersion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dgoodwin used InstallVersion to be clear that this version was reported for installation

@@ -250,3 +270,20 @@ func getClient(kubeConfig *rest.Config) (client.Client, error) {
}
return kubeClient, nil
}

// cincinnatiMetadata is the compact version of the release metadata as
// as stored by the release-image generator in [1].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"as as"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

pkg/imageset/updateinstaller.go Show resolved Hide resolved
name string
name string
images map[string]string
version string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was tempted to request an e2e test for this, but as implemented the job will fail if something is wrong, so in theory we're already getting coverage that this code works. I'm not sure we'd want to assert specific versions in the e2e test anyhow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test was testing there are on errors and not the actual values and as you said it already covers testing the release version code path..

The release image today include the metadata (cincinatti metadata) for version
information in release-metadata file, see [1].

The update-installer-image job today reads the release image contents and then
extracts images for installer and cli for each cluster deployment. Since it already
interacts with release image once per cluster deployment, it seems like the right place
to also include code to extract and report the release image version.

- the install image set job init container now copies /release-image/release-metadata file
  in additions to the image-references file.

- the update-installer-image command reads this release-metadata file and reports the version
  to the status like the installer, cli images.

NOTE: oc uses the release metadata to get the version field and fallback to image stream name
from the image-references [2] and update-installer-image keeps the same behavior.

[1]: https://github.com/openshift/oc/blob/c66c03f3012a10f16eb86fdce6330433adf6c9ee/pkg/cli/admin/release/info.go#L787
[2]: https://github.com/openshift/oc/blob/c66c03f3012a10f16eb86fdce6330433adf6c9ee/pkg/cli/admin/release/info.go#L718-L723
@dgoodwin
Copy link
Contributor

dgoodwin commented Feb 9, 2021

/lgtm

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, dgoodwin

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 9, 2021
@openshift-merge-robot openshift-merge-robot merged commit 6a88536 into openshift:master Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants