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

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

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


##########
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:
   According to the checks nothing really changes. However, I think there could have been some reason why this was a Label instead of an annotation (maybe for external filtering?). If we do this change here we need to apply the same change in pkg/trait/platform.go in order to make consistent.



-- 
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