Skip to content

Commit

Permalink
Merge pull request #120 from harshad16/params-aouth-proxy
Browse files Browse the repository at this point in the history
Parameterize the oauth-proxy image as config var
  • Loading branch information
openshift-merge-robot committed May 23, 2023
2 parents c4742f4 + d85c297 commit 9300c4e
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 6 deletions.
7 changes: 7 additions & 0 deletions config/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ vars:
apiVersion: v1
fieldref:
fieldpath: data.IMAGES_ARTIFACT
- name: IMAGES_OAUTHPROXY
objref:
kind: ConfigMap
name: dspo-parameters
apiVersion: v1
fieldref:
fieldpath: data.IMAGES_OAUTHPROXY
- name: IMAGES_PERSISTENTAGENT
objref:
kind: ConfigMap
Expand Down
1 change: 1 addition & 0 deletions config/base/params.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ IMAGES_CACHE=registry.access.redhat.com/ubi8/ubi-minimal
IMAGES_MOVERESULTSIMAGE=registry.access.redhat.com/ubi8/ubi-micro
IMAGES_MARIADB=registry.redhat.io/rhel8/mariadb-103:1-188
IMAGES_DSPO=quay.io/opendatahub/data-science-pipelines-operator:main-d9ee12b
IMAGES_OAUTHPROXY=registry.redhat.io/openshift4/ose-oauth-proxy:v4.12.0
1 change: 1 addition & 0 deletions config/configmaps/files/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Images:
ApiServer: $(IMAGES_APISERVER)
Artifact: $(IMAGES_ARTIFACT)
OAuthProxy: $(IMAGES_OAUTHPROXY)
PersistentAgent: $(IMAGES_PERSISTENTAGENT)
ScheduledWorkflow: $(IMAGES_SCHEDULEDWORKFLOW)
Cache: $(IMAGES_CACHE)
Expand Down
2 changes: 1 addition & 1 deletion config/internal/apiserver/deployment.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
- '--openshift-delegate-urls={"/": {"group":"route.openshift.io","resource":"routes","verb":"get","name":"ds-pipeline-{{.Name}}","namespace":"{{.Namespace}}"}}'
- '--openshift-sar={"namespace":"{{.Namespace}}","resource":"routes","resourceName":"ds-pipeline-{{.Name}}","verb":"get","resourceAPIGroup":"route.openshift.io"}'
- --skip-auth-regex='(^/metrics|^/apis/v1beta1/healthz)'
image: registry.redhat.io/openshift4/ose-oauth-proxy:v4.12.0
image: {{.OAuthProxy}}
ports:
- containerPort: 8443
name: oauth
Expand Down
2 changes: 1 addition & 1 deletion config/internal/mlpipelines-ui/deployment.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
- '--openshift-delegate-urls={"/": {"group":"route.openshift.io","resource":"routes","verb":"get","name":"ds-pipeline-ui-{{.Name}}","namespace":"{{.Namespace}}"}}'
- '--openshift-sar={"namespace":"{{.Namespace}}","resource":"routes","resourceName":"ds-pipeline-ui-{{.Name}}","verb":"get","resourceAPIGroup":"route.openshift.io"}'
- --skip-auth-regex='(^/metrics|^/apis/v1beta1/healthz)'
image: registry.redhat.io/openshift4/ose-oauth-proxy:v4.12.0
image: {{.OAuthProxy}}
ports:
- containerPort: 8443
name: https
Expand Down
2 changes: 2 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ spec:
value: $(IMAGES_APISERVER)
- name: IMAGES_ARTIFACT
value: $(IMAGES_ARTIFACT)
- name: IMAGES_OAUTHPROXY
value: $(IMAGES_OAUTHPROXY)
- name: IMAGES_PERSISTENTAGENT
value: $(IMAGES_PERSISTENTAGENT)
- name: IMAGES_SCHEDULEDWORKFLOW
Expand Down
2 changes: 2 additions & 0 deletions controllers/config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const (
APIServerCacheImagePath = "Images.Cache"
APIServerMoveResultsImagePath = "Images.MoveResultsImage"
MariaDBImagePath = "Images.MariaDB"
OAuthProxyImagePath = "Images.OAuthProxy"
)

