Skip to content

Commit

Permalink
Makefile: Fix bug when deploy-on-openshift target fails
Browse files Browse the repository at this point in the history
This commit fixes a bug when deploy-on-openshift failes due to template
files included in the list of files to be applied on k8s and because the
_INSECURE_REGISTRY_ variable is not set in the template.

Signed-off-by: Cosmin Tupangiu <[email protected]>
  • Loading branch information
tupyy committed Oct 28, 2024
1 parent eed5721 commit 8a68183
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ MIGRATION_PLANNER_AGENT_IMAGE ?= quay.io/kubev2v/migration-planner-agent
MIGRATION_PLANNER_API_IMAGE ?= quay.io/kubev2v/migration-planner-api
MIGRATION_PLANNER_API_IMAGE_PULL_POLICY ?= Always
MIGRATION_PLANNER_UI_IMAGE ?= quay.io/kubev2v/migration-planner-ui
INSECURE_REGISTRY ?=
INSECURE_REGISTRY ?= true
DOWNLOAD_RHCOS ?= true
KUBECTL ?= kubectl
IFACE ?= eth0
Expand Down Expand Up @@ -114,14 +114,14 @@ deploy-on-kind:
$(KUBECTL) apply -f deploy/k8s/

deploy-on-openshift:
sed 's|@MIGRATION_PLANNER_AGENT_IMAGE@|$(MIGRATION_PLANNER_AGENT_IMAGE)|g; s|@MIGRATION_PLANNER_API_IMAGE_PULL_POLICY@|$(MIGRATION_PLANNER_API_IMAGE_PULL_POLICY)|g; s|@MIGRATION_PLANNER_API_IMAGE@|$(MIGRATION_PLANNER_API_IMAGE)|g' deploy/k8s/migration-planner.yaml.template > deploy/k8s/migration-planner.yaml
sed 's|@MIGRATION_PLANNER_AGENT_IMAGE@|$(MIGRATION_PLANNER_AGENT_IMAGE)|g; s|@MIGRATION_PLANNER_API_IMAGE_PULL_POLICY@|$(MIGRATION_PLANNER_API_IMAGE_PULL_POLICY)|g; s|@MIGRATION_PLANNER_API_IMAGE@|$(MIGRATION_PLANNER_API_IMAGE)|g s|@INSECURE_REGISTRY@|$(INSECURE_REGISTRY)|g' deploy/k8s/migration-planner.yaml.template > deploy/k8s/migration-planner.yaml
sed 's|@MIGRATION_PLANNER_UI_IMAGE@|$(MIGRATION_PLANNER_UI_IMAGE)|g' deploy/k8s/migration-planner-ui.yaml.template > deploy/k8s/migration-planner-ui.yaml
ls deploy/k8s | awk '/secret|service/' | xargs -I {} oc apply -f deploy/k8s/{}
oc create route edge planner --service=migration-planner-ui || true
oc expose service migration-planner-agent --name planner-agent || true
@config_server=$$(oc get route planner-agent -o jsonpath='{.spec.host}'); \
oc create secret generic migration-planner-secret --from-literal=config_server=http://$$config_server || true
ls deploy/k8s | awk '! /secret|service/' | xargs -I {} oc apply -f deploy/k8s/{}
ls deploy/k8s | awk '! /secret|service|template/' | xargs -I {} oc apply -f deploy/k8s/{}

undeploy-on-openshift:
oc delete route planner || true
Expand Down
2 changes: 1 addition & 1 deletion deploy/k8s/migration-planner.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
- name: MIGRATION_PLANNER_AGENT_IMAGE
value: @MIGRATION_PLANNER_AGENT_IMAGE@
- name: INSECURE_REGISTRY
value: @INSECURE_REGISTRY@
value: "@INSECURE_REGISTRY@"
volumeMounts:
volumeMounts:
- name: migration-planner-config
Expand Down

0 comments on commit 8a68183

Please sign in to comment.