Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

Flip storage version of CloudBuildSource to v1 #1797

Merged

Conversation

eclipselu
Copy link
Contributor

@eclipselu eclipselu commented Oct 5, 2020

Fixes #1610

Proposed Changes

  • Flip storage version of CloudBuildSource from v1beta1 to v1
  • Add pre-install storage migration jobs to the release manifest

Release Note

Change the storage version of "cloudbuildsources.events.cloud.google.com" from v1beta1 to v1:

action required: You must run pre-install job prior to upgrading to get these resources to v1 API.
ko apply -f config/pre-install/v0.19.0/

Docs

@google-cla google-cla bot added the cla: yes (override cla status due to multiple authors bug) label Oct 5, 2020
@capri-xiyue
Copy link
Contributor

capri-xiyue commented Oct 5, 2020

@eclipselu Have you ran the pre-install job and verified it still works after the change of cluster role?

@capri-xiyue
Copy link
Contributor

/lgtm
/approve
/hold
feel free to unhold when you confirm the pre-install job still works after the change of cluster role.

@eclipselu
Copy link
Contributor Author

eclipselu commented Oct 5, 2020

Test done:

1. Install release-0.17 and create a CloudBuildSource CO.

  1. Checkout release-0.17 branch, follow Install Knative-GCP and Installing a Service Account for the Data Plane to install knative-gcp.
  2. Create an CloudBuildSource object
k apply -f docs/examples/cloudbuildsource/cloudbuildsource.yaml
  1. Check CRD storedVersion:
k get customresourcedefinition.apiextensions.k8s.io/cloudbuildsources.events.cloud.google.com -o=jsonpath='{.status.storedVersions}'
# ["v1beta1"]

2. Upgrade to release-0.18

  1. Checkout release-0.18 branch, follow Install Knative-GCP and Installing a Service Account for the Data Plane to install knative-gcp.
  2. Run pre-install job:
ko apply -f config/pre-install/v0.18.0
  1. Check CRD storedVersion:
k get customresourcedefinition.apiextensions.k8s.io/cloudbuildsources.events.cloud.google.com -o=jsonpath='{.status.storedVersions}'
# ["v1beta1"]
  1. Check if we can still get the CO:
k get cloudbuildsource -o yaml
# should output the CO
  1. Check if migration job completed running.
k get pods -l app=storage-version-migration-knative-gcp -n cloud-run-events
NAME                                          READY   STATUS      RESTARTS   AGE
storage-version-migration-knative-gcp-fsxvk   0/1     Completed   0          61m

3. Flip CloudBuildSource storage version to v1

  1. Checkout current branch in this PR, follow Install Knative-GCP and Installing a Service Account for the Data Plane to install knative-gcp.
  2. Run pre-install job:
ko apply -f config/pre-install/v0.19.0
  1. Check CRD storedVersion, it should be v1
k get customresourcedefinition.apiextensions.k8s.io/cloudbuildsources.events.cloud.google.com -o=jsonpath='{.status.storedVersions}'
# ["v1"]
  1. Check if we can still get the CO:
k get cloudbuildsource -o yaml
# should output the CO
  1. Check if migration job completed running.
k get pods -l app=storage-version-migration-knative-gcp-v0-19-0 -n cloud-run-events
NAME                                                  READY   STATUS      RESTARTS   AGE
storage-version-migration-knative-gcp-v0-19-0-qswc8   0/1     Completed   0          56m

Summary

This means that we can successfully upgrade from v0.18.0 -> v0.19.0, even if user previously upgraded to v0.18.0 from v0.17.0. The last migration job should not conflict with migration jobs in the previous versions (e.g. v0.18.0)

@capri-xiyue
Copy link
Contributor

/lgtm
/approve
/unhold

Copy link
Contributor

@danyinggu danyinggu left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks!

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: capri-xiyue, danyinggu, eclipselu

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 [capri-xiyue,danyinggu]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot merged commit 78a00cd into google:master Oct 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved cla: yes (override cla status due to multiple authors bug) lgtm size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make v1 the storage version of CloudBuildSource
4 participants