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

Don't override ports for KafkaChannel's service #3045

Merged
merged 1 commit into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
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
7 changes: 2 additions & 5 deletions control-plane/pkg/reconciler/channel/resources/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,8 @@ func MakeChannelServiceName(name string) string {
// pointing to the specified service in a namespace.
func ExternalService(namespace, service string) ServiceOption {
return func(svc *corev1.Service) error {
// TODO this overrides the current serviceSpec. Is this correct?
Copy link
Member Author

Choose a reason for hiding this comment

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

It was already identified as wrong but then left there as TODO

svc.Spec = corev1.ServiceSpec{
Type: corev1.ServiceTypeExternalName,
ExternalName: network.GetServiceHostname(service, namespace),
}
svc.Spec.Type = corev1.ServiceTypeExternalName
svc.Spec.ExternalName = network.GetServiceHostname(service, namespace)
return nil
}
}
Expand Down
12 changes: 10 additions & 2 deletions control-plane/pkg/reconciler/testing/objects_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
clientgotesting "k8s.io/client-go/testing"
"k8s.io/utils/pointer"
messagingv1beta1 "knative.dev/eventing-kafka-broker/control-plane/pkg/apis/messaging/v1beta1"
"knative.dev/eventing-kafka-broker/control-plane/pkg/reconciler/channel/resources"
eventingduckv1 "knative.dev/eventing/pkg/apis/duck/v1"
v1 "knative.dev/eventing/pkg/apis/messaging/v1"
"knative.dev/pkg/apis"
duckv1 "knative.dev/pkg/apis/duck/v1"
"knative.dev/pkg/network"

messagingv1beta1 "knative.dev/eventing-kafka-broker/control-plane/pkg/apis/messaging/v1beta1"
"knative.dev/eventing-kafka-broker/control-plane/pkg/reconciler/channel/resources"

"knative.dev/eventing-kafka-broker/control-plane/pkg/config"
"knative.dev/eventing-kafka-broker/control-plane/pkg/contract"
"knative.dev/eventing-kafka-broker/control-plane/pkg/kafka"
Expand Down Expand Up @@ -352,6 +353,13 @@ func NewPerChannelService(env *config.Env) *corev1.Service {
Spec: corev1.ServiceSpec{
Type: corev1.ServiceTypeExternalName,
ExternalName: network.GetServiceHostname(env.IngressName, env.SystemNamespace),
Ports: []corev1.ServicePort{
{
Name: "http",
Protocol: corev1.ProtocolTCP,
Port: 80,
},
},
},
}

Expand Down
Loading