Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #95 from dimitraz/update-route
Browse files Browse the repository at this point in the history
Update route name for 2.x
  • Loading branch information
aidenkeating authored May 6, 2020
2 parents 5dd810e + e328b8a commit 802eab2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SHELL=/bin/bash
REG=quay.io
ORG=integreatly
IMAGE=tutorial-web-app-operator
TAG=v0.0.52
TAG=v0.0.53
KUBE_CMD=oc apply -f
DEPLOY_DIR=deploy
OUT_STATIC_DIR=tmp/_output
Expand Down
2 changes: 1 addition & 1 deletion deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
serviceAccountName: tutorial-web-app-operator
containers:
- name: tutorial-web-app-operator
image: quay.io/integreatly/tutorial-web-app-operator:v0.0.52
image: quay.io/integreatly/tutorial-web-app-operator:v0.0.53
ports:
- containerPort: 60000
name: metrics
Expand Down
5 changes: 4 additions & 1 deletion pkg/handlers/webhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ func deleteEnvVar(container corev1.Container, envName string) (bool, corev1.Cont
}
return false, container
}

func updateOrCreateEnvVar(container corev1.Container, envName, envVal string) (bool, corev1.Container) {
for envIndex, envVar := range container.Env {
if envVar.Name == envName {
Expand Down Expand Up @@ -257,7 +258,9 @@ func (h *AppHandler) CreateRoute(cr *v1alpha1.WebApp) *routev1.Route {
// make sure to not change the existing route hosts because the cluster CORS settings
// depend on it
if subdomain != "" {
route.Spec.Host = fmt.Sprintf("solution-explorer.%s", subdomain)
routeName := "solution-explorer"
route.Name = routeName
route.Spec.Host = fmt.Sprintf("%s.%s", routeName, subdomain)
}
return route
}
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package version

var (
Version = "0.0.52"
Version = "0.0.53"
)

0 comments on commit 802eab2

Please sign in to comment.