Skip to content

Commit

Permalink
Add mergelabels (#35)
Browse files Browse the repository at this point in the history
Signed-off-by: raihankhan <[email protected]>
  • Loading branch information
raihankhan authored Feb 13, 2025
1 parent 3d63f09 commit 6ddbe55
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apis/supervisor/v1alpha1/recommendation_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ limitations under the License.

package v1alpha1

import meta_util "kmodules.xyz/client-go/meta"

func (r *Recommendation) IsAwaitingOrProgressingRecommendation() bool {
return r.IsAwaitingRecommendation() || r.IsProgressingRecommendation()
}
Expand All @@ -36,3 +38,7 @@ func (r *Recommendation) IsAwaitingRecommendation() bool {
func (r *Recommendation) IsProgressingRecommendation() bool {
return r.Status.Phase == InProgress
}

func (r *Recommendation) MergeWithOffshootLabels(extraLabels ...map[string]string) map[string]string {
return meta_util.OverwriteKeys(r.GetLabels(), extraLabels...)
}

0 comments on commit 6ddbe55

Please sign in to comment.