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

MGMT-12426: Automatically register cluster with installed MCE #4673

Conversation

jhernand
Copy link
Contributor

@jhernand jhernand commented Nov 25, 2022

Add support for automatically registering the cluster as an MCE managed cluster.

Note that the MCE installation part in this patch is just a proof of concept, without configuration, without checking of requirements and without tests, only with the minimum required to verify that it is possible to register the cluster with MCE as part of the installation. That actual implementation will be part of AGENT-381.

Related: https://issues.redhat.com/browse/MGMT-12426
Related: https://issues.redhat.com/browse/AGENT-381
Related: https://access.redhat.com/documentation/en-us/red_hat_advanced_cluster_management_for_kubernetes/2.6/html-single/multicluster_engine/index

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Add support for automatically registering the cluster as an MCE managed
cluster.

Note that the MCE installation part in this patch is just a proof of
concept, without configuration, without checking of requirements and
without tests, only with the minimum required to verify that it is
possible to register the cluster with MCE as part of the installation.
That actual implementation will be part of AGENT-381.

Related: https://issues.redhat.com/browse/MGMT-12426
Related: https://issues.redhat.com/browse/AGENT-381
Related: https://access.redhat.com/documentation/en-us/red_hat_advanced_cluster_management_for_kubernetes/2.6/html-single/multicluster_engine/index
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
@openshift-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 25, 2022
@openshift-ci openshift-ci bot added the api-review Categorizes an issue or PR as actively needing an API review. label Nov 25, 2022
@openshift-ci
Copy link

openshift-ci bot commented Nov 25, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhernand

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 Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 25, 2022
@codecov
Copy link

codecov bot commented Nov 25, 2022

Codecov Report

Merging #4673 (a1e8ffe) into master (1dc6ea7) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4673      +/-   ##
==========================================
+ Coverage   67.02%   67.06%   +0.04%     
==========================================
  Files         200      200              
  Lines       28559    28585      +26     
==========================================
+ Hits        19141    19171      +30     
+ Misses       7679     7677       -2     
+ Partials     1739     1737       -2     
Impacted Files Coverage Δ
internal/cluster/statemachine.go 100.00% <100.00%> (ø)
internal/cluster/validation_id.go 92.30% <100.00%> (ø)
internal/host/statemachine.go 100.00% <100.00%> (ø)
internal/host/validation_id.go 90.90% <100.00%> (ø)
internal/operators/builder.go 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

@jhernand jhernand marked this pull request as draft November 28, 2022 11:10
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 28, 2022
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 29, 2022
@openshift-merge-robot
Copy link

@jhernand: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@@ -32,7 +33,18 @@ type Options struct {

// NewManager creates new instance of an Operator Manager
func NewManager(log logrus.FieldLogger, manifestAPI manifestsapi.ManifestsAPI, options Options, objectHandler s3wrapper.API, extracter oc.Extracter) *Manager {
return NewManagerWithOperators(log, manifestAPI, options, objectHandler, lso.NewLSOperator(), odf.NewOcsOperator(log), odf.NewOdfOperator(log, extracter), cnv.NewCNVOperator(log, options.CNVConfig, extracter), lvm.NewLvmOperator(log, extracter))
return NewManagerWithOperators(
Copy link
Contributor

Choose a reason for hiding this comment

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

seeing how this function is getting bigger and bigger maybe we should consider having a struct parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is a variadic function, with only five parameters:

func NewManagerWithOperators(log logrus.FieldLogger, manifestAPI manifestsapi.ManifestsAPI, options Options, objectHandler s3wrapper.API, olmOperators ...api.Operator) *Manager {

Anyhow I'd say that more than three parameters is probably too many. No objection to introduce a struct parameter or some other mechanism.

@@ -0,0 +1,4 @@
package mce

type Config struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

why is it needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really needed. Other operators have some fields and I wanted to preserve the pattern in case we want to add something.

danielerez added a commit to danielerez/assisted-service that referenced this pull request Jan 29, 2023
This PR introduces an MCE operator that can be deployed
as part of a cluster installation. The operator is depended
on the LVM operator, I.e. LVMS is also deployed during
cluster installation.

The suggested flow here is just for demonstration purposes
to illustrate the simplicity of using LVMS as a local
persistent storage solution for an effort[1] of a new MCE operator.
So we have just the basic flow here without validations/tests/etc,
as inspired by the original PR[2] :)

Note: LVMS is currently limited for SNO, this PR[3]
is removing that limitation to support mulit-node
clusters as well.

[1] https://issues.redhat.com/browse/MGMT-12186
[2] openshift#4673
[3] openshift#4936
danielerez added a commit to danielerez/assisted-service that referenced this pull request Jan 29, 2023
This PR introduces an MCE operator that can be deployed
as part of a cluster installation. The operator is depended
on the LVM operator, I.e. LVMS is also deployed during
cluster installation.

The suggested flow here is just for demonstration purposes
to illustrate the simplicity of using LVMS as a local
persistent storage solution for an effort[1] of a new MCE operator.
So we have just the basic flow here without validations/tests/etc,
as inspired by the original PR[2] :)

Note: LVMS is currently limited for SNO, this PR[3]
is removing that limitation to support multi-node
clusters as well.

[1] https://issues.redhat.com/browse/MGMT-12186
[2] openshift#4673
[3] openshift#4936
@openshift-ci
Copy link

openshift-ci bot commented Apr 24, 2023

@jhernand: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/edge-e2e-ai-operator-ztp-hypershift-zero-nodes a1e8ffe link false /test edge-e2e-ai-operator-ztp-hypershift-zero-nodes
ci/prow/edge-subsystem-aws a1e8ffe link true /test edge-subsystem-aws
ci/prow/edge-unit-test a1e8ffe link true /test edge-unit-test
ci/prow/e2e-agent-compact a1e8ffe link true /test e2e-agent-compact
ci/prow/e2e-agent-compact-ipv4 a1e8ffe link true /test e2e-agent-compact-ipv4

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@filanov
Copy link
Contributor

filanov commented May 30, 2023

@jhernand looks like an old PR, closing, feel free to reopen if needed

@filanov filanov closed this May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants