Update: see the adjusted approach in the comment below.
1. I think it's just problematic that the script can be executed at one point in time and Releases applied at a complete different time. Anything can happen in between, e.g. we saw Snapshots disappearing. I think it's better that the script does kubectl apply in {}no-dry-run{-} mode. It should still be able to output yamls in the default -dry-run mode but in such a way they fail when piped in kubectl.
2. RELEASE_NAME_SUFFIX doesn't make sense to me. Let's just use short git commit. The generated Release name should mention prod or stage from the passed ENVIRONMENT.
3. I think the script should ensure that it's always master branch and that it's a HEAD commit of it really matching the HEAD of remote master. We could allow overrides but with some explicit option like --i-really-really-know-what-i-am-doing.
Relevant Slack thread https://redhat-internal.slack.com/archives/C05TS9N0S7L/p1748943981299349?thread_ts=1748865518.284599&cid=C05TS9N0S7L
Update:
4. It looks like not only Snapshot-s also but Release-s tend to disappear from the cluster way too soon. We should back up these resources somewhere for tracking and investigations.
5. The script sometimes generates multiple different release objects with the same metadata.name (but different snapshots):
$ git checkout db1a8d529b55c4d5b17f7498990846b87de3a5ec [...] $ ./scripts/generate-releases.sh staging db1a8d5-stage-1 > release-db1a8d5-stage-1.yaml $ grep name: release-db1a8d5-stage-1.yaml name: acs-operator-index-ocp-v4-12-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-12-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-12-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-13-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-13-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-13-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-14-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-14-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-14-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-15-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-15-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-15-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-16-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-16-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-16-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-17-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-17-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-17-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-18-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-18-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-18-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-19-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-19-db1a8d5-stage-1 name: acs-operator-index-ocp-v4-19-db1a8d5-stage-1 $
Release file and snapshot dumps attached.
This leads to errors when applying the file:
$ oc apply -f release-db1a8d5-stage-1.yaml release.appstudio.redhat.com/acs-operator-index-ocp-v4-12-db1a8d5-stage-1 created release.appstudio.redhat.com/acs-operator-index-ocp-v4-13-db1a8d5-stage-1 created release.appstudio.redhat.com/acs-operator-index-ocp-v4-14-db1a8d5-stage-1 created release.appstudio.redhat.com/acs-operator-index-ocp-v4-15-db1a8d5-stage-1 created release.appstudio.redhat.com/acs-operator-index-ocp-v4-16-db1a8d5-stage-1 created release.appstudio.redhat.com/acs-operator-index-ocp-v4-17-db1a8d5-stage-1 created release.appstudio.redhat.com/acs-operator-index-ocp-v4-18-db1a8d5-stage-1 created release.appstudio.redhat.com/acs-operator-index-ocp-v4-19-db1a8d5-stage-1 created Error from server (Forbidden): error when applying patch: {"metadata":{"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"appstudio.redhat.com/v1alpha1\",\"kind\":\"Release\",\"metadata\":{\"annotations\":{},\"name\":\"acs-operator-index-ocp-v4-12-db1a8d5-stage-1\",\"namespace\":\"rh-acs-tenant\"},\"spec\":{\"releasePlan\":\"acs-operator-index-staging-ocp-v4-12\",\"snapshot\":\"acs-operator-index-ocp-v4-12-t7v5t\"}}\n"}},"spec":{"snapshot":"acs-operator-index-ocp-v4-12-t7v5t"}} to: Resource: "appstudio.redhat.com/v1alpha1, Resource=releases", GroupVersionKind: "appstudio.redhat.com/v1alpha1, Kind=Release" Name: "acs-operator-index-ocp-v4-12-db1a8d5-stage-1", Namespace: "rh-acs-tenant" for: "release-db1a8d5-stage-1.yaml": error when patching "release-db1a8d5-stage-1.yaml": admission webhook "vrelease.kb.io" denied the request: release resources spec cannot be updated Error from server (Forbidden): error when applying patch: {"metadata":{"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"appstudio.redhat.com/v1alpha1\",\"kind\":\"Release\",\"metadata\":{\"annotations\":{},\"name\":\"acs-operator-index-ocp-v4-12-db1a8d5-stage-1\",\"namespace\":\"rh-acs-tenant\"},\"spec\":{\"releasePlan\":\"acs-operator-index-staging-ocp-v4-12\",\"snapshot\":\"acs-operator-index-ocp-v4-12-zxbl8\"}}\n"}},"spec":{"snapshot":"acs-operator-index-ocp-v4-12-zxbl8"}} to: Resource: "appstudio.redhat.com/v1alpha1, Resource=releases", GroupVersionKind: "appstudio.redhat.com/v1alpha1, Kind=Release" Name: "acs-operator-index-ocp-v4-12-db1a8d5-stage-1", Namespace: "rh-acs-tenant" for: "release-db1a8d5-stage-1.yaml": error when patching "release-db1a8d5-stage-1.yaml": admission webhook "vrelease.kb.io" denied the request: release resources spec cannot be updated
- relates to
-
ROX-30124 Save release and snapshots of the Release
-
- Closed
-