Skip to content

Commit

Permalink
chore(manifests): improve manifest generation (#105)
Browse files Browse the repository at this point in the history
* chore(manifests): apply kustomize after CRD generation

* chore(manifests): delete config/ folder

* chore(manifests): simplify manifest filenames

* chore(manifests): add ConfigMap and Secret for server & controllers

* chore(ci): add check-codegen job

* chore(manifests): regen manifests with controller-gen 0.11.2

* chore(manifests): add proper labels on configmaps and secret

* chore(manifests): pass burrito-webhook-secret as envFrom

* chore: use common cm and generic secret

---------

Co-authored-by: spoukke <sacha.bernheim@hey.com>
  • Loading branch information
corrieriluca and spoukke authored May 2, 2023
1 parent 9ddc645 commit 63acc4d
Show file tree
Hide file tree
Showing 67 changed files with 1,445 additions and 3,264 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,30 @@ jobs:
go-version: "1.19"
- name: Run tests
run: make test


check-codegen:
name: Check Codegen
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Golang
uses: actions/setup-go@v3
with:
go-version: "1.19"
- name: Generate manifests
run: make manifests
- name: Check nothing has changed
run: |
git diff --exit-code ./manifests
build-and-push:
name: Build & Push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

Expand All @@ -40,7 +56,7 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get Build timestamp and branch name
run: |
echo "BUILD_TIMESTAMP=$(date +'%s')" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
echo "BUILD_TIMESTAMP=$(date +'%s')" >> $GITHUB_ENV
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
echo "COMMIT_HASH=${{ github.sha }}" >> $GITHUB_ENV
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ help: ## Display this help.
##@ Development

.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
manifests: controller-gen kustomize ## Generate CustomResourceDefinition objects and plain manifest for installing Burrito. For generating Webhook and ClusterRole, add `rbac:roleName=manager-role crd` to the controller-gen command.
$(CONTROLLER_GEN) crd paths="./..." output:crd:dir=manifests/crds
echo "# This is an auto-generated file. DO NOT EDIT" > manifests/install.yaml
$(KUSTOMIZE) build manifests/cluster-install >> manifests/install.yaml

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand Down
24 changes: 0 additions & 24 deletions config/crd/kustomization.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions config/crd/kustomizeconfig.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions config/crd/patches/cainjection_in_terraformlayers.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions config/crd/patches/cainjection_in_terraformrepositories.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions config/crd/patches/webhook_in_terraformlayers.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions config/crd/patches/webhook_in_terraformrepositories.yaml

This file was deleted.

72 changes: 0 additions & 72 deletions config/default/kustomization.yaml

This file was deleted.

55 changes: 0 additions & 55 deletions config/default/manager_auth_proxy_patch.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions config/default/manager_config_patch.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions config/manager/kustomization.yaml

This file was deleted.

Loading

0 comments on commit 63acc4d

Please sign in to comment.