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

OTA-925: pkg/steps/release/import_release: Set release.openshift.io/config name annotation #3350

Merged

Conversation

wking
Copy link
Member

@wking wking commented Mar 30, 2023

bee450b (#1098) taught assembleReleaseStep to consume the release.openshift.io/config annotation on an ImageStream to find a version prefix that actually reflects the 4.y release branch (instead of using 0.0.1-0 as the prefix). Those annotations are set on the app.ci ImageStreams, for example:

$ oc whoami -c
default/api-ci-l2s4-p1-openshiftapps-com:6443/wking
$ oc -n ocp get -o json imagestream 4.13 | jq -r '.metadata.annotations["release.openshift.io/config"] | fromjson | .name'
4.13.0-0.ci

But they are not set in ImageStreams contained within release images:

$ oc adm release info -o json registry.ci.openshift.org/ocp/release:4.13.0-0.ci-2023-03-29-224346 | jq '.references | {kind, metadata}'
{
  "kind": "ImageStream",
  "metadata": {
    "name": "4.13.0-0.ci-2023-03-29-224346",
    "creationTimestamp": "2023-03-29T22:52:54Z",
    "annotations": {
      "release.openshift.io/from-image-stream": "ocp/4.13-2023-03-29-224346"
    }
  }
}

With this commit, I'm taking the name out of the imported release ImageStream and trying to parse it as a Semantic Version. If it parses, I'm constructing a release.openshift.io/config annotation to set just the name property to the MAJOR.MINOR.PATCH from that parsed name. This should allow cluster-bot runs like:

launch 4.13.0-0.ci,openshift/cluster-version-operator#918,openshift/hypershift#2318 hypershift-hosted

to build releases named 4.13.0-0-... instead of their current 0.0.1-0-...:

$ curl -s https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/logs/release-openshift-origin-installer-launch-hypershift-hosted/1641294936391290880/artifacts/release/artifacts/release-payload-latest/image-references | jq -r .metadata.name
0.0.1-0.test-2023-03-30-043404-ci-ln-h9dwcbk-latest

which is failing to run with:

Release image is not valid: {
  "lastTransitionTime": "2023-03-30T04:36:29Z",
  "message": "releases before 4.8 are not supported",
  "observedGeneration": 3,
  "reason": "InvalidImage",
  "status": "False",
  "type": "ValidReleaseImage"
}

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 30, 2023
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 30, 2023

@wking: This pull request references OTA-925 which is a valid jira issue.

In response to this:

bee450b (#1098) taught assembleReleaseStep to consume the release.openshift.io/config annotation on an ImageStream to find a version prefix that actually reflects the 4.y release branch (instead of using 0.0.1-0 as the prefix). Those annotations are set on the app.ci ImageStreams, for example:

$ oc whoami -c
default/api-ci-l2s4-p1-openshiftapps-com:6443/wking
$ oc -n ocp get -o json imagestream 4.13 | jq -r '.metadata.annotations["release.openshift.io/config"] | fromjson | .name'
4.13.0-0.ci

But they are not set in ImageStreams contained within release images:

$ oc adm release info -o json registry.ci.openshift.org/ocp/release:4.13.0-0.ci-2023-03-29-224346 | jq '.references | {kind, metadata}'
{
 "kind": "ImageStream",
 "metadata": {
   "name": "4.13.0-0.ci-2023-03-29-224346",
   "creationTimestamp": "2023-03-29T22:52:54Z",
   "annotations": {
     "release.openshift.io/from-image-stream": "ocp/4.13-2023-03-29-224346"
   }
 }
}

With this commit, I'm taking the name out of the imported release ImageStream and trying to parse it as a Semantic Version. If it parses, I'm constructing a release.openshift.io/config annotation to set just the name property to the MAJOR.MINOR.PATCH from that parsed name. This should allow cluster-bot runs like:

launch 4.13.0-0.ci,openshift/cluster-version-operator#918,openshift/hypershift#2318 hypershift-hosted

to build releases named 4.13.0-0-... instead of their current 0.0.1-0-...:

$ curl -s https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/logs/release-openshift-origin-installer-launch-hypershift-hosted/1641294936391290880/artifacts/release/artifacts/release-payload-latest/image-references | jq -r .metadata.name
0.0.1-0.test-2023-03-30-043404-ci-ln-h9dwcbk-latest

which is failing to run with:

Release image is not valid: {
 "lastTransitionTime": "2023-03-30T04:36:29Z",
 "message": "releases before 4.8 are not supported",
 "observedGeneration": 3,
 "reason": "InvalidImage",
 "status": "False",
 "type": "ValidReleaseImage"
}

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@wking
Copy link
Member Author

wking commented Mar 30, 2023

/retest

…e annotation

bee450b (ci-operator: expose ephemeral cluster versions based on
parents, 2020-08-11, openshift#1098) taught assembleReleaseStep to consume the
release.openshift.io/config annotation on an ImageStream to find a
version prefix that actually reflects the 4.y release branch (instead
of using 0.0.1-0 as the prefix).  Those annotations are set on the
app.ci ImageStreams, for example:

  $ oc whoami -c
  default/api-ci-l2s4-p1-openshiftapps-com:6443/wking
  $ oc -n ocp get -o json imagestream 4.13 | jq -r '.metadata.annotations["release.openshift.io/config"] | fromjson | .name'
  4.13.0-0.ci

But they are not set in ImageStreams contained within release images:

  $ oc adm release info -o json registry.ci.openshift.org/ocp/release:4.13.0-0.ci-2023-03-29-224346 | jq '.references | {kind, metadata}'
  {
    "kind": "ImageStream",
    "metadata": {
      "name": "4.13.0-0.ci-2023-03-29-224346",
      "creationTimestamp": "2023-03-29T22:52:54Z",
      "annotations": {
        "release.openshift.io/from-image-stream": "ocp/4.13-2023-03-29-224346"
      }
    }
  }

With this commit, I'm taking the name out of the imported release
ImageStream and trying to parse it as a Semantic Version.  If it
parses, I'm constructing a release.openshift.io/config annotation to
set just the 'name' property to the MAJOR.MINOR.PATCH from that parsed
name.  This should allow cluster-bot runs like:

  launch 4.13.0-0.ci,openshift/cluster-version-operator#918,openshift/hypershift#2318 hypershift-hosted

to build releases named 4.13.0-0-... instead of their current
0.0.1-0-...:

  $ curl -s https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/logs/release-openshift-origin-installer-launch-hypershift-hosted/1641294936391290880/artifacts/release/artifacts/release-payload-latest/image-references | jq -r .metadata.name
  0.0.1-0.test-2023-03-30-043404-ci-ln-h9dwcbk-latest

which is failing to run with [1]:

  Release image is not valid: {
    "lastTransitionTime": "2023-03-30T04:36:29Z",
    "message": "releases before 4.8 are not supported",
    "observedGeneration": 3,
    "reason": "InvalidImage",
    "status": "False",
    "type": "ValidReleaseImage"
  }

[1]: https://prow.ci.openshift.org/view/gs/origin-ci-test/logs/release-openshift-origin-installer-launch-hypershift-hosted/1641294936391290880#1:build-log.txt%3A203-210
@wking wking force-pushed the major-minor-for-custom-releases branch from ff0d1a3 to 14ab04d Compare March 30, 2023 14:30
@bradmwilliams
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 30, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 31, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bradmwilliams, danilo-gemoli, wking

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 31, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 31, 2023

@wking: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit fad83ed into openshift:master Mar 31, 2023
@wking wking deleted the major-minor-for-custom-releases branch March 31, 2023 16:38
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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. 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

5 participants