Skip to content

Commit 03fbca3

Browse files
Merge pull request #578 from jiridanek/jd_webhook_no_restart_otel
RHOAIENG-13916: chore(odh-notebook-controller/tests): define constant for the tracing event
2 parents 0adf6e6 + c05608c commit 03fbca3

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

components/odh-notebook-controller/controllers/notebook_webhook.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ var getWebhookTracer func() trace.Tracer = sync.OnceValue(func() trace.Tracer {
6868
return otel.GetTracerProvider().Tracer("opendatahub.io/kubeflow/components/odh-notebook-controller/controllers/notebook_webhook.go")
6969
})
7070

71+
const (
72+
IMAGE_STREAM_NOT_FOUND_EVENT = "imagestream-not-found"
73+
)
74+
7175
// InjectReconciliationLock injects the kubeflow notebook controller culling
7276
// stop annotation to explicitly start the notebook pod when the ODH notebook
7377
// controller finishes the reconciliation. Otherwise, a race condition may happen
@@ -742,7 +746,7 @@ func SetContainerImageFromRegistry(ctx context.Context, config *rest.Config, not
742746
}
743747
}
744748
if !imagestreamFound {
745-
span.AddEvent("imagestream-not-found")
749+
span.AddEvent(IMAGE_STREAM_NOT_FOUND_EVENT)
746750
log.Error(nil, "ImageStream not found in main controller namespace, or the ImageStream is present but does not contain a dockerImageReference for the specified tag",
747751
"imageSelected", imageSelected[0], "tag", imageSelected[1], "namespace", namespace)
748752
}

components/odh-notebook-controller/controllers/notebook_webhook_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ var _ = Describe("The Openshift Notebook webhook", func() {
113113
},
114114
expectedImage: "quay.io/modh/odh-generic-data-science-notebook@sha256:76e6af79c601a323f75a58e7005de0beac66b8cccc3d2b67efb6d11d85f0cfa1",
115115
unexpectedEvents: []string{
116-
"imagestream-not-found",
116+
IMAGE_STREAM_NOT_FOUND_EVENT,
117117
},
118118
},
119119
{
@@ -165,7 +165,7 @@ var _ = Describe("The Openshift Notebook webhook", func() {
165165
// there is no update to the Notebook
166166
expectedImage: ":some-tag",
167167
expectedEvents: []string{
168-
"imagestream-not-found",
168+
IMAGE_STREAM_NOT_FOUND_EVENT,
169169
},
170170
},
171171
}

0 commit comments

Comments
 (0)