Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GetServiceHostname when passing URL to JobSink #8303

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions test/rekt/features/jobsink/jobsink.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
"knative.dev/pkg/apis"
kubeclient "knative.dev/pkg/client/injection/kube/client"
"knative.dev/pkg/network"
"knative.dev/reconciler-test/pkg/environment"
"knative.dev/reconciler-test/pkg/eventshub"
"knative.dev/reconciler-test/pkg/eventshub/assert"
Expand All @@ -49,13 +50,17 @@ func Success() *feature.Feature {
jobSink := feature.MakeRandomK8sName("jobsink")
source := feature.MakeRandomK8sName("source")

sinkURL := &apis.URL{Scheme: "http", Host: sink}

event := cetest.FullEvent()
event.SetID(uuid.NewString())

f.Setup("install forwarder sink", eventshub.Install(sink, eventshub.StartReceiver))
f.Setup("install job sink", jobsink.Install(jobSink, jobsink.WithForwarderJob(sinkURL.String())))
f.Setup("install job sink", func(ctx context.Context, t feature.T) {
sinkURL := &apis.URL{
Scheme: "http",
Host: network.GetServiceHostname(sink, environment.FromContext(ctx).Namespace()),
}
jobsink.Install(jobSink, jobsink.WithForwarderJob(sinkURL.String()))(ctx, t)
})

f.Setup("jobsink is addressable", jobsink.IsAddressable(jobSink))
f.Setup("jobsink is ready", jobsink.IsReady(jobSink))
Expand Down
Loading