From 1d13cfad59e9b92358d756e92a4d4f9b85d6d93a Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Fri, 10 Jan 2020 10:23:17 +0100 Subject: [PATCH] =?UTF-8?q?Explain=20why=20resource=20code=20generation=20?= =?UTF-8?q?is=20separate=20=F0=9F=A5=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `resource` package exists to not have dependency cycle between the different version of the `pipeline` api package. This follows up the previous change with some comments on why we need to have additional generation commands. Signed-off-by: Vincent Demeester --- hack/update-codegen.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 06428711897..167151dbb6e 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -26,10 +26,15 @@ GOFLAGS="-mod=vendor" # --output-base because this script should also be able to run inside the vendor dir of # k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir # instead of the $GOPATH directly. For normal projects this can be dropped. +# This generates deepcopy,client,informer and lister for the resource package (v1alpha1) +# This is separate from the pipeline package as resource are staying in v1alpha1 and they +# need to be separated (at least in terms of go package) from the pipeline's packages to +# not having dependency cycle. bash ${REPO_ROOT_DIR}/hack/generate-groups.sh "deepcopy,client,informer,lister" \ github.com/tektoncd/pipeline/pkg/client/resource github.com/tektoncd/pipeline/pkg/apis \ "resource:v1alpha1" \ --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt +# This generates deepcopy,client,informer and lister for the pipeline package (v1alpha1 and v1alpha2) bash ${REPO_ROOT_DIR}/hack/generate-groups.sh "deepcopy,client,informer,lister" \ github.com/tektoncd/pipeline/pkg/client github.com/tektoncd/pipeline/pkg/apis \ "pipeline:v1alpha1,v1alpha2" \ @@ -42,10 +47,13 @@ ${GOPATH}/bin/deepcopy-gen \ -i github.com/tektoncd/pipeline/pkg/apis/config # Knative Injection +# This generates the knative injection packages for the resource package (v1alpha1). +# This is separate from the pipeline package for the same reason as client and all (see above). bash ${REPO_ROOT_DIR}/hack/generate-knative.sh "injection" \ github.com/tektoncd/pipeline/pkg/client/resource github.com/tektoncd/pipeline/pkg/apis \ "resource:v1alpha1" \ --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt +# This generates the knative inject packages for the pipeline package (v1alpha1, v1alpha2). bash ${REPO_ROOT_DIR}/hack/generate-knative.sh "injection" \ github.com/tektoncd/pipeline/pkg/client github.com/tektoncd/pipeline/pkg/apis \ "pipeline:v1alpha1,v1alpha2" \