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

Upgrade job (for v0.16.0) that deletes legacy {pullsubscription,topic}.pubsub.cloud.google.com COs #1383

Merged
merged 3 commits into from
Jul 8, 2020

Conversation

yolocs
Copy link
Member

@yolocs yolocs commented Jul 6, 2020

Fixes #1137

Proposed Changes

  • Added upgrade job for v0.16.0 release that deletes legacy COs

Release Note

Added upgrade job/yaml that deletes legacy {pullsubscription,topic}.pubsub.cloud.google.com COs

##Action Required
**Before updating** to 0.16, run the upgrade Job. Only after that Job has succeeded, then update to 0.16. Failure to run the update Job first, may leak the resources associated with the Kubernetes resources that were to be deleted, namely `Topic`s and `PullSubscriptoin`s in GCP.

Docs

@yolocs yolocs requested a review from Harwayne July 6, 2020 22:58
@googlebot googlebot added the cla: yes (override cla status due to multiple authors bug) label Jul 6, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yolocs

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

@nachocano
Copy link
Member

/retest

3 similar comments
@nachocano
Copy link
Member

/retest

@yolocs
Copy link
Member Author

yolocs commented Jul 7, 2020

/retest

@yolocs
Copy link
Member Author

yolocs commented Jul 7, 2020

/retest

@ian-mi
Copy link
Contributor

ian-mi commented Jul 7, 2020

Should this job be run using a more limited service account?
I think upgrade job is a misnomer since the job doesn't upgrade resources to the new API, it just deleted them. I might call this a cleanup instead. Should the job check that the equivalent resources exist in the new API as well?

@yolocs
Copy link
Member Author

yolocs commented Jul 7, 2020

@ian-mi If isolated from its context (if any), I would agree "cleanup" job is a better name.

@Harwayne for thoughts. I assumed this is part of a bigger upgrading plan. Also from the issue itself it seems I don't need to check the new API.

@Harwayne Harwayne self-assigned this Jul 7, 2020
Copy link
Contributor

@Harwayne Harwayne left a comment

Choose a reason for hiding this comment

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

/lgtm

Reading the code it looks correct, but just to be sure, you manually verified it doesn't delete the new Topic and PullSubscriptions, right?

@Harwayne
Copy link
Contributor

Harwayne commented Jul 7, 2020

/hold

Holding for @yolocs response to:

Reading the code it looks correct, but just to be sure, you manually verified it doesn't delete the new Topic and PullSubscriptions, right?

@yolocs
Copy link
Member Author

yolocs commented Jul 7, 2020

@Harwayne you mean the Topic and PullSubscription in the intevent API group?

@Harwayne
Copy link
Contributor

Harwayne commented Jul 7, 2020

@Harwayne you mean the Topic and PullSubscription in the intevent API group?

Yes.

@yolocs
Copy link
Member Author

yolocs commented Jul 7, 2020

@Harwayne I made some changes to fix a couple of bugs and used a dedicated SA for upgrade (as suggested by Ian). Also manually tested and confirmed new COs won't be deleted.

@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-google-knative-gcp-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/upgrader/v0.16.0/upgrader.go Do not exist 89.7%

Copy link
Contributor

@Harwayne Harwayne left a comment

Choose a reason for hiding this comment

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

/lgtm

@nachocano
Copy link
Member

nachocano commented Jul 7, 2020 via email

@capri-xiyue
Copy link
Contributor

/test pull-google-knative-gcp-wi-tests

@nachocano
Copy link
Member

nachocano commented Jul 8, 2020 via email

@capri-xiyue
Copy link
Contributor

/retest

@nachocano
Copy link
Member

/hold cancel

@capri-xiyue
Copy link
Contributor

/retest

@nachocano
Copy link
Member

nachocano commented Jul 8, 2020 via email

@knative-prow-robot
Copy link
Contributor

@yolocs: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-google-knative-gcp-wi-tests e00f4f1 link /test pull-google-knative-gcp-wi-tests

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.

@knative-test-reporter-robot

The following jobs failed:

Test name Triggers Retries
pull-google-knative-gcp-wi-tests pull-google-knative-gcp-wi-tests
pull-google-knative-gcp-wi-tests
pull-google-knative-gcp-wi-tests
pull-google-knative-gcp-wi-tests
pull-google-knative-gcp-wi-tests
pull-google-knative-gcp-wi-tests
pull-google-knative-gcp-wi-tests
pull-google-knative-gcp-wi-tests
pull-google-knative-gcp-wi-tests
3/3

Job pull-google-knative-gcp-wi-tests expended all 3 retries without success.

@nachocano
Copy link
Member

Unfortunately I'll have to force the push...

@nachocano nachocano merged commit ea0c93e into google:master Jul 8, 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.

Upgrade Job to delete {pullsubscription,topic}.pubsub.cloud.google.com COs
9 participants