Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore: update project structure #86

Merged
merged 8 commits into from
Jun 27, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@
/deploy/
/Dockerfile
/e2e/

/charts/
/examples/
/scripts/
/hack/
/test/
6 changes: 3 additions & 3 deletions .github/workflows/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ jobs:
run: echo "value=${{ steps.oci-registry-name.outputs.value }}/${{ steps.chart-name.outputs.value }}" >> "$GITHUB_OUTPUT"

- name: Helm lint
run: helm lint charts/${{ steps.chart-name.outputs.value }}
run: helm lint deploy/charts/${{ steps.chart-name.outputs.value }}

- name: Determine raw version
uses: haya14busa/action-cond@1d6e8a12b20cdb4f1954feef9aa475b9c390cab5 # v1.1.1
Expand All @@ -218,7 +218,7 @@ jobs:
- name: Helm package
id: build
run: |
helm package charts/${{ steps.chart-name.outputs.value }} --version ${{ steps.version.outputs.value }} --app-version ${{ steps.raw-version.outputs.value }}
helm package deploy/charts/${{ steps.chart-name.outputs.value }} --version ${{ steps.version.outputs.value }} --app-version ${{ steps.raw-version.outputs.value }}
echo "package=${{ steps.chart-name.outputs.value }}-${{ steps.version.outputs.value }}.tgz" >> "$GITHUB_OUTPUT"

- name: Upload chart as artifact
Expand Down Expand Up @@ -251,7 +251,7 @@ jobs:
uses: aquasecurity/trivy-action@41f05d9ecffa2ed3f1580af306000f734b733e54 # 0.11.2
with:
scan-type: config
scan-ref: charts/${{ steps.chart-name.outputs.value }}
scan-ref: deploy/charts/${{ steps.chart-name.outputs.value }}
format: sarif
output: trivy-results.sarif

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ jobs:
name: "[container-image] Docker tarball"

- name: Build the Helm charts
run: nix develop --impure .#ci -c helm dep build ./charts/vault-operator
run: nix develop --impure .#ci -c helm dep build ./deploy/charts/vault-operator

- name: Operator Multi-DC Raft test
run: nix develop --impure .#ci -c ./deploy/multi-dc/test/multi-dc-raft.sh install
run: nix develop --impure .#ci -c ./deploy/dev/multi-dc/test/multi-dc-raft.sh install
env:
OPERATOR_VERSION: ${{ needs.artifacts.outputs.container-image-tag }}
3 changes: 0 additions & 3 deletions .yamlignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/deploy/
/e2e/deploy/
/e2e/test/

/charts/
/examples/
/test/
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ build: ## Build binary

.PHONY: run
run: ## Run the operator locally talking to a Kubernetes cluster
kubectl replace -f deploy/crd.yaml || kubectl create -f deploy/crd.yaml
kubectl apply -f deploy/rbac.yaml
kubectl replace -f deploy/default/crd.yaml || kubectl create -f deploy/default/crd.yaml
kubectl apply -f deploy/default/rbac.yaml
OPERATOR_NAME=vault-dev go run cmd/manager/main.go -verbose

.PHONY: clean
clean: ## Clean operator resources from a Kubernetes cluster
kubectl delete -f deploy/crd.yaml
kubectl delete -f deploy/rbac.yaml
kubectl delete -f deploy/default/crd.yaml
kubectl delete -f deploy/default/rbac.yaml

.PHONY: artifacts
artifacts: container-image helm-chart
Expand All @@ -53,7 +53,7 @@ container-image: ## Build container image
.PHONY: helm-chart
helm-chart: ## Build Helm chart
@mkdir -p build
helm package -d build/ charts/vault-operator
helm package -d build/ deploy/charts/vault-operator

.PHONY: check
check: test lint ## Run checks (tests and linters)
Expand All @@ -76,7 +76,7 @@ lint-go:

.PHONY: lint-helm
lint-helm:
helm lint charts/vault-operator
helm lint deploy/charts/vault-operator

.PHONY: lint-docker
lint-docker:
Expand All @@ -101,18 +101,18 @@ generate: ## Run generation jobs

.PHONY: generate-code
generate-code: ## Regenerate clientset, deepcopy funcs, listers and informers
./scripts/update-codegen.sh v${CODE_GENERATOR_VERSION}
./hack/scripts/update-codegen.sh v${CODE_GENERATOR_VERSION}

.PHONY: generate-crds
generate-crds: ## Regenerate CRDs in the Helm chart and examples
controller-gen crd:maxDescLen=0 paths=./pkg/... output:crd:artifacts:config=./deploy/
cp deploy/vault.banzaicloud.com_vaults.yaml charts/vault-operator/crds/crd.yaml
cp deploy/vault.banzaicloud.com_vaults.yaml deploy/crd.yaml
rm deploy/vault.banzaicloud.com_vaults.yaml
controller-gen crd:maxDescLen=0 paths=./pkg/... output:crd:artifacts:config=./deploy/default
cp deploy/default/vault.banzaicloud.com_vaults.yaml deploy/charts/vault-operator/crds/crd.yaml
cp deploy/default/vault.banzaicloud.com_vaults.yaml deploy/default/crd.yaml
rm deploy/default/vault.banzaicloud.com_vaults.yaml

.PHONY: generate-helm-docs
generate-helm-docs:
helm-docs -s file -c charts/ -t README.md.gotmpl
helm-docs -s file -c deploy/charts/ -t README.md.gotmpl

deps: bin/golangci-lint bin/licensei bin/kind bin/kurun bin/controller-gen bin/helm-docs
deps: ## Install dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1958,6 +1958,19 @@ spec:
format: int32
type: integer
type: object
resizePolicy:
items:
properties:
resourceName:
type: string
restartPolicy:
type: string
required:
- resourceName
- restartPolicy
type: object
type: array
x-kubernetes-list-type: atomic
resources:
properties:
claims:
Expand Down Expand Up @@ -2587,6 +2600,19 @@ spec:
format: int32
type: integer
type: object
resizePolicy:
items:
properties:
resourceName:
type: string
restartPolicy:
type: string
required:
- resourceName
- restartPolicy
type: object
type: array
x-kubernetes-list-type: atomic
resources:
properties:
claims:
Expand Down Expand Up @@ -3223,6 +3249,19 @@ spec:
format: int32
type: integer
type: object
resizePolicy:
items:
properties:
resourceName:
type: string
restartPolicy:
type: string
required:
- resourceName
- restartPolicy
type: object
type: array
x-kubernetes-list-type: atomic
resources:
properties:
claims:
Expand Down Expand Up @@ -4763,6 +4802,19 @@ spec:
format: int32
type: integer
type: object
resizePolicy:
items:
properties:
resourceName:
type: string
restartPolicy:
type: string
required:
- resourceName
- restartPolicy
type: object
type: array
x-kubernetes-list-type: atomic
resources:
properties:
claims:
Expand Down Expand Up @@ -5367,6 +5419,19 @@ spec:
format: int32
type: integer
type: object
resizePolicy:
items:
properties:
resourceName:
type: string
restartPolicy:
type: string
required:
- resourceName
- restartPolicy
type: object
type: array
x-kubernetes-list-type: atomic
resources:
properties:
claims:
Expand Down Expand Up @@ -6036,6 +6101,19 @@ spec:
format: int32
type: integer
type: object
resizePolicy:
items:
properties:
resourceName:
type: string
restartPolicy:
type: string
required:
- resourceName
- restartPolicy
type: object
type: array
x-kubernetes-list-type: atomic
resources:
properties:
claims:
Expand Down Expand Up @@ -7017,6 +7095,19 @@ spec:
format: int32
type: integer
type: object
resizePolicy:
items:
properties:
resourceName:
type: string
restartPolicy:
type: string
required:
- resourceName
- restartPolicy
type: object
type: array
x-kubernetes-list-type: atomic
resources:
properties:
claims:
Expand Down Expand Up @@ -7646,6 +7737,19 @@ spec:
format: int32
type: integer
type: object
resizePolicy:
items:
properties:
resourceName:
type: string
restartPolicy:
type: string
required:
- resourceName
- restartPolicy
type: object
type: array
x-kubernetes-list-type: atomic
resources:
properties:
claims:
Expand Down Expand Up @@ -8282,6 +8386,19 @@ spec:
format: int32
type: integer
type: object
resizePolicy:
items:
properties:
resourceName:
type: string
restartPolicy:
type: string
required:
- resourceName
- restartPolicy
type: object
type: array
x-kubernetes-list-type: atomic
resources:
properties:
claims:
Expand Down
Loading