-
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
feat: adds status information to the LVMCluster CR #76
Conversation
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
api/v1alpha1/lvmcluster_types.go
Outdated
DeviceClassStatuses []DeviceClassStatus `json:"deviceClassStatuses,omitempty"` | ||
} | ||
|
||
// VGNodeStatus defines the observed status of the VG across all nodes |
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.
// VGNodeStatus defines the observed status of the VG across all nodes | |
// DeviceClassStatus defines the observed status of the VG across all nodes |
api/v1alpha1/lvmcluster_types.go
Outdated
|
||
// VGNodeStatus defines the observed status of the VG across all nodes | ||
type DeviceClassStatus struct { | ||
// Name is the name of the VG |
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 might cause confusion between VG
and DeviceClass
. I think we should use either VG
or DeviceClass
api/v1alpha1/lvmcluster_types.go
Outdated
type DeviceClassStatus struct { | ||
// Name is the name of the VG | ||
Name string `json:"name,omitempty"` | ||
// Status tells if the VG was created on the node |
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.
// Status tells if the VG was created on the node | |
// NodeStatus tells if the VG was created on the node |
controllers/lvmcluster_controller.go
Outdated
@@ -197,6 +197,53 @@ func (r *LVMClusterReconciler) reconcile(ctx context.Context, instance *lvmv1alp | |||
return ctrl.Result{}, nil | |||
} | |||
|
|||
func (r *LVMClusterReconciler) updateLVMClusterStatus(ctx context.Context, instance *lvmv1alpha1.LVMCluster) error { | |||
|
|||
vgnodemap := make(map[string][]lvmv1alpha1.NodeStatus) |
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.
vgnodemap := make(map[string][]lvmv1alpha1.NodeStatus) | |
vgNodeMap := make(map[string][]lvmv1alpha1.NodeStatus) |
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
return err | ||
} | ||
|
||
for _, nodeitem := range vgNodeStatusList.Items { |
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.
for _, nodeitem := range vgNodeStatusList.Items { | |
for _, nodeItem := range vgNodeStatusList.Items { |
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
The LVMCluster.Status will now contain a list of VGs, the nodes on which they have been created and the status on that node. Signed-off-by: N Balachandran <[email protected]>
The LVMCluster controller will update the LVMCluster.Status with the consolidated status information in the LVMVolumeGroupNodeStatus objects. Signed-off-by: N Balachandran <[email protected]>
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
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: leelavg, nbalacha, sp98 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The LVMCluster operator will now consolidate the information in the LVMVolumeGroupNodeStatus objects and update the LVMCluster.Status.