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/27 22:24:32 UTC

[GitHub] [camel-k] valdar opened a new pull request, #4168: fix #4167 : Default integrationPlatform created at operator startup dose not honor OPERATOR_ID config

valdar opened a new pull request, #4168:
URL: https://github.com/apache/camel-k/pull/4168

   <!-- Description -->
   Fix #4167, if OPERATOR_ID configuration is used, the default `integrationPlatform` is now created with the correct annotation `camel.apache.org/operator.id: $OPERATOR_ID`.
   
   
   
   <!--
   Enter your extended release note in the below block. If the PR requires
   additional action from users switching to the new release, include the string
   "action required". If no release note is required, write "NONE". 
   
   You can (optionally) mark this PR with labels "kind/bug" or "kind/feature" to make sure
   the text is added to the right section of the release notes. 
   -->
   
   **Release Note**
   ```release-note
   NONE
   ```
   


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


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

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez merged PR #4168:
URL: https://github.com/apache/camel-k/pull/4168


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


[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

Posted by "squakez (via GitHub)" <gi...@apache.org>.
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


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

Posted by "christophd (via GitHub)" <gi...@apache.org>.
christophd commented on code in PR #4168:
URL: https://github.com/apache/camel-k/pull/4168#discussion_r1150133673


##########
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:
   This sets an annotation, before this has been set as a label. I have no idea what implications this change will have



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


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

Posted by "valdar (via GitHub)" <gi...@apache.org>.
valdar commented on PR #4168:
URL: https://github.com/apache/camel-k/pull/4168#issuecomment-1486691775

   > @valdar please consider if it makes sense to backport to 1.12 and 1.10 LTS as well.
   
   I think it does, will do that.


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


[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

Posted by "valdar (via GitHub)" <gi...@apache.org>.
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


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

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on PR #4168:
URL: https://github.com/apache/camel-k/pull/4168#issuecomment-1486493330

   @valdar please consider if it makes sense to backport to 1.12 and 1.10 LTS as well.


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


[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

Posted by "valdar (via GitHub)" <gi...@apache.org>.
valdar commented on code in PR #4168:
URL: https://github.com/apache/camel-k/pull/4168#discussion_r1150194324


##########
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:
   Reverted to 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


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

Posted by "christophd (via GitHub)" <gi...@apache.org>.
christophd commented on PR #4168:
URL: https://github.com/apache/camel-k/pull/4168#issuecomment-1486501764

   +1 on backporting to 1.12 and 1.10


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