Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add informers and listers for the advanced usages #642

Merged
merged 2 commits into from
Mar 9, 2021
Merged

Add informers and listers for the advanced usages #642

merged 2 commits into from
Mar 9, 2021

Conversation

zhangtbj
Copy link
Contributor

@zhangtbj zhangtbj commented Mar 5, 2021

Changes

In future, the Shipwright Build may be used by other clients, or we will have more advanced usages by leveraging the lister.
Let us add the informers and listers as a complete open-source controller

What I did in the PR:

  • Change the generate-codegen.sh to a common name update-codegen.sh
  • add informer and lister in the update-codegen.sh
  • Reran the update-codegen.sh, the clientset code is updated because the api change (Also compare with how Tekton and Knative do: https:/tektoncd/pipeline/tree/master/hack and https:/knative/serving/tree/master/hack)
  • Simplify the generated clientset folder from pkg/client/build to pkg/client directly
  • Add the verify-codegen.sh and verify if it is correct now (Of course, this verify-codegen.sh can be executed in each PR verification, but we can do that in future PR):
➜  build git:(add_informer) ✗ ./hack/verify-codegen.sh 

Using code-generator package version, as instructed in the go.mod file
The code-generator package is imported via the pkg/kubecodegen dir
To modify the current version, please modify this in the go.mod

Generating deepcopy funcs
Generating clientset for build:v1alpha1 at github.com/shipwright-io/build/pkg/client/clientset
Generating listers for build:v1alpha1 at github.com/shipwright-io/build/pkg/client/listers
Generating informers for build:v1alpha1 at github.com/shipwright-io/build/pkg/client/informers
Diffing /Users/jordan/gopath/src/github.com/shipwright-io/build against freshly generated codegen
/Users/jordan/gopath/src/github.com/shipwright-io/build up to date.
  • Add a README.md in the hack folder to introduce all scripts.
  • Refine the test code the use the correct generated clientset package

Submitter Checklist

  • [ y ] Includes tests if functionality changed/was added
  • [ y ] Includes docs if changes are user-facing
  • [ y ] Set a kind label on this PR
  • [ y ] Release notes block has been filled in, or marked NONE

/kind enhancement

Release Notes

Add informers and listers for the advanced usages and simplify the generated clientset folder from pkg/client/build to pkg/client directly

@openshift-ci-robot openshift-ci-robot added kind/enhancement release-note Label for when a PR has specified a release note labels Mar 5, 2021
@SaschaSchwarze0
Copy link
Member

@zhangtbj is not "Simplify the generated clientset folder from pkg/client/build to pkg/client directly" a breaking change that needs special consideration in the release note?

@gabemontero
Copy link
Member

/approve

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gabemontero

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

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. kind/feature Categorizes issue or PR as related to a new feature. and removed kind/enhancement labels Mar 5, 2021
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 8, 2021
@zhangtbj
Copy link
Contributor Author

zhangtbj commented Mar 8, 2021

Thank you @SaschaSchwarze0 , yes, I added the package change in the release note.

@qu1queee
Copy link
Contributor

qu1queee commented Mar 8, 2021

Reviewing later today, xiexie

Copy link
Contributor

@qu1queee qu1queee left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 9, 2021
@openshift-merge-robot openshift-merge-robot merged commit 8ca4449 into shipwright-io:master Mar 9, 2021
@qu1queee qu1queee added this to the release-v0.4.0 milestone Mar 24, 2021
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Label for when a PR has specified a release note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants