This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch release-2.3.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/release-2.3.x by this push:
new 30da189d6 fix(#5706): removing trait prefix from condition type
30da189d6 is described below
commit 30da189d692cbb24edfd3f3183580d36b850d556
Author: Luis Sergio Carneiro <[email protected]>
AuthorDate: Fri Jul 26 11:02:42 2024 -0300
fix(#5706): removing trait prefix from condition type
---
pkg/trait/trait_condition_types.go | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/pkg/trait/trait_condition_types.go
b/pkg/trait/trait_condition_types.go
index 86abc5ea2..f1febd59a 100644
--- a/pkg/trait/trait_condition_types.go
+++ b/pkg/trait/trait_condition_types.go
@@ -76,15 +76,23 @@ func
NewIntegrationConditionPlatformDisabledCatalogMissing() *TraitCondition {
}
func (tc *TraitCondition) integrationCondition() (v1.IntegrationConditionType,
corev1.ConditionStatus, string, string) {
- return v1.IntegrationConditionType(fmt.Sprintf("%s%s", tc.traitID,
tc.integrationConditionType)),
+ return v1.IntegrationConditionType(tc.typeForCondition()),
tc.conditionStatus,
tc.reason,
tc.message
}
func (tc *TraitCondition) integrationKitCondition()
(v1.IntegrationKitConditionType, corev1.ConditionStatus, string, string) {
- return v1.IntegrationKitConditionType(fmt.Sprintf("%s%s", tc.traitID,
tc.integrationConditionType)),
+ return v1.IntegrationKitConditionType(tc.typeForCondition()),
tc.conditionStatus,
tc.reason,
tc.message
}
+
+func (tc *TraitCondition) typeForCondition() string {
+ conditionType := string(tc.integrationConditionType)
+ if conditionType == "TraitInfo" {
+ conditionType = fmt.Sprintf("%s%s", tc.traitID,
tc.integrationConditionType)
+ }
+ return conditionType
+}