Skip to content

Commit

Permalink
build: Switch to use kustomize subcommand in kubectl (argoproj#6546)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Tang <[email protected]>
  • Loading branch information
terrytangyuan committed Aug 16, 2021
1 parent f711ce4 commit 15e1db9
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 28 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ jobs:
with:
path: /home/runner/go/bin
key: go-bin-v1-${{ hashFiles('**/go.mod') }}
- uses: actions/cache@v2
with:
path: dist/kustomize
key: kustomize
- run: mkdir -p /tmp/log/argo-e2e
- name: Install and start K3S
timeout-minutes: 3
Expand Down
32 changes: 12 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,6 @@ pkg/apiclient/workflowtemplate/workflow-template.swagger.json: $(PROTO_BINARIES)
manifests/base/crds/full/argoproj.io_workflows.yaml: $(GOPATH)/bin/controller-gen $(TYPES) ./hack/crdgen.sh ./hack/crds.go
./hack/crdgen.sh

dist/kustomize:
mkdir -p dist
rm -f dist/kustomize
./hack/recurl.sh dist/install_kustomize.sh https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh
chmod +x ./dist/install_kustomize.sh
cd dist && ./install_kustomize.sh 3.8.8
dist/kustomize version

manifests: \
manifests/install.yaml \
manifests/namespace-install.yaml \
Expand All @@ -372,16 +364,16 @@ manifests: \
dist/manifests/quick-start-mysql.yaml \
dist/manifests/quick-start-postgres.yaml

manifests/install.yaml: dist/kustomize /dev/null
dist/kustomize build --load_restrictor=none manifests/cluster-install | ./hack/auto-gen-msg.sh > manifests/install.yaml
manifests/namespace-install.yaml: dist/kustomize /dev/null
dist/kustomize build --load_restrictor=none manifests/namespace-install | ./hack/auto-gen-msg.sh > manifests/namespace-install.yaml
manifests/quick-start-minimal.yaml: dist/kustomize /dev/null
dist/kustomize build --load_restrictor=none manifests/quick-start/minimal | ./hack/auto-gen-msg.sh > manifests/quick-start-minimal.yaml
manifests/quick-start-mysql.yaml: dist/kustomize /dev/null
dist/kustomize build --load_restrictor=none manifests/quick-start/mysql | ./hack/auto-gen-msg.sh > manifests/quick-start-mysql.yaml
manifests/quick-start-postgres.yaml: dist/kustomize /dev/null
dist/kustomize build --load_restrictor=none manifests/quick-start/postgres | ./hack/auto-gen-msg.sh > manifests/quick-start-postgres.yaml
manifests/install.yaml: /dev/null
kubectl kustomize --load-restrictor=LoadRestrictionsNone manifests/cluster-install | ./hack/auto-gen-msg.sh > manifests/install.yaml
manifests/namespace-install.yaml: /dev/null
kubectl kustomize --load-restrictor=LoadRestrictionsNone manifests/namespace-install | ./hack/auto-gen-msg.sh > manifests/namespace-install.yaml
manifests/quick-start-minimal.yaml: /dev/null
kubectl kustomize --load-restrictor=LoadRestrictionsNone manifests/quick-start/minimal | ./hack/auto-gen-msg.sh > manifests/quick-start-minimal.yaml
manifests/quick-start-mysql.yaml: /dev/null
kubectl kustomize --load-restrictor=LoadRestrictionsNone manifests/quick-start/mysql | ./hack/auto-gen-msg.sh > manifests/quick-start-mysql.yaml
manifests/quick-start-postgres.yaml: /dev/null
kubectl kustomize --load-restrictor=LoadRestrictionsNone manifests/quick-start/postgres | ./hack/auto-gen-msg.sh > manifests/quick-start-postgres.yaml

dist/manifests/%: manifests/%
@mkdir -p dist/manifests
Expand All @@ -407,11 +399,11 @@ test: server/static/files.go dist/argosay
env KUBECONFIG=/dev/null $(GOTEST) ./...

.PHONY: install
install: dist/kustomize
install:
kubectl get ns $(KUBE_NAMESPACE) || kubectl create ns $(KUBE_NAMESPACE)
kubectl config set-context --current --namespace=$(KUBE_NAMESPACE)
@echo "installing PROFILE=$(PROFILE), E2E_EXECUTOR=$(E2E_EXECUTOR)"
dist/kustomize build --load_restrictor=none test/e2e/manifests/$(PROFILE) | sed 's/argoproj\//$(IMAGE_NAMESPACE)\//' | sed 's/containerRuntimeExecutor: docker/containerRuntimeExecutor: $(E2E_EXECUTOR)/' | kubectl -n $(KUBE_NAMESPACE) apply --prune -l app.kubernetes.io/part-of=argo -f -
kubectl kustomize --load-restrictor=LoadRestrictionsNone test/e2e/manifests/$(PROFILE) | sed 's/argoproj\//$(IMAGE_NAMESPACE)\//' | sed 's/containerRuntimeExecutor: docker/containerRuntimeExecutor: $(E2E_EXECUTOR)/' | kubectl -n $(KUBE_NAMESPACE) apply --prune -l app.kubernetes.io/part-of=argo -f -
ifeq ($(PROFILE),stress)
kubectl -n $(KUBE_NAMESPACE) apply -f test/stress/massive-workflow.yaml
endif
Expand Down
1 change: 0 additions & 1 deletion docs/running-locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* [Go](https://golang.org/dl/) (The project currently uses version 1.15)
* [Yarn](https://classic.yarnpkg.com/en/docs/install/#mac-stable)
* [Docker](https://docs.docker.com/get-docker/)
* [Kustomize](https://kubectl.docs.kubernetes.io/installation/kustomize/)
* [protoc](https://google.github.io/proto-lens/installing-protoc.html) `brew install protobuf`
* [`jq`](https://stedolan.github.io/jq/download/)
* A local Kubernetes cluster
Expand Down
2 changes: 1 addition & 1 deletion manifests/quick-start-minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ stringData:
github.com: |
type: github
secret: "shh!"
gitlab.com: |
gitlab.com: |-
type: gitlab
secret: "shh!"
---
Expand Down
2 changes: 1 addition & 1 deletion manifests/quick-start-mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ stringData:
github.com: |
type: github
secret: "shh!"
gitlab.com: |
gitlab.com: |-
type: gitlab
secret: "shh!"
---
Expand Down
2 changes: 1 addition & 1 deletion manifests/quick-start-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ stringData:
github.com: |
type: github
secret: "shh!"
gitlab.com: |
gitlab.com: |-
type: gitlab
secret: "shh!"
---
Expand Down

0 comments on commit 15e1db9

Please sign in to comment.