1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

refactor: rename initContainer to kyverni-init (#6139)

* refactor: rename initContainer to init-container

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* kyverno-init

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2023-01-29 21:49:45 +01:00 committed by GitHub
parent 45554e7f2a
commit 4539c60baf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 34 additions and 34 deletions

View file

@ -53,7 +53,7 @@ jobs:
- name: Publish kyvernopre
uses: ./.github/actions/publish-image
with:
makefile-target: ko-publish-kyvernopre-dev
makefile-target: ko-publish-kyverno-init-dev
registry: ghcr.io
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.CR_PAT }}
@ -62,7 +62,7 @@ jobs:
sbom-name: kyvernopre
sbom-repository: ghcr.io/${{ github.repository_owner }}/sbom
signature-repository: ghcr.io/${{ github.repository_owner }}/signatures
main-path: ./cmd/initContainer
main-path: ./cmd/kyverno-init
- name: Publish cleanup-controller
uses: ./.github/actions/publish-image
with:

View file

@ -47,7 +47,7 @@ jobs:
- name: Publish kyvernopre
uses: ./.github/actions/publish-image
with:
makefile-target: ko-publish-kyvernopre
makefile-target: ko-publish-kyverno-init
registry: ghcr.io
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.CR_PAT }}
@ -56,7 +56,7 @@ jobs:
sbom-name: kyvernopre
sbom-repository: ghcr.io/${{ github.repository_owner }}/sbom
signature-repository: ghcr.io/${{ github.repository_owner }}/signatures
main-path: ./cmd/initContainer
main-path: ./cmd/kyverno-init
- name: Publish cleanup-controller
uses: ./.github/actions/publish-image
with:

2
.gitignore vendored
View file

@ -5,8 +5,8 @@ _output
coverage.txt
.idea
cmd/cli/kubectl-kyverno/kubectl-kyverno
cmd/initContainer/kyvernopre
cmd/kyverno/kyverno
cmd/kyverno-init/kyvernopre
cmd/cleanup-controller/cleanup-controller
cmd/reports-controller/reports-controller
/release

View file

@ -1,11 +1,11 @@
builds:
- id: initContainer
main: ./cmd/initContainer
- id: kyverno
main: ./cmd/kyverno
ldflags:
- '{{ if index .Env "LD_FLAGS" }}{{ .Env.LD_FLAGS }}{{ end }}'
- id: kyverno
main: ./cmd/kyverno
- id: kyverno-init
main: ./cmd/kyverno-init
ldflags:
- '{{ if index .Env "LD_FLAGS" }}{{ .Env.LD_FLAGS }}{{ end }}'

View file

@ -64,10 +64,10 @@ The Kyverno repository contains code for three different binaries:
To build `kyvernopre` binary on your local system, run:
```console
make build-kyvernopre
make build-kyverno-init
```
The binary should be created at `./cmd/initContainer/kyvernopre`.
The binary should be created at `./cmd/kyverno-init/kyvernopre`.
### Building kyverno locally
@ -112,7 +112,7 @@ When building local images with ko you can't specify the registry used to create
To build `kyvernopre` image on your local system, run:
```console
make ko-build-kyvernopre
make ko-build-kyverno-init
```
The resulting image should be available locally, named `ko.local/github.com/kyverno/kyverno/cmd/initcontainer`.
@ -163,12 +163,12 @@ To allow authentication you will need to set `REGISTRY_USERNAME` and `REGISTRY_P
To push `kyvernopre` image on a remote registry, run:
```console
# push stable image
make ko-publish-kyvernopre
make ko-publish-kyverno-init
```
or
```console
# push dev image
make ko-publish-kyvernopre-dev
make ko-publish-kyverno-init-dev
```
The resulting image should be available remotely, named `ghcr.io/kyverno/kyvernopre` (by default, if `REGISTRY` environment variable was not set).
@ -230,7 +230,7 @@ You can also override the KinD cluster name by setting the `KIND_NAME` environme
To build local images and load them on a local KinD cluster, run:
```console
# build kyvernopre image and load it in KinD cluster
make kind-load-kyvernopre
make kind-load-kyverno-init
```
or
```console

View file

