-
Notifications
You must be signed in to change notification settings - Fork 386
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
Override recommder parameter with the config in RecommendationRule #648
Override recommder parameter with the config in RecommendationRule #648
Conversation
} | ||
|
||
// Override the default value with RecommendationConfiguration in configmap | ||
if err = SetRecommendationConfig(rr, recommender.Config); err != nil { |
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.
- merge recommender.Config and recommendationRule.Spec.Config first
- do other initialization steps
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.
- if the value in recommender.Config and recommendationRule.Spec.Config conflict, I will use the value of recommendationRule. Is that right?
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.
- if the value in recommender.Config and recommendationRule.Spec.Config conflict, I will use the value of recommendationRule. Is that right?
yes, recommendationRule.Spec.Config has the highest priority.
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.
also, api change PR should be merged first and use the newest api version in crane
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
181fe9a
to
f3177ff
Compare
gocrane/api#74 has merged, and you can run |
f3177ff
to
f905eb2
Compare
🎉 Successfully Build Images. Docker RegistryOverview: https://hub.docker.com/u/gocrane
Quick Deploy - Helm helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
--set craned.image.repository=gocrane/craned \
--set craned.image.tag=pr-648-f4c2ee1 \
--set metricAdapter.image.repository=gocrane/metric-adapter \
--set metricAdapter.image.tag=pr-648-f4c2ee1 \
--set craneAgent.image.repository=gocrane/crane-agent \
--set craneAgent.image.tag=pr-648-f4c2ee1 \
--set cranedDashboard.image.repository=gocrane/dashboard \
--set cranedDashboard.image.tag=pr-648-f4c2ee1 crane/crane Coding RegistryOverview: https://finops.coding.net/public-artifacts/gocrane/crane/packages
Quick Deploy - Helm helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
--set craned.image.repository=finops-docker.pkg.coding.net/gocrane/crane/craned \
--set craned.image.tag=pr-648-f4c2ee1 \
--set metricAdapter.image.repository=finops-docker.pkg.coding.net/gocrane/crane/metric-adapter \
--set metricAdapter.image.tag=pr-648-f4c2ee1 \
--set craneAgent.image.repository=finops-docker.pkg.coding.net/gocrane/crane/crane-agent \
--set craneAgent.image.tag=pr-648-f4c2ee1 \
--set cranedDashboard.image.repository=finops-docker.pkg.coding.net/gocrane/crane/dashboard \
--set cranedDashboard.image.tag=pr-648-f4c2ee1 crane/crane Ghcr RegistryOverview: https://github.com/orgs/gocrane/packages?repo_name=crane
Quick Deploy - Helm helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
--set craned.image.repository=ghcr.io/gocrane/crane/craned \
--set craned.image.tag=pr-648-f4c2ee1 \
--set metricAdapter.image.repository=ghcr.io/gocrane/crane/metric-adapter \
--set metricAdapter.image.tag=pr-648-f4c2ee1 \
--set craneAgent.image.repository=ghcr.io/gocrane/crane/crane-agent \
--set craneAgent.image.tag=pr-648-f4c2ee1 \
--set cranedDashboard.image.repository=ghcr.io/gocrane/crane/dashboard \
--set cranedDashboard.image.tag=pr-648-f4c2ee1 crane/crane |
@qmhu it's done. please check. |
@@ -21,10 +21,19 @@ func (inr *IdleNodeRecommender) Name() string { | |||
} | |||
|
|||
// NewIdleNodeRecommender create a new idle node recommender. | |||
func NewIdleNodeRecommender(recommender apis.Recommender) (*IdleNodeRecommender, error) { | |||
func NewIdleNodeRecommender(recommender apis.Recommender, recommendationRuleConfig map[string]string) (*IdleNodeRecommender, error) { | |||
if recommender.Config == nil { | |||
recommender.Config = map[string]string{} | |||
} |
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.
Could you extract these line into a common function?
/hold |
e655bba
to
f4c2ee1
Compare
What type of PR is this?
optimization
What this PR does / why we need it:
Override the RecommendationConfiguration in configmap and the default value with the config in RecommendationRule
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer: