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

update cma config reference #163

Conversation

haoqing0110
Copy link
Member

@haoqing0110 haoqing0110 commented Mar 17, 2023

this PR is to update the config reference in cma status, it is part of the implementation of rollout strategy

  • add manager generate default config references and install progression based on cma.spec.
  • add framework update spec hash of the config references in cma status.

Ref: open-cluster-management-io/ocm#114

@openshift-ci openshift-ci bot requested review from elgnay and qiujian16 March 17, 2023 09:08
@haoqing0110 haoqing0110 force-pushed the br_update-cma-status branch 3 times, most recently from b19eba6 to 71c618b Compare March 22, 2023 08:31
@haoqing0110 haoqing0110 force-pushed the br_update-cma-status branch from 71c618b to 618b77e Compare March 24, 2023 12:22
@haoqing0110 haoqing0110 force-pushed the br_update-cma-status branch from 618b77e to 5e78d6c Compare March 24, 2023 12:27
@haoqing0110 haoqing0110 force-pushed the br_update-cma-status branch 2 times, most recently from 9016b79 to 822dcab Compare March 28, 2023 08:46
@haoqing0110 haoqing0110 changed the title [wip] update cma status update cma status Mar 28, 2023
@haoqing0110 haoqing0110 changed the title update cma status update cma config reference Mar 28, 2023
Signed-off-by: haoqing0110 <[email protected]>

func getInstallConfigIndex(config addonapiv1alpha1.InstallConfigReference) string {
if config.DesiredConfig.Namespace != "" {
return fmt.Sprintf("%s/%s/%s/%s", config.Group, config.Resource, config.DesiredConfig.Namespace, config.DesiredConfig.Name)
Copy link
Member

Choose a reason for hiding this comment

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

i think the index for empty namespace could "foo/bar//name". This is still unique for each one, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, still unique for each one, to check if namespace is empty or not is to make it easy to use cache.DeletionHandlingMetaNamespaceKeyFunc(obj) to get above namespace/name or name I think.

Copy link
Member

Choose a reason for hiding this comment

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

to may understanding DeletionHandlingMetaNamespaceKeyFunc can also handle /name as name, the returned namespace is just empty

@haoqing0110 haoqing0110 force-pushed the br_update-cma-status branch 2 times, most recently from 37d1110 to 49073aa Compare March 31, 2023 04:41
@@ -171,13 +172,20 @@ func (a *addonManager) Start(ctx context.Context) error {
)

var addonConfigController factory.Controller
var managementAddonConfigController factory.Controller
if len(a.addonConfigs) != 0 {
addonConfigController = addonconfig.NewAddonConfigController(
Copy link
Member

Choose a reason for hiding this comment

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

do we still need to keep this controller if addon manager is enabled?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, the addonConfigController is responsible to update spec hash for mca.spec.configs when addon manager is enabled.

Signed-off-by: haoqing0110 <[email protected]>
@haoqing0110 haoqing0110 force-pushed the br_update-cma-status branch from 49073aa to 2c060bc Compare March 31, 2023 09:07
@qiujian16
Copy link
Member

/approve
/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 3, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haoqing0110, qiujian16

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 Apr 3, 2023
@openshift-merge-robot openshift-merge-robot merged commit 549a399 into open-cluster-management-io:main Apr 3, 2023
@haoqing0110 haoqing0110 deleted the br_update-cma-status branch April 3, 2023 01:44
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.

3 participants