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-1014: bundle/manifests: Update UpdateService CRD to pick up metadataURI #179

Merged
merged 1 commit into from
Nov 24, 2023

Conversation

wking
Copy link
Member

@wking wking commented Nov 22, 2023

Generated with:

$ cp config/crd/bases/updateservice.operator.openshift.io_updateservices.yaml bundle/manifests/updateservice.operator.openshift.io_updateservices.yaml

to catch up with 6b266d2 (#173) suggests I could have done this with make bundle VERSION=5.0.3-dev or some such, but I don't have operator-sdk installed at the moment.

Generated with:

  $ cp config/crd/bases/updateservice.operator.openshift.io_updateservices.yaml bundle/manifests/updateservice.operator.openshift.io_updateservices.yaml

to catch up with 6b266d2 (config: Regenerate UpdateService CRD,
2023-10-03, openshift#176).  24c7382 (Include bundle manifests and
Dockerfile, 2023-08-08, openshift#173) suggests I could have done this with
'make bundle VERSION=5.0.3-dev' or some such, but I don't have
operator-sdk installed at the moment.
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 22, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 22, 2023

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

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.15.0" version, but no target version was set.

In response to this:

Generated with:

$ cp config/crd/bases/updateservice.operator.openshift.io_updateservices.yaml bundle/manifests/updateservice.operator.openshift.io_updateservices.yaml

to catch up with 6b266d2 (#173) suggests I could have done this with make bundle VERSION=5.0.3-dev or some such, but I don't have operator-sdk installed at the moment.

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.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 22, 2023
Copy link
Contributor

openshift-ci bot commented Nov 22, 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.

@wking
Copy link
Member Author

wking commented Nov 22, 2023

Testing with Cluster Bot launch 4.14,openshift/cincinnati-operator#178 gcp:

$ oc adm upgrade
Cluster version is 4.14.0-0.test-2023-11-22-221520-ci-ln-4rl3xqt-latest
...
$ oc get -o json customresourcedefinition updateservices.updateservice.operator.openshift.io | jq -r '.spec.versions[].schema.openAPIV3Schema.properties.status.properties | to_entries[].key'
conditions
metadataURI
policyEngineURI

And then deploying from here:

$ sed -i 's/namespace: openshift-update-service/namespace: install-osus-here/g' *.yaml
$ oc apply -f .
imagestream.image.openshift.io/graph-data created
buildconfig.build.openshift.io/graph-data created
updateservice.updateservice.operator.openshift.io/example created
$ oc -n install-osus-here get -o json updateservice example | jq -r .status.metadataURI
https://example-meta-route-install-osus-here.apps.ci-ln-4rl3xqt-72292.origin-ci-int-gce.dev.rhcloud.com

so that looks good to me. I didn't inject any signatures in my graph-data image, but I don't have any handy BuildConfig to do that, so skipping it for now.

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

openshift-ci bot commented Nov 24, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: petr-muller, 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-merge-bot openshift-merge-bot bot merged commit d0fb737 into openshift:master Nov 24, 2023
8 checks passed
@wking wking deleted the update-bundle-CRD branch November 28, 2023 19:07
wking added a commit to wking/cincinnati-operator that referenced this pull request May 21, 2024
The Go-side 'optional' was not enough to get these optional, so talk
to kubebuilder directly.  We need metadataURI to be optional to avoid
[1]:

  $ oc -n openshift-update-service get -o json installplan install-wpgw2 | jq '.status.conditions[]'
  {
    "lastTransitionTime": "2024-05-20T07:05:46Z",
    "lastUpdateTime": "2024-05-20T07:05:46Z",
    "message": "error validating existing CRs against new CRD's schema for \"updateservices.updateservice.operator.openshift.io\": error validating updateservice.operator.openshift.io/v1, Kind=UpdateService \"openshift-update-service/sample\": updated validation is too restrictive: [].status.metadataURI: Required value",
    "reason": "InstallComponentFailed",
    "status": "False",
    "type": "Installed"
  }

We need those existing 5.0.2 UpdateService to be compatible with the
incoming 5.0.3 CustomResourceDefinition, so we can install the new CRD
and updated operator, so the incoming operator can populate the new
metadataURI property.

While I was fixing that property, I'm adding the same comment to
policyEngineURI for consistency.  This will allow the operator do
things like setting conditions complaining about difficulty
provisioning the Route needed to figure out the policyEngineURI.

After updating the Go, I updated config/crd/bases/... like 6b266d2
(config: Regenerate UpdateService CRD, 2023-10-03, openshift#176):

  $ controller-gen rbac:roleName=updateservice-operator crd paths=./... output:crd:dir=config/crd/bases
  $ git add -p  # preserve additionalPrinterColumns

using the same:

  $ controller-gen --version
  Version: v0.13.0

I'd built in 6b266d2 (there may have been subsequent releases; I
haven't checked).  Then dropping the additionalPrinterColumns changes:

  $ git restore config/crd/bases/updateservice.operator.openshift.io_updateservices.yaml

And copying into the bundle as I'd done in e5716f8
(bundle/manifests: Update UpdateService CRD to pick up metadataURI,
2023-11-22, openshift#179):

  $ cp config/crd/bases/updateservice.operator.openshift.io_updateservices.yaml bundle/manifests/updateservice.operator.openshift.io_updateservices.yaml
wking added a commit to wking/cincinnati-operator that referenced this pull request May 21, 2024
The Go-side 'optional' was not enough to get these optional, so talk
to kubebuilder directly.  We need metadataURI to be optional to avoid
[1]:

  $ oc -n openshift-update-service get -o json installplan install-wpgw2 | jq '.status.conditions[]'
  {
    "lastTransitionTime": "2024-05-20T07:05:46Z",
    "lastUpdateTime": "2024-05-20T07:05:46Z",
    "message": "error validating existing CRs against new CRD's schema for \"updateservices.updateservice.operator.openshift.io\": error validating updateservice.operator.openshift.io/v1, Kind=UpdateService \"openshift-update-service/sample\": updated validation is too restrictive: [].status.metadataURI: Required value",
    "reason": "InstallComponentFailed",
    "status": "False",
    "type": "Installed"
  }

We need those existing 5.0.2 UpdateService to be compatible with the
incoming 5.0.3 CustomResourceDefinition, so we can install the new CRD
and updated operator, so the incoming operator can populate the new
metadataURI property.

While I was fixing that property, I'm adding the same comment to
policyEngineURI for consistency.  This will allow the operator do
things like setting conditions complaining about difficulty
provisioning the Route needed to figure out the policyEngineURI.

After updating the Go, I updated config/crd/bases/... like 6b266d2
(config: Regenerate UpdateService CRD, 2023-10-03, openshift#176):

  $ controller-gen rbac:roleName=updateservice-operator crd paths=./... output:crd:dir=config/crd/bases
  $ git add -p  # preserve additionalPrinterColumns

using the same:

  $ controller-gen --version
  Version: v0.13.0

I'd built in 6b266d2 (there may have been subsequent releases; I
haven't checked).  Then dropping the additionalPrinterColumns changes:

  $ git restore config/crd/bases/updateservice.operator.openshift.io_updateservices.yaml

And copying into the bundle as I'd done in e5716f8
(bundle/manifests: Update UpdateService CRD to pick up metadataURI,
2023-11-22, openshift#179):

  $ cp config/crd/bases/updateservice.operator.openshift.io_updateservices.yaml bundle/manifests/updateservice.operator.openshift.io_updateservices.yaml

[1]: https://issues.redhat.com/browse/OCPBUGS-33939
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

3 participants