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

Remove the kpack buildpod webhook #2047

Merged
merged 1 commit into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 0 additions & 35 deletions helm/kpack-image-builder/templates/manifests.yaml

This file was deleted.

1 change: 0 additions & 1 deletion kpack-image-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ RUN --mount=type=cache,target=/go/pkg/mod \
go mod download

COPY controllers/api controllers/api
COPY kpack-image-builder/api/ kpack-image-builder/api
COPY kpack-image-builder/config/config.go kpack-image-builder/config/config.go
COPY kpack-image-builder/controllers/ kpack-image-builder/controllers
COPY kpack-image-builder/main.go kpack-image-builder/main.go
Expand Down
15 changes: 1 addition & 14 deletions kpack-image-builder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,12 @@ help: ## Display this help.
##@ Development

.PHONY: manifests
webhooks-file = ../helm/kpack-image-builder/templates/manifests.yaml
manifests: install-controller-gen install-yq
manifests: install-controller-gen
$(CONTROLLER_GEN) \
paths="./..." \
webhook \
rbac:roleName=korifi-kpack-build-manager-role \
output:webhook:artifacts:config=../helm/kpack-image-builder/templates \
output:rbac:artifacts:config=../helm/kpack-image-builder/templates

$(YQ) -i 'with(.metadata; .annotations["cert-manager.io/inject-ca-from"]="{{ .Release.Namespace }}/korifi-kpack-build-serving-cert")' $(webhooks-file)
$(YQ) -i 'with(.metadata; .name="korifi-kpack-build-" + .name)' $(webhooks-file)
$(YQ) -i 'with(.webhooks[]; .clientConfig.service.namespace="{{ .Release.Namespace }}")' $(webhooks-file)
$(YQ) -i 'with(.webhooks[]; .clientConfig.service.name="korifi-kpack-build-" + .clientConfig.service.name)' $(webhooks-file)
$(YQ) -i 'with(.webhooks[]; .objectSelector.matchExpressions=[{"key":"kpack.io/build", "operator":"Exists"},{"key":"korifi.cloudfoundry.org/build-workload-name", "operator":"Exists"}])' $(webhooks-file)

.PHONY: generate
generate: install-controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
Expand All @@ -70,7 +61,3 @@ install-controller-gen:

install-ginkgo:
go install github.com/onsi/ginkgo/v2/ginkgo

YQ = $(shell pwd)/bin/yq
install-yq:
GOBIN=$(shell pwd)/bin go install github.com/mikefarah/yq/v4@latest
Empty file.
69 changes: 0 additions & 69 deletions kpack-image-builder/api/v1alpha1/build_pod_webhook.go

This file was deleted.

81 changes: 0 additions & 81 deletions kpack-image-builder/api/v1alpha1/build_pod_webhook_test.go

This file was deleted.

123 changes: 0 additions & 123 deletions kpack-image-builder/api/v1alpha1/webhook_suite_test.go

This file was deleted.

5 changes: 0 additions & 5 deletions kpack-image-builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"code.cloudfoundry.org/korifi/tools"

korifiv1alpha1 "code.cloudfoundry.org/korifi/controllers/api/v1alpha1"
"code.cloudfoundry.org/korifi/kpack-image-builder/api/v1alpha1"
"code.cloudfoundry.org/korifi/kpack-image-builder/config"
"code.cloudfoundry.org/korifi/kpack-image-builder/controllers"
"code.cloudfoundry.org/korifi/kpack-image-builder/controllers/imageprocessfetcher"
Expand Down Expand Up @@ -143,10 +142,6 @@ func main() {
os.Exit(1)
}

if err = v1alpha1.NewPodSecurityAdder().SetupWebhookWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create webhook", "webhook", "Pod")
os.Exit(1)
}
//+kubebuilder:scaffold:builder

if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
Expand Down
1 change: 0 additions & 1 deletion kpack-image-builder/remote-debug/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ RUN --mount=type=cache,target=/go/pkg/mod \
go mod download

COPY controllers/api controllers/api/
COPY kpack-image-builder/api/ kpack-image-builder/api/
COPY kpack-image-builder/config/config.go kpack-image-builder/config/config.go
COPY kpack-image-builder/controllers/ kpack-image-builder/controllers/
COPY kpack-image-builder/main.go kpack-image-builder/main.go
Expand Down