Skip to content

Commit

Permalink
Update kustomize for setting controller tag
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Nov 4, 2020
1 parent ced5fcf commit 69be68e
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 17 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci-only.yaml
Expand Up @@ -43,7 +43,6 @@ jobs:
run: |
export TAG=${{ github.sha }}
sed -ie "s/0.2.1/$TAG/g" ./manifest.yaml
sed -ie "s/ghcr.io//g" ./manifest.yaml
kubectl apply -f ./manifest.yaml
- name: Check deployment
run:
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile
@@ -1,4 +1,3 @@
# Build the manager binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.13 as builder

ARG TARGETPLATFORM
Expand All @@ -22,7 +21,6 @@ COPY controllers/ controllers/
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
GO111MODULE=on go build -ldflags="-w -s" -a -o /usr/bin/controller

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM --platform=${BUILDPLATFORM:-linux/amd64} gcr.io/distroless/static:nonroot
WORKDIR /
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Expand Up @@ -37,11 +37,12 @@ uninstall: manifests

# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
deploy: manifests
cd config/controller && kustomize edit set image controller=alexellis2/registry-creds-controller:$(TAG)
cd config/controller && kustomize edit set image controller=ghcr.io/alexellis/registry-creds-controller:$(TAG)
kustomize build config/default | kubectl apply -f -

.PHONY: shrinkwrap
shrinkwrap:
cd config/controller && kustomize edit set image controller=alexellis2/registry-creds-controller:$(TAG)
cd config/controller && kustomize edit set image controller=ghcr.io/alexellis/registry-creds-controller:$(TAG)
kustomize build config/default > manifest.yaml

# Generate manifests e.g. CRD, RBAC etc.
Expand Down
Expand Up @@ -24,11 +24,11 @@ spec:
spec:
containers:
- command:
- /manager
- /controller
args:
- --enable-leader-election
image: alexellis2/registry-creds-controller:0.1.1
name: manager
image: ghcr.io/alexellis/registry-creds-controller:0.1.1
name: controller
resources:
limits:
cpu: 100m
Expand Down
6 changes: 3 additions & 3 deletions config/controller/kustomization.yaml
@@ -1,8 +1,8 @@
resources:
- manager.yaml
- controller.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: alexellis2/registry-creds-controller
newTag: 0.2.0
newName: ghcr.io/alexellis/registry-creds-controller
newTag: 0.2.1
6 changes: 3 additions & 3 deletions config/crd/bases/ops.alexellis.io_clusterpullsecrets.yaml
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: (unknown)
controller-gen.kubebuilder.io/version: v0.2.5
creationTimestamp: null
name: clusterpullsecrets.ops.alexellis.io
spec:
Expand Down Expand Up @@ -58,5 +58,5 @@ status:
acceptedNames:
kind: ""
plural: ""
conditions: null
storedVersions: null
conditions: []
storedVersions: []
5 changes: 2 additions & 3 deletions manifest.yaml
Expand Up @@ -9,7 +9,7 @@ apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: (unknown)
controller-gen.kubebuilder.io/version: v0.2.5
creationTimestamp: null
name: clusterpullsecrets.ops.alexellis.io
spec:
Expand Down Expand Up @@ -229,9 +229,8 @@ spec:
- --enable-leader-election
command:
- /controller
image: ghcr.io/alexellis/registry-creds:0.2.1
image: ghcr.io/alexellis/registry-creds-controller:0.2.1
name: controller
imagePullPolicy: IfNotPresent
resources:
limits:
cpu: 100m
Expand Down

0 comments on commit 69be68e

Please sign in to comment.