Skip to content

Commit

Permalink
fix(#5706): removing trait prefix from condition type
Browse files Browse the repository at this point in the history
  • Loading branch information
lsergio committed Jul 26, 2024
1 parent 26d43fd commit 83eec6c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkg/trait/trait_condition_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.traitTypeForCondition()),
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.traitTypeForCondition()),
tc.conditionStatus,
tc.reason,
tc.message
}

func (tc *TraitCondition) traitTypeForCondition() string {
conditionType := string(tc.integrationConditionType)
if conditionType == "TraitInfo" {
conditionType = fmt.Sprintf("%s%s", tc.traitID, tc.integrationConditionType)
}
return conditionType
}

0 comments on commit 83eec6c

Please sign in to comment.