openshift / vertical-pod-autoscaler-operator

An Operator for running the Vertical Pod Autoscaler on OpenShift
Apache License 2.0
27 stars 30 forks source link

PODAUTO-225: Re-enable VPA alm-example in CSV and add spec descriptors #177

Closed maxcao13 closed 1 month ago

maxcao13 commented 1 month ago

This commit re-enables the VPA example in the CSV for the OCP console to use. Turns out the VPA is a "supported resource" and operator-sdk adds your supported resource examples to the bundle regardless if it's actually an owned resource or not. This commit simply uncomments the sample, and manually removes it from the bundle folder after we generate the bundle.

This is what I am talking about: https://github.com/operator-framework/operator-registry/blob/c8307cac2e6ea71b3719e6d5a5850dd639da296f/pkg/lib/bundle/supported_resources.go#L18

Operator-sdk generate bundle goes through files and writes CRDs, Services, and "supported resources" to the bundle directory only. Unfortunately, we supply one of those resources in an operator-sdk project :p

This commit also adds spec descriptors to the VPA since the scorecard test now complains about them not being present after adding an example.

Finally, this commit also fixes a bug when deploying the bundle with Make and specifying an OPERAND_IMG.

openshift-ci-robot commented 1 month ago

@maxcao13: This pull request references PODAUTO-225 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.18.0" version, but no target version was set.

In response to [this](https://github.com/openshift/vertical-pod-autoscaler-operator/pull/177): >This commit re-enables the VPA example in the CSV for the OCP console to use. Turns out the VPA is a "supported resource" and operator-sdk adds your supported resource examples to the bundle regardless if it's actually an owned resource or not. This commit simply uncomments the sample, and manually removes it from the bundle folder after we generate the bundle. > >This is what I am talking about: https://github.com/operator-framework/operator-registry/blob/c8307cac2e6ea71b3719e6d5a5850dd639da296f/pkg/lib/bundle/supported_resources.go#L18 > >Operator-sdk generate bundle goes through files and writes [CRDs, Services, and "supported resources"](https://github.com/operator-framework/operator-sdk/blob/819984d4c1a51c8ff2ef6c23944554148ace0752/internal/cmd/operator-sdk/generate/internal/manifests.go#L40) to the bundle directory only. Unfortunately, we supply one of those resources in an operator-sdk project :p > >This commit also fixes a bug when deploying the bundle with Make and specifying an OPERAND_IMG. Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Fvertical-pod-autoscaler-operator). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-ci-robot commented 1 month ago

@maxcao13: This pull request references PODAUTO-225 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.18.0" version, but no target version was set.

In response to [this](https://github.com/openshift/vertical-pod-autoscaler-operator/pull/177): >This commit re-enables the VPA example in the CSV for the OCP console to use. Turns out the VPA is a "supported resource" and operator-sdk adds your supported resource examples to the bundle regardless if it's actually an owned resource or not. This commit simply uncomments the sample, and manually removes it from the bundle folder after we generate the bundle. > >This is what I am talking about: https://github.com/operator-framework/operator-registry/blob/c8307cac2e6ea71b3719e6d5a5850dd639da296f/pkg/lib/bundle/supported_resources.go#L18 > >Operator-sdk generate bundle goes through files and writes [CRDs, Services, and "supported resources"](https://github.com/operator-framework/operator-sdk/blob/819984d4c1a51c8ff2ef6c23944554148ace0752/internal/cmd/operator-sdk/generate/internal/manifests.go#L40) to the bundle directory only. Unfortunately, we supply one of those resources in an operator-sdk project :p > >This commit also adds spec descriptors to the VPA since the scorecard test now complains about them not being present after adding an example. > >Finally, this commit also fixes a bug when deploying the bundle with Make and specifying an OPERAND_IMG. Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Fvertical-pod-autoscaler-operator). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
maxcao13 commented 1 month ago

If anyone wants to test how the spec descriptors actually display, they need to have a cluster and log onto the console and deploy the bundle. Then go to installed operators and try creating a VerticalPodAutoscaler CR.

It looks something like this now: image

openshift-ci[bot] commented 1 month ago

@maxcao13: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
joelsmith commented 1 month ago

Thanks for getting to the bottom of that! /lgtm /approve

openshift-ci[bot] commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: joelsmith, maxcao13

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: - ~~[OWNERS](https://github.com/openshift/vertical-pod-autoscaler-operator/blob/master/OWNERS)~~ [joelsmith] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
openshift-bot commented 1 month ago

[ART PR BUILD NOTIFIER]

Distgit: vertical-pod-autoscaler-operator This PR has been included in build ose-vertical-pod-autoscaler-operator-container-v4.18.0-202409260309.p0.gafabb77.assembly.stream.el9. All builds following this will include this PR.