From 21aba3012f81d7738bf354f3d015ce5598ebd8db Mon Sep 17 00:00:00 2001 From: Aiden Keating Date: Fri, 16 Aug 2019 11:08:24 +0100 Subject: [PATCH 1/4] INTLY-2346 add openshift 4 support --- deploy/template/tutorial-web-app.yml | 14 ++++++++++++++ pkg/handlers/webhandler.go | 12 ++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/deploy/template/tutorial-web-app.yml b/deploy/template/tutorial-web-app.yml index 39c41a0..b4cf50e 100644 --- a/deploy/template/tutorial-web-app.yml +++ b/deploy/template/tutorial-web-app.yml @@ -3,6 +3,16 @@ kind: Template metadata: name: tutorial-web-app parameters: + - name: OPENSHIFT_VERSION + description: The version of OpenShift that it will run in + displayName: OpenShift Version + value: '3' + required: true + - name: OPENSHIFT_API_HOST + description: The OpenShift clusters API URL (Required in OpenShift 4) + displayName: OpenShift API Host + value: https://openshift.default.svc + required: false - name: OPENSHIFT_OAUTHCLIENT_ID description: The OAuthClient id in OpenShift to use for auth displayName: OAuthClient ID @@ -76,6 +86,10 @@ objects: value: ${OPENSHIFT_OAUTHCLIENT_ID} - name: OPENSHIFT_HOST value: ${OPENSHIFT_HOST} + - name: OPENSHIFT_VERSION + value: ${OPENSHIFT_VERSION} + - name: OPENSHIFT_API_HOST + value: ${OPENSHIFT_API_HOST} - name: OPENSHIFT_OAUTH_HOST value: ${OPENSHIFT_OAUTH_HOST} - name: NODE_ENV diff --git a/pkg/handlers/webhandler.go b/pkg/handlers/webhandler.go index 3411671..3ff5ada 100644 --- a/pkg/handlers/webhandler.go +++ b/pkg/handlers/webhandler.go @@ -24,12 +24,16 @@ const ( WTLocations = "WALKTHROUGH_LOCATIONS" IntegreatlyVersion = "INTEGREATLY_VERSION" ClusterType = "CLUSTER_TYPE" - WTLocationsDefault = "https://github.com/integr8ly/tutorial-web-app-walkthroughs#v1.6.5" + OpenShiftVersion = "OPENSHIFT_VERSION" + OpenShiftAPIHost = "OPENSHIFT_API_HOST" + WTLocationsDefault = "https://github.com/integr8ly/tutorial-web-app-walkthroughs#v1.7.0" IntegreatlyVersionDefault = "not set" ClusterTypeDefault = "not set" + OpenShiftVersionDefault = "3" + OpenShiftAPIHostDefault = "openshift.default.svc" ) -var webappParams = [...]string{"OPENSHIFT_OAUTHCLIENT_ID", "OPENSHIFT_HOST", "OPENSHIFT_OAUTH_HOST", "SSO_ROUTE", IntegreatlyVersion, WTLocations, ClusterType} +var webappParams = [...]string{"OPENSHIFT_OAUTHCLIENT_ID", "OPENSHIFT_HOST", "OPENSHIFT_OAUTH_HOST", "SSO_ROUTE", OpenShiftAPIHost, OpenShiftVersion, IntegreatlyVersion, WTLocations, ClusterType} func NewWebHandler(m *metrics.Metrics, osClient openshift.OSClientInterface, factory ClientFactory, cruder SdkCruder) AppHandler { return AppHandler{ @@ -113,6 +117,10 @@ func (h *AppHandler) reconcile(cr *v1alpha1.WebApp) error { updated, dc.Spec.Template.Spec.Containers[0] = updateOrCreateEnvVar(dc.Spec.Template.Spec.Containers[0], param, IntegreatlyVersionDefault) } else if param == ClusterType { updated, dc.Spec.Template.Spec.Containers[0] = updateOrCreateEnvVar(dc.Spec.Template.Spec.Containers[0], param, ClusterTypeDefault) + } else if param == OpenShiftVersion { + updated, dc.Spec.Template.Spec.Containers[0] = updateOrCreateEnvVar(dc.Spec.Template.Spec.Containers[0], param, OpenShiftVersionDefault) + } else if param == OpenShiftAPIHost { + updated, dc.Spec.Template.Spec.Containers[0] = updateOrCreateEnvVar(dc.Spec.Template.Spec.Containers[0], param, OpenShiftAPIHostDefault) } else { //key does not exist in CR, ensure it is not present in the DC updated, dc.Spec.Template.Spec.Containers[0] = deleteEnvVar(dc.Spec.Template.Spec.Containers[0], param) From 60c77c8a54adabb8fd6da07ef02f68966e852e67 Mon Sep 17 00:00:00 2001 From: Aiden Keating Date: Fri, 16 Aug 2019 13:09:53 +0100 Subject: [PATCH 2/4] INTLY-2346 bump webapp version to 2.17.0 --- deploy/template/tutorial-web-app.yml | 12 ++++++------ pkg/handlers/webhandler.go | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/deploy/template/tutorial-web-app.yml b/deploy/template/tutorial-web-app.yml index b4cf50e..de2023d 100644 --- a/deploy/template/tutorial-web-app.yml +++ b/deploy/template/tutorial-web-app.yml @@ -8,10 +8,10 @@ parameters: displayName: OpenShift Version value: '3' required: true - - name: OPENSHIFT_API_HOST + - name: OPENSHIFT_API description: The OpenShift clusters API URL (Required in OpenShift 4) displayName: OpenShift API Host - value: https://openshift.default.svc + value: openshift.default.svc required: false - name: OPENSHIFT_OAUTHCLIENT_ID description: The OAuthClient id in OpenShift to use for auth @@ -43,7 +43,7 @@ parameters: required: false - name: WALKTHROUGH_LOCATIONS description: A comma separated list of git repositories or paths to walkthrough directories - value: https://github.com/integr8ly/tutorial-web-app-walkthroughs.git#v1.6.5 + value: https://github.com/integr8ly/tutorial-web-app-walkthroughs.git#v1.7.1 required: true - name: DATABASE_LOCATION description: The location of the user walkthroughs database in the filesystem @@ -88,8 +88,8 @@ objects: value: ${OPENSHIFT_HOST} - name: OPENSHIFT_VERSION value: ${OPENSHIFT_VERSION} - - name: OPENSHIFT_API_HOST - value: ${OPENSHIFT_API_HOST} + - name: OPENSHIFT_API + value: ${OPENSHIFT_API} - name: OPENSHIFT_OAUTH_HOST value: ${OPENSHIFT_OAUTH_HOST} - name: NODE_ENV @@ -104,7 +104,7 @@ objects: value: ${CLUSTER_TYPE} - name: DATABASE_LOCATION value: ${DATABASE_LOCATION} - image: quay.io/integreatly/tutorial-web-app:2.16.0 + image: quay.io/integreatly/tutorial-web-app:2.18.0 imagePullPolicy: Always name: tutorial-web-app ports: diff --git a/pkg/handlers/webhandler.go b/pkg/handlers/webhandler.go index 3ff5ada..2d6a98a 100644 --- a/pkg/handlers/webhandler.go +++ b/pkg/handlers/webhandler.go @@ -25,8 +25,8 @@ const ( IntegreatlyVersion = "INTEGREATLY_VERSION" ClusterType = "CLUSTER_TYPE" OpenShiftVersion = "OPENSHIFT_VERSION" - OpenShiftAPIHost = "OPENSHIFT_API_HOST" - WTLocationsDefault = "https://github.com/integr8ly/tutorial-web-app-walkthroughs#v1.7.0" + OpenShiftAPIHost = "OPENSHIFT_API" + WTLocationsDefault = "https://github.com/integr8ly/tutorial-web-app-walkthroughs#v1.7.1" IntegreatlyVersionDefault = "not set" ClusterTypeDefault = "not set" OpenShiftVersionDefault = "3" From 246346c125199df09cde5718d3a6a2456eaae17e Mon Sep 17 00:00:00 2001 From: Aiden Keating Date: Thu, 22 Aug 2019 09:18:52 +0100 Subject: [PATCH 3/4] bump template version to v1.7.2 --- deploy/template/tutorial-web-app.yml | 2 +- pkg/handlers/webhandler.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/template/tutorial-web-app.yml b/deploy/template/tutorial-web-app.yml index de2023d..b8e3ffc 100644 --- a/deploy/template/tutorial-web-app.yml +++ b/deploy/template/tutorial-web-app.yml @@ -43,7 +43,7 @@ parameters: required: false - name: WALKTHROUGH_LOCATIONS description: A comma separated list of git repositories or paths to walkthrough directories - value: https://github.com/integr8ly/tutorial-web-app-walkthroughs.git#v1.7.1 + value: https://github.com/integr8ly/tutorial-web-app-walkthroughs.git#v1.7.2 required: true - name: DATABASE_LOCATION description: The location of the user walkthroughs database in the filesystem diff --git a/pkg/handlers/webhandler.go b/pkg/handlers/webhandler.go index 2d6a98a..a45490b 100644 --- a/pkg/handlers/webhandler.go +++ b/pkg/handlers/webhandler.go @@ -26,7 +26,7 @@ const ( ClusterType = "CLUSTER_TYPE" OpenShiftVersion = "OPENSHIFT_VERSION" OpenShiftAPIHost = "OPENSHIFT_API" - WTLocationsDefault = "https://github.com/integr8ly/tutorial-web-app-walkthroughs#v1.7.1" + WTLocationsDefault = "https://github.com/integr8ly/tutorial-web-app-walkthroughs#v1.7.2" IntegreatlyVersionDefault = "not set" ClusterTypeDefault = "not set" OpenShiftVersionDefault = "3" From c399299e97ee9ffc235ed84c18bca5b5f51a6b16 Mon Sep 17 00:00:00 2001 From: Aiden Keating Date: Fri, 16 Aug 2019 14:42:51 +0100 Subject: [PATCH 4/4] bump version to 0.0.27 --- Makefile | 2 +- deploy/operator.yaml | 2 +- version/version.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b3d77ee..af723f4 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ SHELL=/bin/bash REG=quay.io ORG=integreatly IMAGE=tutorial-web-app-operator -TAG=0.0.26 +TAG=0.0.27 KUBE_CMD=oc apply -f DEPLOY_DIR=deploy OUT_STATIC_DIR=tmp/_output diff --git a/deploy/operator.yaml b/deploy/operator.yaml index 73ed789..848bd64 100644 --- a/deploy/operator.yaml +++ b/deploy/operator.yaml @@ -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.26 + image: quay.io/integreatly/tutorial-web-app-operator:v0.0.27 ports: - containerPort: 60000 name: metrics diff --git a/version/version.go b/version/version.go index 332f1cb..ec42aec 100644 --- a/version/version.go +++ b/version/version.go @@ -1,5 +1,5 @@ package version var ( - Version = "0.0.26" + Version = "0.0.27" )