|
48 | 48 | install:
|
49 | 49 | cd $(ROOT_DIR) && $(GO_INSTALL)
|
50 | 50 |
|
51 |
| -test: |
| 51 | +export KUBEBUILDER_ASSETS=$(ROOT_DIR)/_bin/tools |
| 52 | +test: _bin/tools/etcd _bin/tools/kube-apiserver |
52 | 53 | cd $(ROOT_DIR) && go test ./...
|
53 | 54 |
|
54 | 55 | vet:
|
@@ -142,3 +143,70 @@ ci-build: ci-test build build-docker-image build-all-platforms bundle-all-platfo
|
142 | 143 |
|
143 | 144 | ci-publish: ci-build push-docker-image
|
144 | 145 | echo "ci-publish is going to be disabled. We are adopting Github actions"
|
| 146 | + |
| 147 | +helm_chart_source_dir := deploy/charts/venafi-kubernetes-agent |
| 148 | +BINDIR := $(ROOT_DIR)/_bin |
| 149 | + |
| 150 | +.PHONY: generate-manifests |
| 151 | +generate-manifests: ## Generates jetstack.io_venaficonnections.yaml. |
| 152 | +generate-manifests: | $(NEEDS_GO) _bin/tools/yq |
| 153 | + @echo "# DO NOT EDIT. Use 'make generate-manifests' to regenerate." >$(helm_chart_source_dir)/crd_bases/jetstack.io_venaficonnections.yaml |
| 154 | + go run ./make/connection_crd >>$(helm_chart_source_dir)/crd_bases/jetstack.io_venaficonnections.yaml |
| 155 | + |
| 156 | + @echo "# DO NOT EDIT. Use 'make generate-manifests' to regenerate." >$(helm_chart_source_dir)/templates/venafi-connection-crd.without-validations.yaml |
| 157 | + _bin/tools/yq 'del(.. | ."x-kubernetes-validations"?) | del(.metadata.creationTimestamp)' $(helm_chart_source_dir)/crd_bases/jetstack.io_venaficonnections.yaml >>$(helm_chart_source_dir)/templates/venafi-connection-crd.without-validations.yaml |
| 158 | + |
| 159 | + @echo "# DO NOT EDIT. Use 'make generate-manifests' to regenerate." >$(helm_chart_source_dir)/templates/venafi-connection-crd.yaml |
| 160 | + _bin/tools/yq 'del(.metadata.creationTimestamp)' $(helm_chart_source_dir)/crd_bases/jetstack.io_venaficonnections.yaml >> $(helm_chart_source_dir)/templates/venafi-connection-crd.yaml |
| 161 | + |
| 162 | +# NOTE(mael): The download targets for yq, etcd, and kube-apiserver are a lesser |
| 163 | +# and suboptimal version of what's in venafi-enhanced-issuer. We will migrate to |
| 164 | +# makefile-modules and klone soon, so I didn't want to work too hard on this. |
| 165 | + |
| 166 | +YQ_linux_amd64_SHA256SUM=bd695a6513f1196aeda17b174a15e9c351843fb1cef5f9be0af170f2dd744f08 |
| 167 | +YQ_darwin_amd64_SHA256SUM=b2ff70e295d02695b284755b2a41bd889cfb37454e1fa71abc3a6ec13b2676cf |
| 168 | +YQ_darwin_arm64_SHA256SUM=e9fc15db977875de982e0174ba5dc2cf5ae4a644e18432a4262c96d4439b1686 |
| 169 | +YQ_VERSION=v4.35.1 |
| 170 | + |
| 171 | +_bin/downloaded/tools/yq@$(YQ_VERSION)_%: |
| 172 | + mkdir -p _bin/downloaded/tools |
| 173 | + curl -L https://github.com/mikefarah/yq/releases/download/$(YQ_VERSION)/yq_$* -o $@ |
| 174 | + ./make/util/checkhash.sh $@ $(YQ_$*_SHA256SUM) |
| 175 | + chmod +x $@ |
| 176 | + |
| 177 | +HOST_OS=$(shell uname | tr '[:upper:]' '[:lower:]') |
| 178 | +HOST_ARCH=$(shell uname -m | sed 's/x86_64/amd64/') |
| 179 | + |
| 180 | +_bin/tools/yq: _bin/downloaded/tools/yq@$(YQ_VERSION)_$(HOST_OS)_$(HOST_ARCH) |
| 181 | + @mkdir -p _bin/tools |
| 182 | + @cd $(dir $@) && ln -sf $(patsubst _bin/%,../%,$<) $(notdir $@) |
| 183 | + |
| 184 | +KUBEBUILDER_TOOLS_linux_amd64_SHA256SUM=f9699df7b021f71a1ab55329b36b48a798e6ae3a44d2132255fc7e46c6790d4d |
| 185 | +KUBEBUILDER_TOOLS_darwin_amd64_SHA256SUM=e1913674bacaa70c067e15649237e1f67d891ba53f367c0a50786b4a274ee047 |
| 186 | +KUBEBUILDER_TOOLS_darwin_arm64_SHA256SUM=0422632a2bbb0d4d14d7d8b0f05497a4d041c11d770a07b7a55c44bcc5e8ce66 |
| 187 | +KUBEBUILDER_ASSETS_VERSION=1.27.1 |
| 188 | + |
| 189 | +_bin/downloaded/tools/etcd@$(KUBEBUILDER_ASSETS_VERSION)_%: _bin/downloaded/tools/kubebuilder_tools_$(KUBEBUILDER_ASSETS_VERSION)_%.tar.gz | _bin/downloaded/tools |
| 190 | + ./make/util/checkhash.sh $< $(KUBEBUILDER_TOOLS_$*_SHA256SUM) |
| 191 | + @# O writes the specified file to stdout |
| 192 | + tar xfO $< kubebuilder/bin/etcd > $@ && chmod 775 $@ |
| 193 | + |
| 194 | +_bin/downloaded/tools/kube-apiserver@$(KUBEBUILDER_ASSETS_VERSION)_%: _bin/downloaded/tools/kubebuilder_tools_$(KUBEBUILDER_ASSETS_VERSION)_%.tar.gz | _bin/downloaded/tools |
| 195 | + ./make/util/checkhash.sh $< $(KUBEBUILDER_TOOLS_$*_SHA256SUM) |
| 196 | + @# O writes the specified file to stdout |
| 197 | + tar xfO $< kubebuilder/bin/kube-apiserver > $@ && chmod 775 $@ |
| 198 | + |
| 199 | +_bin/downloaded/tools/kubebuilder_tools_$(KUBEBUILDER_ASSETS_VERSION)_$(HOST_OS)_$(HOST_ARCH).tar.gz: | _bin/downloaded/tools |
| 200 | + curl -L https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-$(KUBEBUILDER_ASSETS_VERSION)-$(HOST_OS)-$(HOST_ARCH).tar.gz -o $@ |
| 201 | + |
| 202 | +_bin/downloaded/tools: |
| 203 | + @mkdir -p $@ |
| 204 | + |
| 205 | +_bin/tools/etcd: _bin/downloaded/tools/etcd@$(KUBEBUILDER_ASSETS_VERSION)_$(HOST_OS)_$(HOST_ARCH) |
| 206 | + @mkdir -p _bin/tools |
| 207 | + @cd $(dir $@) && ln -sf $(patsubst _bin/%,../%,$<) $(notdir $@) |
| 208 | + |
| 209 | +_bin/tools/kube-apiserver: _bin/downloaded/tools/kube-apiserver@$(KUBEBUILDER_ASSETS_VERSION)_$(HOST_OS)_$(HOST_ARCH) |
| 210 | + @mkdir -p _bin/tools |
| 211 | + @cd $(dir $@) && ln -sf $(patsubst _bin/%,../%,$<) $(notdir $@) |
| 212 | + |
0 commit comments