Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ IMG_REPOSITORY ?= quay.io/kubevirt/vm-console-proxy
IMG_TAG ?= latest
IMG ?= ${IMG_REPOSITORY}:${IMG_TAG}

IMG_PULL_POLICY ?= IfNotPresent

SRC_PATHS_TESTS = ./pkg/...
PROJECT_NAME = vm-console-proxy
MANIFETS_PATH = ./manifests
Expand Down Expand Up @@ -38,7 +40,9 @@ push-container:

.PHONY: manifests
manifests:
cd manifests && IMG_REPOSITORY=${IMG_REPOSITORY} IMG_TAG=${IMG_TAG} envsubst < kustomization.yaml.in > kustomization.yaml
cd manifests && \
IMG_REPOSITORY=${IMG_REPOSITORY} IMG_TAG=${IMG_TAG} IMG_PULL_POLICY=${IMG_PULL_POLICY}\
envsubst < kustomization.yaml.in > kustomization.yaml

.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
Expand Down Expand Up @@ -66,6 +70,7 @@ release-manifests: kustomize manifests
$(KUSTOMIZE) build ${MANIFETS_PATH} > ./_out/${PROJECT_NAME}.yaml

.PHONY: deploy
deploy: IMG_PULL_POLICY := Always
deploy: manifests
oc apply -k manifests

Expand Down
2 changes: 1 addition & 1 deletion manifests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
containers:
- command:
- /console
imagePullPolicy: Always
imagePullPolicy: IfNotPresent
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this isn't going to cause issues in dev environments? I.e. Now it will not re-pull the image after a change.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be nice to have a small guide in the dev docs to remind us to patch this in dev, if Felix's concern applies.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the Makefile to set it to Always when using make deploy.

args: []
image: console:latest
name: console
Expand Down
16 changes: 16 additions & 0 deletions manifests/kustomization.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,19 @@ images:
- name: console
newName: ${IMG_REPOSITORY}
newTag: ${IMG_TAG}

patches:
- target:
kind: Deployment
name: vm-console-proxy
patch: |
apiVersion: apps/v1
kind: Deployment
metadata:
name: vm-console-proxy
spec:
template:
spec:
containers:
- name: console
imagePullPolicy: ${IMG_PULL_POLICY}