diff --git a/operator/pkg/controllers/addon/addon_controller.go b/operator/pkg/controllers/addon/addon_controller.go index 2f62f52c8..c6ed37b9b 100644 --- a/operator/pkg/controllers/addon/addon_controller.go +++ b/operator/pkg/controllers/addon/addon_controller.go @@ -123,7 +123,7 @@ func (a *AddonController) Start(ctx context.Context) error { )). WithScheme(addonScheme) if config.TransporterProtocol() == transport.StrimziTransporter { - factory.WithAgentRegistrationOption(newRegistrationOption(operatorconstants.GHManagedClusterAddonName)) + factory.WithAgentRegistrationOption(newRegistrationOption()) } agentAddon, err := factory.BuildTemplateAgentAddon() if err != nil { @@ -145,7 +145,7 @@ func (a *AddonController) AddonManager() addonmanager.AddonManager { return a.addonManager } -func newRegistrationOption(addonName string) *agent.RegistrationOption { +func newRegistrationOption() *agent.RegistrationOption { return &agent.RegistrationOption{ CSRConfigurations: certificates.SignerAndCsrConfigurations, CSRApproveCheck: certificates.Approve, diff --git a/operator/pkg/controllers/addon/addon_controller_manifests.go b/operator/pkg/controllers/addon/addon_controller_manifests.go index 20dbf9ba6..ba537e9e7 100644 --- a/operator/pkg/controllers/addon/addon_controller_manifests.go +++ b/operator/pkg/controllers/addon/addon_controller_manifests.go @@ -24,7 +24,6 @@ import ( globalhubv1alpha4 "github.com/stolostron/multicluster-global-hub/operator/api/operator/v1alpha4" "github.com/stolostron/multicluster-global-hub/operator/pkg/config" operatorconstants "github.com/stolostron/multicluster-global-hub/operator/pkg/constants" - "github.com/stolostron/multicluster-global-hub/operator/pkg/controllers/addon/certificates" "github.com/stolostron/multicluster-global-hub/operator/pkg/utils" "github.com/stolostron/multicluster-global-hub/pkg/constants" "github.com/stolostron/multicluster-global-hub/pkg/transport" @@ -238,7 +237,7 @@ func (a *HohAgentAddon) GetValues(cluster *clusterv1.ManagedCluster, KafkaCACert: kafkaConnection.CACert, KafkaClientCert: kafkaConnection.ClientCert, KafkaClientKey: kafkaConnection.ClientKey, - KafkaClientCertSecret: certificates.AgentCertificateSecretName(), + KafkaClientCertSecret: kafkaConnection.ClientSecretName, KafkaClusterCASecret: kafkaConnection.CASecretName, KafkaConsumerTopic: clusterTopic.SpecTopic, KafkaProducerTopic: clusterTopic.StatusTopic, diff --git a/operator/pkg/controllers/addon/manifests/templates/agent/multicluster-global-hub-agent-deployment.yaml b/operator/pkg/controllers/addon/manifests/templates/agent/multicluster-global-hub-agent-deployment.yaml index 6bf9f9dcc..0430d687c 100644 --- a/operator/pkg/controllers/addon/manifests/templates/agent/multicluster-global-hub-agent-deployment.yaml +++ b/operator/pkg/controllers/addon/manifests/templates/agent/multicluster-global-hub-agent-deployment.yaml @@ -94,7 +94,7 @@ spec: volumes: - name: kafka-cluster-ca secret: - secretName: kafka-cluster-ca-cert + secretName: {{.KafkaClusterCASecret}} - name: kafka-client-certs secret: secretName: {{.KafkaClientCertSecret}} diff --git a/operator/pkg/controllers/addon/manifests/templates/agent/multicluster-global-hub-agent-kafka-certs-secret.yaml b/operator/pkg/controllers/addon/manifests/templates/agent/multicluster-global-hub-agent-kafka-certs-secret.yaml index a223796eb..cea4b5fd6 100644 --- a/operator/pkg/controllers/addon/manifests/templates/agent/multicluster-global-hub-agent-kafka-certs-secret.yaml +++ b/operator/pkg/controllers/addon/manifests/templates/agent/multicluster-global-hub-agent-kafka-certs-secret.yaml @@ -2,13 +2,12 @@ apiVersion: v1 kind: Secret metadata: - name: kafka-certs-secret + name: {{.KafkaClientCertSecret}} namespace: {{ .AddonInstallNamespace }} labels: addon.open-cluster-management.io/hosted-manifest-location: none type: Opaque data: - "ca.crt": "{{.KafkaCACert}}" - "client.crt": "{{.KafkaClientCert}}" - "client.key": "{{.KafkaClientKey}}" + "tls.crt": "{{.KafkaClientCert}}" + "tls.key": "{{.KafkaClientKey}}" {{- end -}} diff --git a/operator/pkg/controllers/hubofhubs/transporter/protocol/byo_transporter.go b/operator/pkg/controllers/hubofhubs/transporter/protocol/byo_transporter.go index 6e773be4c..3af86adeb 100644 --- a/operator/pkg/controllers/hubofhubs/transporter/protocol/byo_transporter.go +++ b/operator/pkg/controllers/hubofhubs/transporter/protocol/byo_transporter.go @@ -76,5 +76,8 @@ func (s *BYOTransporter) GetConnCredential(clusterName string) (*transport.Kafka // for the byo case, the status topic isn't change by the clusterName StatusTopic: config.GetStatusTopic(""), SpecTopic: config.GetSpecTopic(), + // temporarily to fix the blocker. they should be removed after get the kafka configurations from a secret + CASecretName: "kafka-cluster-ca-cert", + ClientSecretName: "kafka-certs-secret", }, nil }