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

Bootstrap drclusterconfig #1475

Merged
merged 9 commits into from
Jul 19, 2024

Conversation

ShyamsundarR
Copy link
Member

@ShyamsundarR ShyamsundarR commented Jun 25, 2024

This implements #1408

TODO:

@ShyamsundarR ShyamsundarR force-pushed the bootstrap-drclusterconfig branch 6 times, most recently from 529bce3 to 7229837 Compare July 1, 2024 22:28
Scaffolded using: operator_sdk create api
Followed by,
- make generate
- make manifests

Followed by,
- corrections to generated code in main.go
- additions of required CRDs and roles to the ramen dr-cluster bundle

Signed-off-by: Shyamsundar Ranganathan <srangana@redhat.com>
The fields are as follows:
spec.replicationSchedules:
Is a list of schedule intervals that are required to be provided
by the storage consumers of this resource.

spec.clusterID
Would carry the ManagedCluster identity from the ManagedCluster claim
value for `id.k8s.io`

spec.PeerClusters []clusterID is currently left as a TODO, to be
picked up as the need arises.

Signed-off-by: Shyamsundar Ranganathan <srangana@redhat.com>
Signed-off-by: Shyamsundar Ranganathan <srangana@redhat.com>
Also, adjust envtests to accomodate for one more manifest work creation
and also as required marking the manifest work as applied.

In addition to the above, reordered DRCluster processCreateOrUpdate in a
manner that addresses processing fencing first and then later other
checks, and maintenance mode last. This is to reflect DRCluster validation
correctly, and perform certain checks early and some later.

Signed-off-by: Shyamsundar Ranganathan <srangana@redhat.com>
As we need to update DRClusterConfig for the cluster if there are
newer schedules added/removed. This requires reconciling DRCluster
when a DRPolicy resource is created/updated/deleted.

Signed-off-by: Shyamsundar Ranganathan <srangana@redhat.com>
Also, add required client arguments, such that this can be reused
across various envs and tests run in those envs.

Signed-off-by: Shyamsundar Ranganathan <srangana@redhat.com>
With varying ManagedCluster resource status and conditions

Signed-off-by: Shyamsundar Ranganathan <srangana@redhat.com>
Added a more genric version of extracting a manifest from
a ManifestWork to inspect its contents.

Signed-off-by: Shyamsundar Ranganathan <srangana@redhat.com>
Signed-off-by: Shyamsundar Ranganathan <srangana@redhat.com>

// DRClusterConfig is the Schema for the drclusterconfigs API
//
//nolint:maligned
Copy link
Member

Choose a reason for hiding this comment

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

is this line required?

Copy link
Member Author

Choose a reason for hiding this comment

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

As status is empty at present, the linter does not like the structure alignment. nolint added till there are elements in status, at which point this can be removed.

@ShyamsundarR ShyamsundarR merged commit ba50c97 into RamenDR:main Jul 19, 2024
16 checks passed
@ShyamsundarR ShyamsundarR deleted the bootstrap-drclusterconfig branch July 19, 2024 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants