Skip to content

Commit

Permalink
helm: generate chart from k8s manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
giautm committed Aug 22, 2023
1 parent aaeb29c commit d36ad53
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,12 @@ $(LOCALBIN):
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
HELMIFY ?= $(LOCALBIN)/helmify

## Tool Versions
KUSTOMIZE_VERSION ?= v5.1.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
HELMIFY_VERSION ?= v0.4.5

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand Down Expand Up @@ -268,5 +270,15 @@ license: ## Add license headers to all files.
@echo "Adding license headers to all files..."
go run -mod=mod github.com/google/addlicense@latest -ignore "**/*.sql" -ignore "charts/**/*" -l apache -c "The Atlas Operator Authors." .

.PHONY: helmify
helmify: $(HELMIFY) ## Download helmify locally if necessary. If wrong version is installed, it will be overwritten.
$(HELMIFY): $(LOCALBIN)
test -s $(LOCALBIN)/helmify && $(LOCALBIN)/helmify --version | grep -q $(HELMIFY_VERSION) || \
GOBIN=$(LOCALBIN) go install -ldflags "-X main.version=$(HELMIFY_VERSION)" github.com/arttor/helmify/cmd/helmify@$(HELMIFY_VERSION)

.PHONY: helm
helm: manifests kustomize license helmify
$(KUSTOMIZE) build config/helm | $(HELMIFY) -crd-dir charts/atlas-operator

.PHONY: cli-gen
cli-gen: generate manifests chart-manifests license
cli-gen: generate manifests helm license
21 changes: 21 additions & 0 deletions config/helm/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2023 The Atlas Operator Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../default
images:
- name: controller
newName: arigaio/atlas-operator

0 comments on commit d36ad53

Please sign in to comment.