Skip to content

Commit aed281a

Browse files
committed
Always deploy sample config
- enableSampleConfig=false now updates sample config json directly Signed-off-by: Giulio Frasca <[email protected]>
1 parent d24b710 commit aed281a

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

config/internal/apiserver/default/deployment.yaml.tmpl

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,7 @@ spec:
185185
args:
186186
- --config=/config
187187
- -logtostderr=true
188-
{{ if .APIServer.EnableSamplePipeline }}
189188
- --sampleconfig=/config/sample_config.json
190-
{{ end }}
191189
{{ if .PodToPodTLS }}
192190
- --tlsCertPath=/etc/tls/private/tls.crt
193191
- --tlsCertKeyPath=/etc/tls/private/tls.key
@@ -246,19 +244,15 @@ spec:
246244
- mountPath: /etc/tls/private
247245
name: proxy-tls
248246
{{ end }}
249-
{{ if or .APIServer.EnableSamplePipeline .CustomCABundle }}
250-
{{ if .APIServer.EnableSamplePipeline }}
251247
- name: sample-config
252248
mountPath: /config/sample_config.json
253249
subPath: sample_config.json
254250
- name: sample-pipeline
255251
mountPath: /samples/
256-
{{ end }}
257252
{{ if .CustomCABundle }}
258253
- mountPath: {{ .CustomCABundleRootMountPath }}
259254
name: ca-bundle
260255
{{ end }}
261-
{{ end }}
262256
{{ if .APIServer.EnableRoute }}
263257
- name: oauth-proxy
264258
args:
@@ -330,11 +324,10 @@ spec:
330324
configMap:
331325
name: {{ .CustomCABundle.ConfigMapName }}
332326
{{ end }}
333-
{{ if .APIServer.EnableSamplePipeline }}
334327
- name: sample-config
335328
configMap:
336329
name: sample-config-{{.Name}}
337330
- name: sample-pipeline
338331
configMap:
339332
name: sample-pipeline-{{.Name}}
340-
{{ end }}
333+

controllers/apiserver.go

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
dspav1 "github.com/opendatahub-io/data-science-pipelines-operator/api/v1"
2626
"github.com/opendatahub-io/data-science-pipelines-operator/controllers/config"
2727
v1 "github.com/openshift/api/route/v1"
28-
corev1 "k8s.io/api/core/v1"
2928
"k8s.io/apimachinery/pkg/types"
3029
)
3130

@@ -174,20 +173,10 @@ func (r *DSPAReconciler) ReconcileAPIServer(ctx context.Context, dsp *dspav1.Dat
174173
}
175174
}
176175

177-
for cmName, template := range samplePipelineTemplates {
178-
//if dsp.Spec.APIServer.EnableSamplePipeline || dsp.Spec.APIServer.ManagedPipelines.EnableIrisPipeline || dsp.Spec.APIServer.ManagedPipelines.EnableInstructLabPipeline {
179-
if dsp.Spec.APIServer.EnableSamplePipeline {
180-
err := r.Apply(dsp, params, template)
181-
if err != nil {
182-
return err
183-
}
184-
} else {
185-
cm := &corev1.ConfigMap{}
186-
namespacedNamed := types.NamespacedName{Name: cmName + "-" + dsp.Name, Namespace: dsp.Namespace}
187-
err := r.DeleteResourceIfItExists(ctx, cm, namespacedNamed)
188-
if err != nil {
189-
return err
190-
}
176+
for _, template := range samplePipelineTemplates {
177+
err := r.Apply(dsp, params, template)
178+
if err != nil {
179+
return err
191180
}
192181
}
193182

0 commit comments

Comments
 (0)