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

Initial LvmCluster controller #12

Merged
merged 4 commits into from
Dec 8, 2021
Merged

Initial LvmCluster controller #12

merged 4 commits into from
Dec 8, 2021

Conversation

nbalacha
Copy link
Contributor

@nbalacha nbalacha commented Dec 8, 2021

Initial LvmCluster controller implementation and tests.


// ready describes if the LvmCluster is ready.
// +optional
Ready bool `json:"ready,omitempty"`
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 a placeholder field in the status. We will probably end up removing this.

Copy link
Contributor

@leelavg leelavg left a comment

Choose a reason for hiding this comment

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

minor comment, lgtm.

Comment on lines 29 to 30
"CSI_ATTACHER_IMAGE": "k8s.gcr.io/sig-storage/csi-attacher:v3.3.0",
"CSI_SNAPSHOTTER_IMAGE": "k8s.gcr.io/sig-storage/csi-snapshotter:v4.2.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

  • we'll never need attacher and snapshotter isn't being used as of now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The topolvm makefile is using the csi attacher which is why I added it:

NODE_DRIVER_REGISTRAR_SRC = $(SRC_ROOT)/node-driver-registrar
EXTERNAL_ATTACHER_SRC     = $(SRC_ROOT)/external-attacher
EXTERNAL_RESIZER_SRC      = $(SRC_ROOT)/external-resizer
LIVENESSPROBE_SRC         = $(SRC_ROOT)/livenessprobe```

Copy link
Contributor Author

@nbalacha nbalacha Dec 8, 2021

Choose a reason for hiding this comment

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

But I forgot to add the liveness probe.
I can remove the snapshotter image. Should I do this in a separate PR or update this?

Copy link
Contributor

@leelavg leelavg Dec 8, 2021

Choose a reason for hiding this comment

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

- there's no separate liveness probe iirc, same hypertopolvm handles that

  • you are correct

Copy link
Contributor

Choose a reason for hiding this comment

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

@nbalacha

  1. pls add the liveness probe
  2. attacher can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@leelavg leelavg left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Contributor

@sp98 sp98 left a comment

Choose a reason for hiding this comment

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

nit

)

var (
DefaultValMap = map[string]string{
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
DefaultValMap = map[string]string{
defaultValMap = map[string]string{

Looks like it won't be used outside this package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

}
instance.ObjectMeta.Finalizers = remove(instance.ObjectMeta.Finalizers, lvmClusterFinalizer)
if err := r.Client.Update(context.TODO(), instance); err != nil {
r.Log.Info("Failed to remove finalizer from LvmCLuster", "LvmCluster", instance.Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
r.Log.Info("Failed to remove finalizer from LvmCLuster", "LvmCluster", instance.Name)
r.Log.Info("failed to remove finalizer from LvmCLuster", "LvmCluster", instance.Name)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

r.Log.Info("Finalizer not found for LvmCluster. Adding finalizer.", "LvmCluster", instance.Name)
instance.ObjectMeta.Finalizers = append(instance.ObjectMeta.Finalizers, lvmClusterFinalizer)
if err := r.Client.Update(context.TODO(), instance); err != nil {
r.Log.Info("Failed to update LvmCluster with finalizer.", "LvmCluster", instance.Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
r.Log.Info("Failed to update LvmCluster with finalizer.", "LvmCluster", instance.Name)
r.Log.Info("failed to update LvmCluster with finalizer.", "LvmCluster", instance.Name)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

This commit adds a status.ready field in order to create basic
operator functionality.

Signed-off-by: N Balachandran <[email protected]>
This commit updates the crd with the api changes made earlier.

Signed-off-by: N Balachandran <[email protected]>
Adds the initial reconcile logic for the lvmcluster controller.

Signed-off-by: N Balachandran <[email protected]>
Adds a basic lvmcontroller test which can be extended as more
components are implemented.

Signed-off-by: N Balachandran <[email protected]>
@sp98
Copy link
Contributor

sp98 commented Dec 8, 2021

/lgtm

@nbalacha nbalacha merged commit 95dd6cf into openshift:main Dec 8, 2021
@nbalacha nbalacha deleted the lvm-controller branch March 22, 2022 15:12
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.

3 participants