diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 617272ae8..c554bc3e7 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -7,23 +7,16 @@ set -o errexit set -o nounset set -o pipefail -export GO111MODULE=on +source $(dirname $0)/../vendor/knative.dev/hack/codegen-library.sh + # If we run with -mod=vendor here, then generate-groups.sh looks for vendor files in the wrong place. export GOFLAGS=-mod= -if [ -z "${GOPATH:-}" ]; then - export GOPATH=$(go env GOPATH) -fi - -source $(dirname $0)/../vendor/knative.dev/hack/library.sh - -REPO_ROOT=$(dirname ${BASH_SOURCE})/.. -CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${REPO_ROOT}; ls -d -1 $(dirname $0)/../vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)} +echo "=== Update Codegen for $MODULE_NAME" -KNATIVE_CODEGEN_PKG=${KNATIVE_CODEGEN_PKG:-$(cd ${REPO_ROOT}; ls -d -1 $(dirname $0)/../vendor/knative.dev/pkg 2>/dev/null || echo ../pkg)} +echo "GOPATH=$GOPATH" -chmod +x ${CODEGEN_PKG}/generate-groups.sh -chmod +x ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh +group "Kubernetes Codegen" # generate the code with: # --output-base because this script should also be able to run inside the vendor dir of @@ -32,13 +25,17 @@ chmod +x ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh ${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \ github.com/vmware-tanzu/sources-for-knative/pkg/client github.com/vmware-tanzu/sources-for-knative/pkg/apis \ "sources:v1alpha1" \ - --go-header-file ${REPO_ROOT}/hack/boilerplate/boilerplate.go.txt + --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt + +group "Knative Codegen" # Knative Injection ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh "injection" \ github.com/vmware-tanzu/sources-for-knative/pkg/client github.com/vmware-tanzu/sources-for-knative/pkg/apis \ "sources:v1alpha1" \ - --go-header-file ${REPO_ROOT}/hack/boilerplate/boilerplate.go.txt + --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt + +group "Update deps post-codegen" # Make sure our dependencies are up-to-date -${REPO_ROOT}/hack/update-deps.sh +${REPO_ROOT_DIR}/hack/update-deps.sh diff --git a/pkg/client/injection/reconciler/sources/v1alpha1/vspheresource/controller.go b/pkg/client/injection/reconciler/sources/v1alpha1/vspheresource/controller.go index 0082a0196..553e60b7e 100644 --- a/pkg/client/injection/reconciler/sources/v1alpha1/vspheresource/controller.go +++ b/pkg/client/injection/reconciler/sources/v1alpha1/vspheresource/controller.go @@ -102,9 +102,6 @@ func NewImpl(ctx context.Context, r Interface, optionsFns ...controller.OptionsF if opts.SkipStatusUpdates { rec.skipStatusUpdates = true } - if opts.DemoteFunc != nil { - rec.DemoteFunc = opts.DemoteFunc - } } rec.Recorder = createRecorder(ctx, agentName) diff --git a/pkg/client/injection/reconciler/sources/v1alpha1/vspheresource/reconciler.go b/pkg/client/injection/reconciler/sources/v1alpha1/vspheresource/reconciler.go index 3d8b056af..7e5f13175 100644 --- a/pkg/client/injection/reconciler/sources/v1alpha1/vspheresource/reconciler.go +++ b/pkg/client/injection/reconciler/sources/v1alpha1/vspheresource/reconciler.go @@ -158,9 +158,6 @@ func NewReconciler(ctx context.Context, logger *zap.SugaredLogger, client versio if opts.SkipStatusUpdates { rec.skipStatusUpdates = true } - if opts.DemoteFunc != nil { - rec.DemoteFunc = opts.DemoteFunc - } } return rec