-
Notifications
You must be signed in to change notification settings - Fork 40
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 a helper func for setting agent install namespace from addon deployment config #205
add a helper func for setting agent install namespace from addon deployment config #205
Conversation
f8c4679
to
fbdf32e
Compare
/cc @qiujian16 |
fbdf32e
to
c2e3422
Compare
pkg/utils/namespace.go
Outdated
} | ||
} | ||
|
||
// GetDesiredAddOnDeployment returns the desired template of the addon |
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.
// GetDesiredAddOnDeployment returns the desired template of the addon | |
// GetDesiredAddOnDeployment returns the desired addonDeploymentConfig of the addon |
pkg/utils/namespace.go
Outdated
) | ||
|
||
func AgentInstallNamespaceFromDeploymentConfig( | ||
adcgetter func(ctx context.Context, namespace, name string) (*addonapiv1alpha1.AddOnDeploymentConfig, error), |
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.
think this one is supposed to be used in a controller to update status on addon?
How about we have a func to sync namespace in config to addon.status?
cmd/example/helloworld/main.go
Outdated
@@ -93,6 +93,11 @@ func runController(ctx context.Context, kubeConfig *rest.Config) error { | |||
utilrand.String(5), | |||
) | |||
|
|||
// Set agent install namespace from addon deployment config if it exists | |||
registrationOption.AgentInstallNamespace = utils.AgentInstallNamespaceFromDeploymentConfig( |
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 do not think we should only set during start
6ba3ee2
to
171db9a
Compare
…oyment config Signed-off-by: zhujian <jiazhu@redhat.com>
171db9a
to
f818755
Compare
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.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qiujian16, zhujian7 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
5497e73
into
open-cluster-management-io:main
Add a helper func for setting the
registrationOption.AgentInstallNamespace
, This helper func will try to get the namespace from the addon deployment config. If the addon does not support addon deployment config or there is no matched addon deployment config, it will return an empty string.