Skip to content

Commit

Permalink
JobSink with Istio config for Job spec (#1010)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Gencur <[email protected]>
  • Loading branch information
openshift-cherrypick-robot and mgencur authored Jan 28, 2025
1 parent d5b22f7 commit bf54a53
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/rekt/features/jobsink/jobsink.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ func Success() *feature.Feature {
Scheme: "http",
Host: network.GetServiceHostname(sink, environment.FromContext(ctx).Namespace()),
}
jobsink.Install(jobSink, jobsink.WithForwarderJob(sinkURL.String()))(ctx, t)
var opts []func(*batchv1.Job)
if ic := environment.GetIstioConfig(ctx); ic.Enabled {
opts = append(opts, jobsink.WithIstioConfig())
}
jobsink.Install(jobSink, jobsink.WithForwarderJob(sinkURL.String(), opts...))(ctx, t)
})

f.Setup("jobsink is addressable", jobsink.IsAddressable(jobSink))
Expand Down
16 changes: 16 additions & 0 deletions test/rekt/resources/jobsink/jobsink.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,22 @@ func WithJob(job batchv1.Job) manifest.CfgFn {
}
}

func WithIstioConfig() func(*batchv1.Job) {
return func(job *batchv1.Job) {
if job.Spec.Template.Labels == nil {
job.Spec.Template.Labels = make(map[string]string)
}
job.Spec.Template.Labels["sidecar.istio.io/inject"] = "true"

if job.Spec.Template.Annotations == nil {
job.Spec.Template.Annotations = make(map[string]string)
}
job.Spec.Template.Annotations["sidecar.istio.io/rewriteAppHTTPProbers"] = "true"
job.Spec.Template.Annotations["proxy.istio.io/config"] = `{ "holdApplicationUntilProxyStarts": true }`
job.Spec.Template.Annotations["sidecar.istio.io/inject"] = "true" // For backwards compatibility.
}
}

func WithForwarderJob(sink string, options ...func(*batchv1.Job)) manifest.CfgFn {
return func(cfg map[string]interface{}) {
j := batchv1.Job{
Expand Down

37 comments on commit bf54a53

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-webhook-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-pong-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-test-recordevents-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-test-wathola-forwarder-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-jobsink-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-event-display-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-filter-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-ingress-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-mtchannel-broker-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-migrate-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-channel-controller-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-heartbeats-receiver-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-test-wathola-receiver-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-appender-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-test-request-sender-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-schema-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-apiserver-receive-adapter-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-test-print-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-channel-dispatcher-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-test-eventshub-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-heartbeats-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-mtping-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-test-wathola-sender-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-test-wathola-fetcher-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest enting-test-event-sender-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest kn-eventing-filter-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest kn-eventing-migrate-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest kn-eventing-controller-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest kn-eventing-apiserver-receive-adapter-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest kn-eventing-ingress-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest kn-eventing-jobsink-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest kn-eventing-channel-controller-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest kn-eventing-channel-dispatcher-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest kn-eventing-mtchannel-broker-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest kn-eventing-webhook-116-on-push branch:release-v1.16

@pierDipi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/retest kn-eventing-webhook-116-on-push branch:release-v1.16

Please sign in to comment.