@ -135,7 +135,7 @@ clean-tools: ## Remove installed tools
CMD_DIR := ./cmd
KYVERNO_DIR := $(CMD_DIR)/kyverno
KYVERNOPRE_DIR := $(CMD_DIR)/initContainer
KYVERNOPRE_DIR := $(CMD_DIR)/kyverno-init
CLI_DIR := $(CMD_DIR)/cli/kubectl-kyverno
CLEANUP_DIR := $(CMD_DIR)/cleanup-controller
REPORTS_DIR := $(CMD_DIR)/reports-controller
@ -207,8 +207,8 @@ $(REPORTS_BIN): fmt vet
@echo Build reports controller binary... >&2
@CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) go build -o $(REPORTS_BIN) -ldflags=$(LD_FLAGS) $(REPORTS_DIR)
.PHONY: build-kyvernopre
build-kyvernopre: $(KYVERNOPRE_BIN) ## Build kyvernopre binary
.PHONY: build-kyverno-init
build-kyverno-init: $(KYVERNOPRE_BIN) ## Build kyvernopre binary
.PHONY: build-kyverno
build-kyverno: $(KYVERNO_BIN) ## Build kyverno binary
@ -222,7 +222,7 @@ build-cleanup-controller: $(CLEANUP_BIN) ## Build cleanup controller binary
.PHONY: build-reports-controller
build-reports-controller: $(REPORTS_BIN) ## Build reports controller binary
build-all: build-kyvernopre build-kyverno build-cli build-cleanup-controller build-reports-controller ## Build all binaries
build-all: build-kyverno-init build-kyverno build-cli build-cleanup-controller build-reports-controller ## Build all binaries
##############
# BUILD (KO) #
@ -233,8 +233,8 @@ LOCAL_PLATFORM := linux/$(GOARCH)
KO_TAGS := latest,$(IMAGE_TAG)
KO_TAGS_DEV := latest,$(IMAGE_TAG_DEV)
.PHONY: ko-build-kyvernopre
ko-build-kyvernopre: $(KO) ## Build kyvernopre local image (with ko)
.PHONY: ko-build-kyverno-init
ko-build-kyverno-init: $(KO) ## Build kyvernopre local image (with ko)
@echo Build kyvernopre local image with ko... >&2
@LD_FLAGS=$(LD_FLAGS_DEV) KOCACHE=$(KOCACHE) KO_DOCKER_REPO=ko.local $(KO) build $(KYVERNOPRE_DIR) --preserve-import-paths --tags=$(KO_TAGS_DEV) --platform=$(LOCAL_PLATFORM)
@ -259,14 +259,14 @@ ko-build-reports-controller: $(KO) ## Build reports controller local image (with
@LD_FLAGS=$(LD_FLAGS_DEV) KOCACHE=$(KOCACHE) KO_DOCKER_REPO=ko.local $(KO) build $(REPORTS_DIR) --preserve-import-paths --tags=$(KO_TAGS_DEV) --platform=$(LOCAL_PLATFORM)
.PHONY: ko-build-all
ko-build-all: ko-build-kyvernopre ko-build-kyverno ko-build-cli ko-build-cleanup-controller ko-build-reports-controller ## Build all local images (with ko)
ko-build-all: ko-build-kyverno-init ko-build-kyverno ko-build-cli ko-build-cleanup-controller ko-build-reports-controller ## Build all local images (with ko)
################
# PUBLISH (KO) #
################
REGISTRY_USERNAME ?= dummy
KO_KYVERNOPRE_IMAGE := ko.local/github.com/kyverno/kyverno/cmd/initcontainer
KO_KYVERNOPRE_IMAGE := ko.local/github.com/kyverno/kyverno/cmd/kyverno-init
KO_KYVERNO_IMAGE := ko.local/github.com/kyverno/kyverno/cmd/kyverno
KO_CLEANUP_IMAGE := ko.local/github.com/kyverno/kyverno/cmd/cleanup-controller
KO_REPORTS_IMAGE := ko.local/github.com/kyverno/kyverno/cmd/reports-controller
@ -275,8 +275,8 @@ KO_REPORTS_IMAGE := ko.local/github.com/kyverno/kyverno/cmd/reports-controlle
ko-login: $(KO)
@$(KO) login $(REGISTRY) --username $(REGISTRY_USERNAME) --password $(REGISTRY_PASSWORD)
.PHONY: ko-publish-kyvernopre
ko-publish-kyvernopre: ko-login ## Build and publish kyvernopre image (with ko)
.PHONY: ko-publish-kyverno-init
ko-publish-kyverno-init: ko-login ## Build and publish kyvernopre image (with ko)
@LD_FLAGS=$(LD_FLAGS) KOCACHE=$(KOCACHE) KO_DOCKER_REPO=$(REPO_KYVERNOPRE) $(KO) build $(KYVERNOPRE_DIR) --bare --tags=$(KO_TAGS) --platform=$(PLATFORMS)
.PHONY: ko-publish-kyverno
@ -295,8 +295,8 @@ ko-publish-cleanup-controller: ko-login ## Build and publish cleanup controller
ko-publish-reports-controller: ko-login ## Build and publish reports controller image (with ko)
@LD_FLAGS=$(LD_FLAGS) KOCACHE=$(KOCACHE) KO_DOCKER_REPO=$(REPO_REPORTS) $(KO) build $(REPORTS_DIR) --bare --tags=$(KO_TAGS) --platform=$(PLATFORMS)
.PHONY: ko-publish-kyvernopre-dev
ko-publish-kyvernopre-dev: ko-login ## Build and publish kyvernopre dev image (with ko)
.PHONY: ko-publish-kyverno-init-dev
ko-publish-kyverno-init-dev: ko-login ## Build and publish kyvernopre dev image (with ko)
@LD_FLAGS=$(LD_FLAGS_DEV) KOCACHE=$(KOCACHE) KO_DOCKER_REPO=$(REPO_KYVERNOPRE) $(KO) build $(KYVERNOPRE_DIR) --bare --tags=$(KO_TAGS_DEV) --platform=$(PLATFORMS)
.PHONY: ko-publish-kyverno-dev
@ -316,10 +316,10 @@ ko-publish-reports-controller-dev: ko-login ## Build and publish reports control
@LD_FLAGS=$(LD_FLAGS_DEV) KOCACHE=$(KOCACHE) KO_DOCKER_REPO=$(REPO_REPORTS) $(KO) build $(REPORTS_DIR) --bare --tags=$(KO_TAGS_DEV) --platform=$(PLATFORMS)
.PHONY: ko-publish-all
ko-publish-all: ko-publish-kyvernopre ko-publish-kyverno ko-publish-cli ko-publish-cleanup-controller ko-publish-reports-controller ## Build and publish all images (with ko)
ko-publish-all: ko-publish-kyverno-init ko-publish-kyverno ko-publish-cli ko-publish-cleanup-controller ko-publish-reports-controller ## Build and publish all images (with ko)
.PHONY: ko-publish-all-dev
ko-publish-all-dev: ko-publish-kyvernopre-dev ko-publish-kyverno-dev ko-publish-cli-dev ko-publish-cleanup-controller-dev ko-publish-reports-controller-dev ## Build and publish all dev images (with ko)
ko-publish-all-dev: ko-publish-kyverno-init-dev ko-publish-kyverno-dev ko-publish-cli-dev ko-publish-cleanup-controller-dev ko-publish-reports-controller-dev ## Build and publish all dev images (with ko)
#################
# BUILD (IMAGE) #
@ -330,8 +330,8 @@ LOCAL_KYVERNO_IMAGE := $($(shell echo $(BUILD_WITH) | tr '[:lower:]' '[:upper
LOCAL_CLEANUP_IMAGE := $($(shell echo $(BUILD_WITH) | tr '[:lower:]' '[:upper:]')_CLEANUP_IMAGE)
LOCAL_REPORTS_IMAGE := $($(shell echo $(BUILD_WITH) | tr '[:lower:]' '[:upper:]')_REPORTS_IMAGE)
.PHONY: image-build-kyvernopre
image-build-kyvernopre: $(BUILD_WITH)-build-kyvernopre
.PHONY: image-build-kyverno-init
image-build-kyverno-init: $(BUILD_WITH)-build-kyverno-init
.PHONY: image-build-kyverno
image-build-kyverno: $(BUILD_WITH)-build-kyverno
@ -710,8 +710,8 @@ kind-delete-cluster: $(KIND) ## Delete kind cluster
@echo Delete kind cluster... >&2
@$(KIND) delete cluster --name $(KIND_NAME)
.PHONY: kind-load-kyvernopre
kind-load-kyvernopre: $(KIND) image-build-kyvernopre ## Build kyvernopre image and load it in kind cluster
.PHONY: kind-load-kyverno-init
kind-load-kyverno-init: $(KIND) image-build-kyverno-init ## Build kyvernopre image and load it in kind cluster
@echo Load kyvernopre image... >&2
@$(KIND) load docker-image --name $(KIND_NAME) $(LOCAL_KYVERNOPRE_IMAGE):$(IMAGE_TAG_DEV)
@ -731,7 +731,7 @@ kind-load-reports-controller: $(KIND) image-build-reports-controller ## Build re
@$(KIND) load docker-image --name $(KIND_NAME) $(LOCAL_REPORTS_IMAGE):$(IMAGE_TAG_DEV)
.PHONY: kind-load-all
kind-load-all: kind-load-kyvernopre kind-load-kyverno kind-load-cleanup-controller kind-load-reports-controller ## Build images and load them in kind cluster
kind-load-all: kind-load-kyverno-init kind-load-kyverno kind-load-cleanup-controller kind-load-reports-controller ## Build images and load them in kind cluster
.PHONY: kind-deploy-kyverno
kind-deploy-kyverno: $(HELM) kind-load-all ## Build images, load them in kind cluster and deploy kyverno helm chart