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 authored and squakez committed Jul 29, 2024
1 parent 54f6102 commit d126ceb
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.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
}

0 comments on commit d126ceb

Please sign in to comment.