Skip to content
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

Conversation

zhujian7
Copy link
Member

@zhujian7 zhujian7 commented Sep 5, 2023

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.

@zhujian7 zhujian7 force-pushed the install-namespace branch 3 times, most recently from f8c4679 to fbdf32e Compare September 5, 2023 12:32
@zhujian7
Copy link
Member Author

zhujian7 commented Sep 5, 2023

/cc @qiujian16

@zhujian7 zhujian7 force-pushed the install-namespace branch 2 times, most recently from fbdf32e to c2e3422 Compare September 5, 2023 14:36
}
}

// GetDesiredAddOnDeployment returns the desired template of the addon
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// GetDesiredAddOnDeployment returns the desired template of the addon
// GetDesiredAddOnDeployment returns the desired addonDeploymentConfig of the addon

)

func AgentInstallNamespaceFromDeploymentConfig(
adcgetter func(ctx context.Context, namespace, name string) (*addonapiv1alpha1.AddOnDeploymentConfig, error),
Copy link
Member

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?

@@ -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(
Copy link
Member

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

@zhujian7 zhujian7 force-pushed the install-namespace branch 2 times, most recently from 6ba3ee2 to 171db9a Compare September 6, 2023 03:42
…oyment config

Signed-off-by: zhujian <jiazhu@redhat.com>
Copy link
Member

@qiujian16 qiujian16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 6, 2023

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Sep 6, 2023
@openshift-merge-robot openshift-merge-robot merged commit 5497e73 into open-cluster-management-io:main Sep 6, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants