@@ -106,21 +106,21 @@ helm-docs: docker
106106helm-lint : docker
107107 @docker run -v " $( SRC_ROOT) :/workdir" --entrypoint /bin/sh quay.io/helmpack/chart-testing:v3.3.1 -c " cd /workdir; ct lint --config .github/configs/ct.yaml --lint-conf .github/configs/lintconf.yaml --all --debug"
108108
109- helm-test : helm-controller-version kind ct ko-build-all helm-create helm-install helm-destroy
109+ helm-test : helm-controller-version ct ko-build-all helm-create helm-install helm-destroy
110110
111111helm-install :
112112 @kubectl apply --server-side=true -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.2/cert-manager.yaml
113113 @make install-capsule
114114 @kubectl apply --server-side=true -f https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.58.0/bundle.yaml
115115 @$(CT ) install --config $(SRC_ROOT ) /.github/configs/ct.yaml --namespace=capsule-system --all --debug
116116
117- helm-create :
118- @kind create cluster --wait=60s --name capsule-charts
119- @kind load docker-image --name capsule-charts $(CAPSULE_PROXY_IMG ) :$(VERSION )
117+ helm-create : kind
118+ @$( KIND ) create cluster --wait=60s --name capsule-charts
119+ @$( KIND ) load docker-image --name capsule-charts $(CAPSULE_PROXY_IMG ) :$(VERSION )
120120 @kubectl create ns capsule-system
121121
122- helm-destroy :
123- @kind delete cluster --name capsule-charts
122+ helm-destroy : kind
123+ @$( KIND ) delete cluster --name capsule-charts
124124
125125# ###################
126126# -- Testing
@@ -129,14 +129,18 @@ helm-destroy:
129129.PHONY : e2e
130130e2e : e2e-build e2e-install e2e-exec
131131
132- .PHONY : e2e-exec
133- e2e-exec :
132+ .PHONY : e2e-legacy- exec
133+ e2e-legacy- exec :
134134 @./e2e/run.bash $$ {CLIENT_TEST:-kubectl}-$$ {CAPSULE_PROXY_MODE:-https}
135135
136+ .PHONY : e2e-exec
137+ e2e-exec : ginkgo
138+ $(GINKGO ) -v -tags e2e ./e2e
139+
136140.PHONY : e2e-build
137- e2e-build :
141+ e2e-build : kind
138142 @echo " Building kubernetes env using Kind $$ {KIND_K8S_VERSION:-v1.27.0}..."
139- @kind create cluster --name capsule --image kindest/node:$$ {KIND_K8S_VERSION:-v1.27.0} --config ./e2e/kind.yaml --wait=120s \
143+ @$( KIND ) create cluster --name capsule --image kindest/node:$$ {KIND_K8S_VERSION:-v1.27.0} --config ./e2e/kind.yaml --wait=120s \
140144 && kubectl taint nodes capsule-worker2 key1=value1:NoSchedule
141145 @helm repo add bitnami https://charts.bitnami.com/bitnami
142146 @helm repo update
@@ -149,13 +153,13 @@ e2e-build:
149153e2e-install : install-capsule install-capsule-proxy rbac-fix
150154
151155.PHONY : e2e-load-image
152- e2e-load-image : ko-build-all
156+ e2e-load-image : kind ko-build-all
153157 @echo " Loading Docker image..."
154- @kind load docker-image --name capsule --nodes capsule-worker $(CAPSULE_PROXY_IMG ) :$(VERSION )
158+ @$( KIND ) load docker-image --name capsule $(CAPSULE_PROXY_IMG ) :$(VERSION )
155159
156160.PHONY : e2e-destroy
157- e2e-destroy :
158- kind delete cluster --name capsule
161+ e2e-destroy : kind
162+ $( KIND ) delete cluster --name capsule
159163
160164install-capsule :
161165 @echo " Installing capsule..."
@@ -185,7 +189,8 @@ ifeq ($(CAPSULE_PROXY_MODE),http)
185189 --set "kind=DaemonSet" \
186190 --set "daemonset.hostNetwork=true" \
187191 --set "serviceMonitor.enabled=false" \
188- --set "options.generateCertificates=false"
192+ --set "options.generateCertificates=false" \
193+ --set "options.extraArgs={--feature-gates=ProxyClusterScoped=true,--feature-gates=ProxyAllNamespaced=true}"
189194else
190195 @echo "Running in HTTPS mode"
191196 @echo "capsule proxy certificates..."
@@ -194,19 +199,19 @@ else
194199 && kubectl --namespace capsule-system create secret generic capsule-proxy --from-file=tls.key=./127.0.0.1-key.pem --from-file=tls.crt=./127.0.0.1.pem --from-literal=ca=$$(cat $(ROOTCA) | base64 |tr -d '\n')
195200 @echo "kubeconfig configurations..."
196201 @cd hack \
197- && curl -s https://raw.githubusercontent.com/projectcapsule/capsule/main/hack/create-user.sh | bash -s -- alice oil capsule.clastix.io \
202+ && curl -s https://raw.githubusercontent.com/projectcapsule/capsule/main/hack/create-user.sh | bash -s -- alice oil projectcapsule.dev, capsule.clastix.io \
198203 && mv alice-oil.kubeconfig alice.kubeconfig \
199204 && KUBECONFIG=alice.kubeconfig kubectl config set clusters.kind-capsule.certificate-authority-data $$(cat $(ROOTCA) | base64 |tr -d '\n') \
200205 && KUBECONFIG=alice.kubeconfig kubectl config set clusters.kind-capsule.server https://127.0.0.1:9001 \
201- && curl -s https://raw.githubusercontent.com/projectcapsule/capsule/main/hack/create-user.sh | bash -s -- bob gas capsule.clastix.io \
206+ && curl -s https://raw.githubusercontent.com/projectcapsule/capsule/main/hack/create-user.sh | bash -s -- bob gas projectcapsule.dev, capsule.clastix.io \
202207 && mv bob-gas.kubeconfig bob.kubeconfig \
203208 && KUBECONFIG=bob.kubeconfig kubectl config set clusters.kind-capsule.certificate-authority-data $$(cat $(ROOTCA) | base64 |tr -d '\n') \
204209 && KUBECONFIG=bob.kubeconfig kubectl config set clusters.kind-capsule.server https://127.0.0.1:9001 \
205- && curl -s https://raw.githubusercontent.com/projectcapsule/capsule/main/hack/create-user.sh | bash -s -- joe gas capsule.clastix.io,foo.clastix.io \
210+ && curl -s https://raw.githubusercontent.com/projectcapsule/capsule/main/hack/create-user.sh | bash -s -- joe gas projectcapsule.dev, capsule.clastix.io,foo.clastix.io \
206211 && mv joe-gas.kubeconfig foo.clastix.io.kubeconfig \
207212 && KUBECONFIG=foo.clastix.io.kubeconfig kubectl config set clusters.kind-capsule.certificate-authority-data $$(cat $(ROOTCA) | base64 |tr -d '\n') \
208213 && KUBECONFIG=foo.clastix.io.kubeconfig kubectl config set clusters.kind-capsule.server https://127.0.0.1:9001 \
209- && curl -s https://raw.githubusercontent.com/projectcapsule/capsule/main/hack/create-user.sh | bash -s -- dave soil capsule.clastix.io,bar.clastix.io \
214+ && curl -s https://raw.githubusercontent.com/projectcapsule/capsule/main/hack/create-user.sh | bash -s -- dave soil projectcapsule.dev, capsule.clastix.io,bar.clastix.io \
210215 && mv dave-soil.kubeconfig dave.kubeconfig \
211216 && kubectl --kubeconfig=dave.kubeconfig config set clusters.kind-capsule.certificate-authority-data $$(cat $(ROOTCA) | base64 |tr -d '\n') \
212217 && kubectl --kubeconfig=dave.kubeconfig config set clusters.kind-capsule.server https://127.0.0.1:9001
@@ -219,8 +224,10 @@ else
219224 --set "service.nodePort=" \
220225 --set "kind=DaemonSet" \
221226 --set "daemonset.hostNetwork=true" \
222- --set "serviceMonitor.enabled=false"
227+ --set "serviceMonitor.enabled=false" \
228+ --set "options.extraArgs={--feature-gates=ProxyClusterScoped=true,--feature-gates=ProxyAllNamespaced=true}"
223229endif
230+ @kubectl rollout restart ds capsule-proxy -n capsule-system || true
224231
225232rbac-fix :
226233 @echo " RBAC customization..."
@@ -258,6 +265,11 @@ CONTROLLER_GEN_VERSION = v0.8.0
258265controller-gen : # # Download controller-gen locally if necessary.
259266 $(call go-install-tool,$(CONTROLLER_GEN ) ,sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION ) )
260267
268+ GINKGO := $(shell pwd) /bin/ginkgo
269+ GINKGO_VERSION = v2.19.0
270+ ginkgo : # # Download ginkgo locally if necessary.
271+ $(call go-install-tool,$(GINKGO ) ,github.com/onsi/ginkgo/v2/ginkgo@$(GINKGO_VERSION ) )
272+
261273MKCERT = $(shell pwd) /bin/mkcert
262274MKCERT_VERSION = v1.4.4
263275mkcert : # # Download mkcert locally if necessary.
0 commit comments