Skip to content

Commit

Permalink
Make imagePullPolicy default to Always only if using :latest image (#959
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mkmik committed Sep 15, 2022
1 parent 5318371 commit bc0c36e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -16,7 +16,7 @@ REGISTRY ?= docker.io
CONTROLLER_IMAGE = $(REGISTRY)/bitnami/sealed-secrets-controller:latest
KUBESEAL_IMAGE = $(REGISTRY)/bitnami/sealed-secrets-kubeseal:latest
INSECURE_REGISTRY = false # useful for local registry
IMAGE_PULL_POLICY = Always
IMAGE_PULL_POLICY =
KUBECONFIG ?= $(HOME)/.kube/config

GO_PACKAGES = ./...
Expand Down Expand Up @@ -50,7 +50,7 @@ generate: $(GO_FILES)
@# TODO: remove as soon as a proper way forward is found:
@# code-generator insists in generating the file under directory:
@# github.com/bitnami-labs/sealeds-secrets/...
@# instead of just updating ./pkg
@# instead of just updating ./pkg
@# for that reason we generate at gentmp and then move it all to ./pkg
cp -r gentmp/github.com/bitnami-labs/sealed-secrets/pkg . && rm -rf gentmp/

Expand Down
8 changes: 5 additions & 3 deletions controller-norbac.jsonnet
@@ -1,6 +1,6 @@
// Minimal required deployment for a functional controller.

local kubecfg = import "kubecfg.libsonnet";
local kubecfg = import 'kubecfg.libsonnet';

local namespace = 'kube-system';

Expand All @@ -9,7 +9,9 @@ local namespace = 'kube-system';
local kube = self.kube + import 'kube-fixes.libsonnet',

controllerImage:: std.extVar('CONTROLLER_IMAGE'),
imagePullPolicy:: std.extVar('IMAGE_PULL_POLICY'),
imagePullPolicy:: local ext = std.extVar('IMAGE_PULL_POLICY'); if ext == '' then
if std.endsWith($.controllerImage, ':latest') then 'Always' else 'IfNotPresent'
else ext,

crd: kube.CustomResourceDefinition('bitnami.com', 'v1alpha1', 'SealedSecret') {
spec+: {
Expand All @@ -20,7 +22,7 @@ local namespace = 'kube-system';
subresources: {
status: {},
},
schema: kubecfg.parseYaml(importstr "schema-v1alpha1.yaml")[0],
schema: kubecfg.parseYaml(importstr 'schema-v1alpha1.yaml')[0],
},
},
},
Expand Down

0 comments on commit bc0c36e

Please sign in to comment.