const (
Expand All @@ -80,6 +81,7 @@ var requiredFields = []string{
APIServerCacheImagePath,
APIServerMoveResultsImagePath,
MariaDBImagePath,
OAuthProxyImagePath,
}

func GetConfigRequiredFields() []string {
Expand Down
2 changes: 2 additions & 0 deletions controllers/dspipeline_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type DSPAParams struct {
Owner mf.Owner
APIServer *dspa.APIServer
APIServerServiceName string
OAuthProxy string
ScheduledWorkflow *dspa.ScheduledWorkflow
PersistenceAgent *dspa.PersistenceAgent
MlPipelineUI *dspa.MlPipelineUI
Expand Down Expand Up @@ -359,6 +360,7 @@ func (p *DSPAParams) ExtractParams(ctx context.Context, dsp *dspa.DataSciencePip
p.MlPipelineUI = dsp.Spec.MlPipelineUI.DeepCopy()
p.MariaDB = dsp.Spec.MariaDB.DeepCopy()
p.Minio = dsp.Spec.Minio.DeepCopy()
p.OAuthProxy = config.GetStringConfigWithDefault(config.OAuthProxyImagePath, config.DefaultImageValue)

// TODO: If p.<component> is nil we should create defaults

Expand Down
1 change: 1 addition & 0 deletions controllers/testdata/declarative/case_0/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ Images:
MlPipelineUI: frontend:test0
MariaDB: mariadb:test0
Minio: minio:test0
OAuthProxy: oauth-proxy:test0
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
- '--openshift-delegate-urls={"/": {"group":"route.openshift.io","resource":"routes","verb":"get","name":"ds-pipeline-testdsp0","namespace":"default"}}'
- '--openshift-sar={"namespace":"default","resource":"routes","resourceName":"ds-pipeline-testdsp0","verb":"get","resourceAPIGroup":"route.openshift.io"}'
- --skip-auth-regex='(^/metrics|^/apis/v1beta1/healthz)'
image: registry.redhat.io/openshift4/ose-oauth-proxy:v4.12.0
image: oauth-proxy:test0
ports:
- containerPort: 8443
name: oauth
Expand Down
1 change: 1 addition & 0 deletions controllers/testdata/declarative/case_1/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Images:
Cache: ubi-minimal:test1
MoveResultsImage: busybox:test1
MariaDB: mariadb:test1
OAuthProxy: oauth-proxy:test1
1 change: 1 addition & 0 deletions controllers/testdata/declarative/case_2/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Images:
Cache: ubi-minimal:test2
MoveResultsImage: busybox:test2
MariaDB: mariadb:test2
OAuthProxy: oauth-proxy:test2
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
- '--openshift-delegate-urls={"/": {"group":"route.openshift.io","resource":"routes","verb":"get","name":"ds-pipeline-testdsp2","namespace":"default"}}'
- '--openshift-sar={"namespace":"default","resource":"routes","resourceName":"ds-pipeline-testdsp2","verb":"get","resourceAPIGroup":"route.openshift.io"}'
- --skip-auth-regex='(^/metrics|^/apis/v1beta1/healthz)'
image: registry.redhat.io/openshift4/ose-oauth-proxy:v4.12.0
image: oauth-proxy:test2
ports:
- containerPort: 8443
name: oauth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
- '--openshift-delegate-urls={"/": {"group":"route.openshift.io","resource":"routes","verb":"get","name":"ds-pipeline-ui-testdsp2","namespace":"default"}}'
- '--openshift-sar={"namespace":"default","resource":"routes","resourceName":"ds-pipeline-ui-testdsp2","verb":"get","resourceAPIGroup":"route.openshift.io"}'
- --skip-auth-regex='(^/metrics|^/apis/v1beta1/healthz)'
image: registry.redhat.io/openshift4/ose-oauth-proxy:v4.12.0
image: oauth-proxy:test2
ports:
- containerPort: 8443
name: https
Expand Down
1 change: 1 addition & 0 deletions controllers/testdata/declarative/case_3/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Images:
Cache: ubi-minimal:test3
MoveResultsImage: busybox:test3
MariaDB: mariadb:test3
OAuthProxy: oauth-proxy:test3
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
- '--openshift-delegate-urls={"/": {"group":"route.openshift.io","resource":"routes","verb":"get","name":"ds-pipeline-testdsp3","namespace":"default"}}'
- '--openshift-sar={"namespace":"default","resource":"routes","resourceName":"ds-pipeline-testdsp3","verb":"get","resourceAPIGroup":"route.openshift.io"}'
- --skip-auth-regex='(^/metrics|^/apis/v1beta1/healthz)'
image: registry.redhat.io/openshift4/ose-oauth-proxy:v4.12.0
image: oauth-proxy:test3
ports:
- containerPort: 8443
name: oauth
Expand Down
2 changes: 2 additions & 0 deletions kfdef/kfdef.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ spec:
value: registry.access.redhat.com/ubi8/ubi-micro:8.7
- name: IMAGES_MARIADB
value: registry.redhat.io/rhel8/mariadb-103:1-188
- name: IMAGES_OAUTHPROXY
value: registry.redhat.io/openshift4/ose-oauth-proxy:v4.12.0
repoRef:
name: manifests
path: config
Expand Down

0 comments on commit 9300c4e

Please sign in to comment.