Skip to content

Commit

Permalink
Merge pull request #426 from jakobmoellerdev/OCPVE-665-report-diskSel…
Browse files Browse the repository at this point in the history
…ector-reasons

OCPVE-665: feat: report filter status into vgstatus
  • Loading branch information
openshift-merge-robot committed Sep 25, 2023
2 parents 3448dbf + 77967eb commit 2c853f5
Show file tree
Hide file tree
Showing 18 changed files with 964 additions and 629 deletions.
9 changes: 2 additions & 7 deletions api/v1alpha1/lvmcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,8 @@ type Storage struct {
// NodeStatus defines the observed state of the deviceclass on the node
type NodeStatus struct {
// Node is the name of the node
Node string `json:"node,omitempty"`
// Status is the status of the VG on the node
Status VGStatusType `json:"status,omitempty"`
// Reason provides more detail on the VG creation status
Reason string `json:"reason,omitempty"`
// Devices is the list of devices used by the deviceclass
Devices []string `json:"devices,omitempty"`
Node string `json:"node,omitempty"`
VGStatus `json:",inline"`
}

//+kubebuilder:object:root=true
Expand Down
18 changes: 14 additions & 4 deletions api/v1alpha1/lvmvolumegroupnodestatus_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,24 @@ const (
)

type VGStatus struct {
// Name is the name of the VG
// Name is the name of the volume group
Name string `json:"name,omitempty"`
// Status tells if the VG was created on the node
// Status tells if the volume group was created on the node
Status VGStatusType `json:"status,omitempty"`
// Reason provides more detail on the VG creation status
// Reason provides more detail on the volume group creation status
Reason string `json:"reason,omitempty"`
//Devices is the list of devices used by the VG
// Devices is the list of devices used by the volume group
Devices []string `json:"devices,omitempty"`
// Excluded contains the per node status of applied device exclusions that were picked up via selector,
// but were not used for other reasons.
Excluded []ExcludedDevice `json:"excluded,omitempty"`
}

type ExcludedDevice struct {
// Name is the device that was filtered
Name string `json:"name"`
// Reasons are the human-readable reasons why the device was excluded from the volume group
Reasons []string `json:"reasons"`
}

// LVMVolumeGroupNodeStatusStatus defines the observed state of LVMVolumeGroupNodeStatus
Expand Down
3 changes: 1 addition & 2 deletions api/v1alpha1/webhook_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ var _ = BeforeSuite(func() {
})
Expect(err).NotTo(HaveOccurred())

err = (&LVMCluster{}).SetupWebhookWithManager(mgr)
Expect(err).NotTo(HaveOccurred())
Expect((&LVMCluster{}).SetupWebhookWithManager(mgr)).NotTo(HaveOccurred())

//+kubebuilder:scaffold:webhook

Expand Down
33 changes: 28 additions & 5 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 28 additions & 4 deletions bundle/manifests/lvm.topolvm.io_lvmclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,19 +301,43 @@ spec:
properties:
devices:
description: Devices is the list of devices used by the
deviceclass
volume group
items:
type: string
type: array
excluded:
description: Excluded contains the per node status of
applied device exclusions that were picked up via selector,
but were not used for other reasons.
items:
properties:
name:
description: Name is the device that was filtered
type: string
reasons:
description: Reasons are the human-readable reasons
why the device was excluded from the volume group
items:
type: string
type: array
required:
- name
- reasons
type: object
type: array
name:
description: Name is the name of the volume group
type: string
node:
description: Node is the name of the node
type: string
reason:
description: Reason provides more detail on the VG creation
status
description: Reason provides more detail on the volume
group creation status
type: string
status:
description: Status is the status of the VG on the node
description: Status tells if the volume group was created
on the node
type: string
type: object
type: array
Expand Down
32 changes: 27 additions & 5 deletions bundle/manifests/lvm.topolvm.io_lvmvolumegroupnodestatuses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,41 @@ spec:
items:
properties:
devices:
description: Devices is the list of devices used by the VG
description: Devices is the list of devices used by the volume
group
items:
type: string
type: array
excluded:
description: Excluded contains the per node status of applied
device exclusions that were picked up via selector, but were
not used for other reasons.
items:
properties:
name:
description: Name is the device that was filtered
type: string
reasons:
description: Reasons are the human-readable reasons why
the device was excluded from the volume group
items:
type: string
type: array
required:
- name
- reasons
type: object
type: array
name:
description: Name is the name of the VG
description: Name is the name of the volume group
type: string
reason:
description: Reason provides more detail on the VG creation
status
description: Reason provides more detail on the volume group
creation status
type: string
status:
description: Status tells if the VG was created on the node
description: Status tells if the volume group was created on
the node
type: string
type: object
type: array
Expand Down
32 changes: 28 additions & 4 deletions config/crd/bases/lvm.topolvm.io_lvmclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -297,19 +297,43 @@ spec:
properties:
devices:
description: Devices is the list of devices used by the
deviceclass
volume group
items:
type: string
type: array
excluded:
description: Excluded contains the per node status of
applied device exclusions that were picked up via selector,
but were not used for other reasons.
items:
properties:
name:
description: Name is the device that was filtered
type: string
reasons:
description: Reasons are the human-readable reasons
why the device was excluded from the volume group
items:
type: string
type: array
required:
- name
- reasons
type: object
type: array
name:
description: Name is the name of the volume group
type: string
node:
description: Node is the name of the node
type: string
reason:
description: Reason provides more detail on the VG creation
status
description: Reason provides more detail on the volume
group creation status
type: string
status:
description: Status is the status of the VG on the node
description: Status tells if the volume group was created
on the node
type: string
type: object
type: array
Expand Down
32 changes: 27 additions & 5 deletions config/crd/bases/lvm.topolvm.io_lvmvolumegroupnodestatuses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,41 @@ spec:
items:
properties:
devices:
description: Devices is the list of devices used by the VG
description: Devices is the list of devices used by the volume
group
items:
type: string
type: array
excluded:
description: Excluded contains the per node status of applied
device exclusions that were picked up via selector, but were
not used for other reasons.
items:
properties:
name:
description: Name is the device that was filtered
type: string
reasons:
description: Reasons are the human-readable reasons why
the device was excluded from the volume group
items:
type: string
type: array
required:
- name
- reasons
type: object
type: array
name:
description: Name is the name of the VG
description: Name is the name of the volume group
type: string
reason:
description: Reason provides more detail on the VG creation
status
description: Reason provides more detail on the volume group
creation status
type: string
status:
description: Status tells if the VG was created on the node
description: Status tells if the volume group was created on
the node
type: string
type: object
type: array
Expand Down
6 changes: 2 additions & 4 deletions controllers/lvmcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,8 @@ func (r *LVMClusterReconciler) updateLVMClusterStatus(ctx context.Context, insta

vgNodeMap[item.Name] = append(vgNodeMap[item.Name],
lvmv1alpha1.NodeStatus{
Node: nodeItem.Name,
Reason: item.Reason,
Status: item.Status,
Devices: item.Devices,
Node: nodeItem.Name,
VGStatus: *item.DeepCopy(),
},
)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ require (
go.uber.org/zap v1.26.0
gotest.tools/v3 v3.5.1
k8s.io/api v0.28.2
k8s.io/apiextensions-apiserver v0.28.2
k8s.io/apimachinery v0.28.2
k8s.io/client-go v0.28.2
k8s.io/component-helpers v0.28.2
Expand Down Expand Up @@ -99,7 +100,6 @@ require (
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.28.2 // indirect
k8s.io/component-base v0.28.2 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
Expand Down
Loading

0 comments on commit 2c853f5

Please sign in to comment.