Skip to content

Upgrade pingsource storage to v1alpha2#3274

Merged
knative-prow-robot merged 4 commits into
knative:masterfrom
lionelvillard:ping-v1alpha2
Jun 15, 2020
Merged

Upgrade pingsource storage to v1alpha2#3274
knative-prow-robot merged 4 commits into
knative:masterfrom
lionelvillard:ping-v1alpha2

Conversation

@lionelvillard
Copy link
Copy Markdown
Contributor

@lionelvillard lionelvillard commented Jun 4, 2020

Proposed Changes

  • PingSource reconciler uses v1alpha2 API

Release Note

- 🧽 Update or clean up current behavior
Reconcile PingSource using v1alpha2 API

Docs

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 4, 2020
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jun 4, 2020
@knative-prow-robot knative-prow-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 4, 2020
Copy link
Copy Markdown
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)

@knative-test-reporter-robot
Copy link
Copy Markdown

The following jobs failed:

Test name Triggers Retries
pull-knative-eventing-integration-tests 0/3

Failed non-flaky tests preventing automatic retry of pull-knative-eventing-integration-tests:

test/e2e.TestPingSourceV1Alpha1
test/e2e.TestPingSourceV1Alpha2ResourceScope

@knative-prow-robot knative-prow-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 4, 2020
@knative-prow-robot knative-prow-robot added the area/test-and-release Test infrastructure, tests or release label Jun 4, 2020
Copy link
Copy Markdown
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)

Comment thread pkg/reconciler/pingsource/controller.go Outdated
pingsourceinformer "knative.dev/eventing/pkg/client/injection/informers/sources/v1alpha1/pingsource"
pingsourcereconciler "knative.dev/eventing/pkg/client/injection/reconciler/sources/v1alpha1/pingsource"
"knative.dev/eventing/pkg/apis/sources/v1alpha2"
"knative.dev/pkg/client/injection/kube/informers/rbac/v1/rolebinding"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Format Go code:

Suggested change
"knative.dev/pkg/client/injection/kube/informers/rbac/v1/rolebinding"

pingsourcereconciler "knative.dev/eventing/pkg/client/injection/reconciler/sources/v1alpha2/pingsource"
kubeclient "knative.dev/pkg/client/injection/kube/client"
deploymentinformer "knative.dev/pkg/client/injection/kube/informers/apps/v1/deployment"
"knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Format Go code:

Suggested change
"knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount"
"knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount"
"knative.dev/pkg/client/injection/kube/informers/rbac/v1/rolebinding"

@lionelvillard lionelvillard changed the title WIP: upgrade pingsource storage to v1alpha2 Upgrade pingsource storage to v1alpha2 Jun 4, 2020
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 4, 2020
Comment thread pkg/reconciler/pingsource/resources/service_account.go Outdated
- name: v1alpha1
served: true
storage: true
served: false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this work like this? I thought you needed both v1alpha1 / v1alpha2 to be served since the storage migration reads v1alpha1 then upgrades to v1alpha2, so if you remove the serving, not sure it will work?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

served: false means you cannot do kubeclt get pingsources.v1alpha1.sources.knative.dev but kubeclt get pingsources.sources.knative.dev works because of the conversion webhook. Anyway I don't know the details but it works

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hm, ok, well, wow, I'm really confused then :) I thought it would exactly use the pingsources.v1alpha1.sources.knative.dev (as in versioned read) of v1alpha1, then patch using v1alpha2. I think pingsources.sources.knative.dev will give you the v1alpha2 already converted. But, if you've already verified that the actual conversion happens and the storage version gets bumped, 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The migration tools list all resources and perform an empty patch which triggers a migration on the K8s API server.

I did it twice and it works.

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 9, 2020
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 10, 2020
@@ -0,0 +1 @@
core/roles/pingsource-adapter-clusterrole.yaml No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add trailing newline:

Suggested change
core/roles/pingsource-adapter-clusterrole.yaml
core/roles/pingsource-adapter-clusterrole.yaml

@knative-metrics-robot
Copy link
Copy Markdown

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

File Old Coverage New Coverage Delta
pkg/reconciler/pingsource/pingsource.go 68.6% 67.8% -0.8
pkg/reconciler/pingsource/resources/role_binding.go Do not exist 100.0%
pkg/reconciler/resources/service_account.go Do not exist 100.0%

@lionelvillard
Copy link
Copy Markdown
Contributor Author

/cc @n3wscott @vaikas @matzew

@lionelvillard
Copy link
Copy Markdown
Contributor Author

ping

@vaikas
Copy link
Copy Markdown
Contributor

vaikas commented Jun 15, 2020

/lgtm
/approve

Are there any documentation related tasks that should be done as part of this, or did they all get resolved when the API was upgraded.

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 15, 2020
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lionelvillard, vaikas

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [lionelvillard,vaikas]

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 110e23e into knative:master Jun 15, 2020
@lionelvillard lionelvillard deleted the ping-v1alpha2 branch September 3, 2020 15:59
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. area/test-and-release Test infrastructure, tests or release cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants