Skip to content

Commit b662aea

Browse files
author
Himanshu Pandey
committed
Modified Makefile for the Kustomization IMG Flag changes
1 parent bc674b3 commit b662aea

File tree

9 files changed

+5
-81
lines changed

9 files changed

+5
-81
lines changed

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
3838
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
3939
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
4040
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
41+
golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
4142
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
4243
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
4344
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -67,3 +68,4 @@ gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
6768
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
6869
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
6970
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
71+

pkg/scaffold/project.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ func (p *V2Project) Scaffold() error {
181181
return s.Execute(
182182
input.Options{ProjectPath: projectInput.Path, BoilerplatePath: bpInput.Path},
183183
&project.GitIgnore{},
184-
&scaffoldv2.KustomizeImagePatch{},
185184
&metricsauthv2.KustomizePrometheusMetricsPatch{},
186185
&metricsauthv2.KustomizeAuthProxyPatch{},
187186
&scaffoldv2.AuthProxyService{},

pkg/scaffold/v2/kustomize.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ bases:
7575
#- ../certmanager
7676
7777
patches:
78-
- manager_image_patch.yaml
7978
# Protect the /metrics endpoint by putting it behind auth.
8079
# Only one of manager_auth_proxy_patch.yaml and
8180
# manager_prometheus_metrics_patch.yaml should be enabled.

pkg/scaffold/v2/kustomize_image_patch.go

Lines changed: 0 additions & 61 deletions
This file was deleted.

pkg/scaffold/v2/makefile.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ install: manifests
7676
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
7777
deploy: manifests
7878
kubectl apply -f config/crd/bases
79+
cd config/manager && kustomize edit set image controller=${IMG}
7980
kustomize build config/default | kubectl apply -f -
8081
8182
# Generate manifests e.g. CRD, RBAC etc.
@@ -97,8 +98,6 @@ generate: controller-gen
9798
# Build the docker image
9899
docker-build: test
99100
docker build . -t ${IMG}
100-
@echo "updating kustomize image patch file for manager resource"
101-
sed -i'' -e 's@image: .*@image: '"${IMG}"'@' ./config/default/manager_image_patch.yaml
102101
103102
# Push the docker image
104103
docker-push:

test/e2e/e2e_v2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ var _ = Describe("kubebuilder", func() {
150150
// $ kubectl create clusterrolebinding myname-cluster-admin-binding --clusterrole=cluster-admin [email protected]
151151
// https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control
152152
By("deploying controller manager")
153-
err = kbc.Make("deploy")
153+
err = kbc.Make("deploy", "IMG="+kbc.ImageName)
154154
Expect(err).Should(Succeed())
155155

156156
By("validate the controller-manager pod running as expected")

testdata/project-v2/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ install: manifests
3232
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
3333
deploy: manifests
3434
kubectl apply -f config/crd/bases
35+
cd config/manager && kustomize edit set image controller=${IMG}
3536
kustomize build config/default | kubectl apply -f -
3637

3738
# Generate manifests e.g. CRD, RBAC etc.
@@ -53,8 +54,6 @@ generate: controller-gen
5354
# Build the docker image
5455
docker-build: test
5556
docker build . -t ${IMG}
56-
@echo "updating kustomize image patch file for manager resource"
57-
sed -i'' -e 's@image: .*@image: '"${IMG}"'@' ./config/default/manager_image_patch.yaml
5857

5958
# Push the docker image
6059
docker-push:

testdata/project-v2/config/default/kustomization.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ bases:
2222
#- ../certmanager
2323

2424
patches:
25-
- manager_image_patch.yaml
2625
# Protect the /metrics endpoint by putting it behind auth.
2726
# Only one of manager_auth_proxy_patch.yaml and
2827
# manager_prometheus_metrics_patch.yaml should be enabled.

testdata/project-v2/config/default/manager_image_patch.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)