You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "valdar (via GitHub)" <gi...@apache.org> on 2023/03/28 08:03:04 UTC

[GitHub] [camel-k] valdar commented on a diff in pull request #4168: fix #4167 : Default integrationPlatform created at operator startup dose not honor OPERATOR_ID config

valdar commented on code in PR #4168:
URL: https://github.com/apache/camel-k/pull/4168#discussion_r1150188976


##########
pkg/cmd/operator/operator.go:
##########
@@ -243,19 +242,20 @@ func Run(healthPort, monitoringPort int32, leaderElection bool, leaderElectionID
 
 // findOrCreateIntegrationPlatform create default integration platform in operator namespace if not already exists.
 func findOrCreateIntegrationPlatform(ctx context.Context, c client.Client, operatorNamespace string) error {
+	operatorID := defaults.OperatorID()
 	var platformName string
-	if defaults.OperatorID() != "" {
-		platformName = defaults.OperatorID()
+	if operatorID != "" {
+		platformName = operatorID
 	} else {
 		platformName = platform.DefaultPlatformName
 	}
 
 	if pl, err := kubernetes.GetIntegrationPlatform(ctx, c, platformName, operatorNamespace); pl == nil || k8serrors.IsNotFound(err) {
 		defaultPlatform := v1.NewIntegrationPlatform(operatorNamespace, platformName)
-		if defaultPlatform.Labels == nil {
-			defaultPlatform.Labels = make(map[string]string)
+		v1.SetAnnotation(&defaultPlatform.ObjectMeta, "camel.apache.org/platform.generated", "true")

Review Comment:
   Changed back to be a label.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org