-
Notifications
You must be signed in to change notification settings - Fork 40
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
Conversation
|
||
// ready describes if the LvmCluster is ready. | ||
// +optional | ||
Ready bool `json:"ready,omitempty"` |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comment, lgtm.
controllers/defaults.go
Outdated
"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", |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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```
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
controllers/defaults.go
Outdated
) | ||
|
||
var ( | ||
DefaultValMap = map[string]string{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DefaultValMap = map[string]string{ | |
defaultValMap = map[string]string{ |
Looks like it won't be used outside this package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
controllers/lvmcluster_controller.go
Outdated
} | ||
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r.Log.Info("Failed to remove finalizer from LvmCLuster", "LvmCluster", instance.Name) | |
r.Log.Info("failed to remove finalizer from LvmCLuster", "LvmCluster", instance.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
controllers/lvmcluster_controller.go
Outdated
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r.Log.Info("Failed to update LvmCluster with finalizer.", "LvmCluster", instance.Name) | |
r.Log.Info("failed to update LvmCluster with finalizer.", "LvmCluster", instance.Name) |
There was a problem hiding this comment.
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]>
/lgtm |
Initial LvmCluster controller implementation and tests.