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

✨ Install GH into a brownfield #1319

Merged
merged 3 commits into from
Jan 10, 2025
Merged

Conversation

clyang82
Copy link
Contributor

@clyang82 clyang82 commented Jan 8, 2025

Summary

InstallAgentOnHub determines whether deploy the Global Hub Agent on hub cluster.
If set to true, the Global Hub Agent will be installed on the hub cluster only.
If set to false, the Global Hub Agent will not be installed on the hub cluster.
Currently, switching the value of this field is not supported after the Global Hub is installed.

Related issue(s)

Fixes # https://issues.redhat.com/browse/ACM-15099

Tests

  • Unit/function tests have been added and incorporated into make unit-tests.
  • Integration tests have been added and incorporated into make integration-test.
  • E2E tests have been added and incorporated into make e2e-test-all.
  • List other manual tests you have done.
  • tested deploy the agent into local-cluster
  • tested deploy the agent into hub cluster which has local-cluster="true" label

Signed-off-by: clyang82 <[email protected]>
@clyang82
Copy link
Contributor Author

clyang82 commented Jan 9, 2025

/assign @yanmxa @ldpliu

@clyang82 clyang82 requested a review from ldpliu January 9, 2025 08:36
@@ -107,6 +107,13 @@ type MulticlusterGlobalHubSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
// +optional
EnableMetrics bool `json:"enableMetrics"`
// InstallAgentOnHub determines whether deploy the Global Hub Agent on hub cluster.
Copy link
Member

@yanmxa yanmxa Jan 10, 2025

Choose a reason for hiding this comment

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

Since the global hub involves different hubs - global hub, managed hub.

  1. "on hub cluster" -> "on global hub cluster"?
  2. "on hub cluster" -> "on local hub cluster"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rename to InstallAgentOnLocal

// InstallAgentOnHub determines whether deploy the Global Hub Agent on hub cluster.
// If set to true, the Global Hub Agent will be installed on the hub cluster only.
// If set to false, the Global Hub Agent will not be installed on the hub cluster.
// Currently, switching the value of this field is not supported after the Global Hub is installed.
Copy link
Member

Choose a reason for hiding this comment

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

That means that value should be set when creating the instance. After creating, it won't support being updated.
If so, we should clarify the value is immutable and add validation for this logic

Copy link
Member

@yanmxa yanmxa Jan 10, 2025

Choose a reason for hiding this comment

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

If there is no validation here, the desired and actual status will not be consistent after the user updates it

https://kubernetes.io/blog/2022/09/29/enforce-immutability-using-cel/#immutablility-after-first-modification

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just an initial version. Based on my understanding, we do not support switching the value right now. but we may support later.

Copy link
Member

Choose a reason for hiding this comment

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

Okay, Could you log a Jira issue(or GitHub issue), I'm concerned we might overlook it in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#1321 log this github issue to trace. Thanks.

@yanmxa
Copy link
Member

yanmxa commented Jan 10, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jan 10, 2025
Copy link

openshift-ci bot commented Jan 10, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: clyang82, yanmxa

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

@clyang82 clyang82 merged commit 6a6732c into stolostron:main Jan 10, 2025
10 of 12 checks passed
@clyang82 clyang82 deleted the brown_field branch January 10, 2025 06:49
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.

2 participants