-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add recommendation rule controller #427
Conversation
🎉 Successfully Build Images. Overview: https://finops.coding.net/public-artifacts/gocrane/crane/packages
|
@@ -15,3 +15,9 @@ const ( | |||
AnalyticsUidLabel = "analysis.crane.io/analytics-uid" | |||
AnalyticsTypeLabel = "analysis.crane.io/analytics-type" | |||
) | |||
|
|||
const ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where we need those labels?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To know the recommendation from a RecommendationRule by label selector. for example kubectl crane
use it to get recommendation result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it.
pkg/controller/recommendation/recommendation_rule_controller.go
Outdated
Show resolved
Hide resolved
pkg/controller/recommendation/recommendation_rule_controller.go
Outdated
Show resolved
Hide resolved
mission.Message = fmt.Sprintf("Failed to get identity, key %s. ", k) | ||
return | ||
} else { | ||
recommendation := existingRecommendation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will implement the logic of this part. Can directly delete no use code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's convenience to keep it for refactor
if currMissions == nil { | ||
// create recommendation missions for this round | ||
for _, id := range identities { | ||
currMissions = append(currMissions, analysisv1alph1.RecommendationMission{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one mission for one recommendation rule or one object reference and one recommender?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one mission for one recommendation CR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, one mission for one object reference and one recommender.
/LGTM |
What type of PR is this?
Feature
What this PR does / why we need it:
Add recommendation rule controller
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer: