From d4c89429bdd5cd239d02b4b6702015d6b22f5008 Mon Sep 17 00:00:00 2001 From: Ashutosh Kumar Date: Wed, 5 Aug 2020 10:03:02 +0530 Subject: [PATCH] add vendor changes Signed-off-by: Ashutosh Kumar --- go.mod | 2 +- go.sum | 2 + pkg/webhook/cspc.go | 7 -- .../api/pkg/apis/cstor/v1/cstorpoolcluster.go | 67 ++++++++++++------- .../pkg/apis/cstor/v1/cstorpoolinstance.go | 34 +++++++--- .../api/pkg/apis/cstor/v1/cstorvolume.go | 29 +++++--- .../pkg/apis/cstor/v1/cstorvolumeconfig.go | 10 ++- .../pkg/apis/cstor/v1/cstorvolumepolicy.go | 16 ++--- .../pkg/apis/cstor/v1/cstorvolumereplica.go | 28 +++++--- .../apis/cstor/v1/version_details_types.go | 13 ++-- .../openebs/api/pkg/apis/types/types.go | 5 ++ vendor/modules.txt | 2 +- 12 files changed, 133 insertions(+), 82 deletions(-) diff --git a/go.mod b/go.mod index f76959bb..132da067 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/imdario/mergo v0.3.8 // indirect github.com/onsi/ginkgo v1.12.0 github.com/onsi/gomega v1.9.0 - github.com/openebs/api v1.11.1-0.20200714130107-dca81641f677 + github.com/openebs/api v1.12.1-0.20200805040335-b9bd4809e80c github.com/pkg/errors v0.9.1 github.com/spf13/cobra v0.0.5 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index d846d907..b01ac7ac 100644 --- a/go.sum +++ b/go.sum @@ -391,6 +391,8 @@ github.com/openebs/api v1.11.1-0.20200629052954-e52e2bcd8339 h1:T6IuGc8zikB4XG+s github.com/openebs/api v1.11.1-0.20200629052954-e52e2bcd8339/go.mod h1:TASujm6H1LGdx43MN7Dab1xdAqR7MVU8bsS74Ywop5w= github.com/openebs/api v1.11.1-0.20200714130107-dca81641f677 h1:a4MkCCd4QrC+Hun7xIkBkXbJcbF9SU3H/P6vZNxSwwA= github.com/openebs/api v1.11.1-0.20200714130107-dca81641f677/go.mod h1:TASujm6H1LGdx43MN7Dab1xdAqR7MVU8bsS74Ywop5w= +github.com/openebs/api v1.12.1-0.20200805040335-b9bd4809e80c h1:fZmO/A7BnxFAg9y1gjhtN6IG1ZBj0e0bLJTQtOI1Tk4= +github.com/openebs/api v1.12.1-0.20200805040335-b9bd4809e80c/go.mod h1:TASujm6H1LGdx43MN7Dab1xdAqR7MVU8bsS74Ywop5w= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.1.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= diff --git a/pkg/webhook/cspc.go b/pkg/webhook/cspc.go index c95b444b..d9f0c4b8 100644 --- a/pkg/webhook/cspc.go +++ b/pkg/webhook/cspc.go @@ -401,13 +401,6 @@ func validateBlockDevice(bd *openebsapis.BlockDevice, hostName string) error { bd.Spec.FileSystem.Type, ) } - if bd.Labels[types.HostNameLabelKey] != hostName { - return errors.Errorf( - "block device %s doesn't belongs to node %s", - bd.Name, - bd.Labels[types.HostNameLabelKey], - ) - } if bd.Labels[types.HostNameLabelKey] != hostName { return errors.Errorf( diff --git a/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorpoolcluster.go b/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorpoolcluster.go index 7769945d..2fb352f3 100644 --- a/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorpoolcluster.go +++ b/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorpoolcluster.go @@ -39,40 +39,48 @@ const ( // +genclient // +genclient:noStatus // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true // +resource:path=cstorpoolcluster // CStorPoolCluster describes a CStorPoolCluster custom resource. +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Namespaced,shortName=cspc +// +kubebuilder:printcolumn:name="HealthyInstances",type=integer,JSONPath=`.status.healthyInstances`,description="The number of healthy cStorPoolInstances" +// +kubebuilder:printcolumn:name="ProvisionedInstances",type=integer,JSONPath=`.status.provisionedInstances`,description="The number of provisioned cStorPoolInstances" +// +kubebuilder:printcolumn:name="DesiredInstances",type=integer,JSONPath=`.status.desiredInstances`,description="The number of desired cStorPoolInstances" +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="Age of CStorPoolCluster" type CStorPoolCluster struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec CStorPoolClusterSpec `json:"spec"` - Status CStorPoolClusterStatus `json:"status"` - VersionDetails VersionDetails `json:"versionDetails"` + Status CStorPoolClusterStatus `json:"status,omitempty"` + VersionDetails VersionDetails `json:"versionDetails,omitempty"` } // CStorPoolClusterSpec is the spec for a CStorPoolClusterSpec resource type CStorPoolClusterSpec struct { // Pools is the spec for pools for various nodes // where it should be created. - Pools []PoolSpec `json:"pools"` + Pools []PoolSpec `json:"pools,omitempty"` // DefaultResources are the compute resources required by the cstor-pool // container. // If the resources at PoolConfig is not specified, this is written // to CSPI PoolConfig. - DefaultResources *corev1.ResourceRequirements `json:"resources"` + // +nullable + DefaultResources *corev1.ResourceRequirements `json:"resources,omitempty"` // AuxResources are the compute resources required by the cstor-pool pod // side car containers. - DefaultAuxResources *corev1.ResourceRequirements `json:"auxResources"` + // +nullable + DefaultAuxResources *corev1.ResourceRequirements `json:"auxResources,omitempty"` // Tolerations, if specified, are the pool pod's tolerations // If tolerations at PoolConfig is empty, this is written to // CSPI PoolConfig. - Tolerations []corev1.Toleration `json:"tolerations"` + // +nullable + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` // DefaultPriorityClassName if specified applies to all the pool pods // in the pool spec if the priorityClass at the pool level is // not specified. - DefaultPriorityClassName string `json:"priorityClassName"` + DefaultPriorityClassName string `json:"priorityClassName,omitempty"` } //PoolSpec is the spec for pool on node where it should be created. @@ -84,10 +92,11 @@ type PoolSpec struct { // DataRaidGroups is the raid group configuration for the given pool. DataRaidGroups []RaidGroup `json:"dataRaidGroups"` // WriteCacheRaidGroups is the write cache raid group. - WriteCacheRaidGroups []RaidGroup `json:"writeCacheRaidGroups"` + // +nullable + WriteCacheRaidGroups []RaidGroup `json:"writeCacheRaidGroups,omitempty"` // PoolConfig is the default pool config that applies to the // pool on node. - PoolConfig PoolConfig `json:"poolConfig"` + PoolConfig PoolConfig `json:"poolConfig,omitempty"` } // PoolConfig is the default pool config that applies to the @@ -97,29 +106,33 @@ type PoolConfig struct { DataRaidGroupType string `json:"dataRaidGroupType"` // WriteCacheGroupType is the write cache raid type. - WriteCacheGroupType string `json:"writeCacheGroupType"` + WriteCacheGroupType string `json:"writeCacheGroupType,omitempty"` // ThickProvision to enable thick provisioning // Optional -- defaults to false - ThickProvision bool `json:"thickProvision"` + ThickProvision bool `json:"thickProvision,omitempty"` // Compression to enable compression // Optional -- defaults to off // Possible values : lz, off - Compression string `json:"compression"` + Compression string `json:"compression,omitempty"` // Resources are the compute resources required by the cstor-pool // container. - Resources *corev1.ResourceRequirements `json:"resources"` + // +nullable + Resources *corev1.ResourceRequirements `json:"resources,omitempty"` // AuxResources are the compute resources required by the cstor-pool pod // side car containers. - AuxResources *corev1.ResourceRequirements `json:"auxResources"` + // +nullable + AuxResources *corev1.ResourceRequirements `json:"auxResources,omitempty"` // Tolerations, if specified, the pool pod's tolerations. - Tolerations []corev1.Toleration `json:"tolerations"` + // +nullable + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` // PriorityClassName if specified applies to this pool pod // If left empty, DefaultPriorityClassName is applied. // (See CStorPoolClusterSpec.DefaultPriorityClassName) // If both are empty, not priority class is applied. - PriorityClassName *string `json:"priorityClassName"` + // +nullable + PriorityClassName *string `json:"priorityClassName,omitempty"` // ROThresholdLimit is threshold(percentage base) limit // for pool read only mode. If ROThresholdLimit(%) amount @@ -128,7 +141,9 @@ type PoolConfig struct { // 1. If ROThresholdLimit is set to 100 then entire // pool storage will be used by default it will be set to 85%. // 2. ROThresholdLimit value will be 0 <= ROThresholdLimit <= 100. - ROThresholdLimit *int `json:"roThresholdLimit"` //optional + // +kubebuilder:validation:Optional + // +nullable + ROThresholdLimit *int `json:"roThresholdLimit,omitempty"` //optional } // RaidGroup contains the details of a raid group for the pool @@ -143,24 +158,28 @@ type CStorPoolInstanceBlockDevice struct { BlockDeviceName string `json:"blockDeviceName"` // Capacity is the capacity of the block device. // It is system generated - Capacity uint64 `json:"capacity"` + Capacity uint64 `json:"capacity,omitempty"` // DevLink is the dev link for block devices - DevLink string `json:"devLink"` + DevLink string `json:"devLink,omitempty"` } // CStorPoolClusterStatus represents the latest available observations of a CSPC's current state. type CStorPoolClusterStatus struct { // ProvisionedInstances is the the number of CSPI present at the current state. - ProvisionedInstances int32 `json:"provisionedInstances"` + // +nullable + ProvisionedInstances int32 `json:"provisionedInstances,omitempty"` // DesiredInstances is the number of CSPI(s) that should be provisioned. - DesiredInstances int32 `json:"desiredInstances"` + // +nullable + DesiredInstances int32 `json:"desiredInstances,omitempty"` // HealthyInstances is the number of CSPI(s) that are healthy. - HealthyInstances int32 `json:"healthyInstances"` + // +nullable + HealthyInstances int32 `json:"healthyInstances,omitempty"` // Current state of CSPC. - Conditions []CStorPoolClusterCondition `json:"conditions"` + // +nullable + Conditions []CStorPoolClusterCondition `json:"conditions,omitempty"` } type CSPCConditionType string diff --git a/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorpoolinstance.go b/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorpoolinstance.go index 77983e67..4914c57c 100644 --- a/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorpoolinstance.go +++ b/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorpoolinstance.go @@ -25,37 +25,49 @@ import ( // +genclient // +genclient:noStatus // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true // +resource:path=cstorpoolinstance // CStorPoolInstance describes a cstor pool instance resource. +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Namespaced,shortName=cspi +// +kubebuilder:printcolumn:name="HostName",type=string,JSONPath=`.spec.hostName`,description="Host name where cstorpool instances scheduled" +// +kubebuilder:printcolumn:name="Allocated",type=string,JSONPath=`.status.capacity.used`,description="The amount of storage space within the pool that has been physically allocated" +// +kubebuilder:printcolumn:name="Free",type=string,JSONPath=`.status.capacity.free`,description="The amount of usable free space available in the pool" +// +kubebuilder:printcolumn:name="Capacity",type=string,JSONPath=`.status.capacity.total`,description="Total amount of usable space in pool" +// +kubebuilder:printcolumn:name="ReadOnly",type=boolean,JSONPath=`.status.readOnly`,description="Identifies the pool read only mode" +// +kubebuilder:printcolumn:name="ProvisionedReplicas",type=integer,JSONPath=`.status.provisionedReplicas`,description="Represents no.of replicas present in the pool" +// +kubebuilder:printcolumn:name="HealthyReplicas",type=integer,JSONPath=`.status.healthyReplicas`,description="Represents no.of healthy replicas present in the pool" +// +kubebuilder:printcolumn:name="Type",type=string,JSONPath=`.spec.poolConfig.dataRaidGroupType`,description="Represents the type of the storage pool" +// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase`,description="Identifies the current health of the pool" +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="Age of CStorPoolInstance" type CStorPoolInstance struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // Spec is the specification of the cstorpoolinstance resource. Spec CStorPoolInstanceSpec `json:"spec"` // Status is the possible statuses of the cstorpoolinstance resource. - Status CStorPoolInstanceStatus `json:"status"` + Status CStorPoolInstanceStatus `json:"status,omitempty"` // VersionDetails is the openebs version. - VersionDetails VersionDetails `json:"versionDetails"` + VersionDetails VersionDetails `json:"versionDetails,omitempty"` } // CStorPoolInstanceSpec is the spec listing fields for a CStorPoolInstance resource. type CStorPoolInstanceSpec struct { // HostName is the name of kubernetes node where the pool // should be created. - HostName string `json:"hostName"` + HostName string `json:"hostName,omitempty"` // NodeSelector is the labels that will be used to select // a node for pool provisioning. // Required field NodeSelector map[string]string `json:"nodeSelector"` // PoolConfig is the default pool config that applies to the // pool on node. - PoolConfig PoolConfig `json:"poolConfig"` + PoolConfig PoolConfig `json:"poolConfig,omitempty"` // DataRaidGroups is the raid group configuration for the given pool. DataRaidGroups []RaidGroup `json:"dataRaidGroups"` // WriteCacheRaidGroups is the write cache raid group. - WriteCacheRaidGroups []RaidGroup `json:"writeCacheRaidGroups"` + // +nullable + WriteCacheRaidGroups []RaidGroup `json:"writeCacheRaidGroups,omitempty"` } // CStorPoolInstancePhase is the phase for CStorPoolInstance resource. @@ -101,17 +113,17 @@ type CStorPoolInstanceStatus struct { Conditions []CStorPoolInstanceCondition `json:"conditions,omitempty"` // The phase of a CStorPool is a simple, high-level summary of the pool state on the // node. - Phase CStorPoolInstancePhase `json:"phase"` + Phase CStorPoolInstancePhase `json:"phase,omitempty"` // Capacity describes the capacity details of a cstor pool - Capacity CStorPoolInstanceCapacity `json:"capacity"` + Capacity CStorPoolInstanceCapacity `json:"capacity,omitempty"` //ReadOnly if pool is readOnly or not - ReadOnly bool `json:"readOnly"` + ReadOnly bool `json:"readOnly,omitempty"` // ProvisionedReplicas describes the total count of Volume Replicas // present in the cstor pool - ProvisionedReplicas int32 `json:"provisionedReplicas"` + ProvisionedReplicas int32 `json:"provisionedReplicas,omitempty"` // HealthyReplicas describes the total count of healthy Volume Replicas // in the cstor pool - HealthyReplicas int32 `json:"healthyReplicas"` + HealthyReplicas int32 `json:"healthyReplicas,omitempty"` } // CStorPoolInstanceCapacity stores the pool capacity related attributes. diff --git a/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorvolume.go b/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorvolume.go index 5ab004f8..ced05533 100644 --- a/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorvolume.go +++ b/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorvolume.go @@ -26,43 +26,48 @@ import ( // +resource:path=cstorvolume // CStorVolume describes a cstor volume resource created as custom resource +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Namespaced,shortName=cv +// +kubebuilder:printcolumn:name="Capacity",type=string,JSONPath=`.status.capacity`,description="Current volume capacity" +// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase`,description="Identifies the current health of the volume" +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="Age of CStorVolume" type CStorVolume struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec CStorVolumeSpec `json:"spec"` - Status CStorVolumeStatus `json:"status"` - VersionDetails VersionDetails `json:"versionDetails"` + Status CStorVolumeStatus `json:"status,omitempty"` + VersionDetails VersionDetails `json:"versionDetails,omitempty"` } // CStorVolumeSpec is the spec for a CStorVolume resource type CStorVolumeSpec struct { // Capacity represents the desired size of the underlying volume. - Capacity resource.Quantity `json:"capacity"` + Capacity resource.Quantity `json:"capacity,omitempty"` // TargetIP IP of the iSCSI target service - TargetIP string `json:"targetIP"` + TargetIP string `json:"targetIP,omitempty"` // iSCSI Target Port typically TCP ports 3260 - TargetPort string `json:"targetPort"` + TargetPort string `json:"targetPort,omitempty"` // Target iSCSI Qualified Name.combination of nodeBase - Iqn string `json:"iqn"` + Iqn string `json:"iqn,omitempty"` // iSCSI Target Portal. The Portal is combination of IP:port (typically TCP ports 3260) - TargetPortal string `json:"targetPortal"` + TargetPortal string `json:"targetPortal,omitempty"` // ReplicationFactor represents number of volume replica created during volume // provisioning connect to the target - ReplicationFactor int `json:"replicationFactor"` + ReplicationFactor int `json:"replicationFactor,omitempty"` // ConsistencyFactor is minimum number of volume replicas i.e. `RF/2 + 1` // has to be connected to the target for write operations. Basically more then // 50% of replica has to be connected to target. - ConsistencyFactor int `json:"consistencyFactor"` + ConsistencyFactor int `json:"consistencyFactor,omitempty"` // DesiredReplicationFactor represents maximum number of replicas // that are allowed to connect to the target. Required for scale operations - DesiredReplicationFactor int `json:"desiredReplicationFactor"` + DesiredReplicationFactor int `json:"desiredReplicationFactor,omitempty"` //ReplicaDetails refers to the trusty replica information ReplicaDetails CStorVolumeReplicaDetails `json:"replicaDetails,omitempty"` @@ -76,14 +81,16 @@ type CStorVolumePhase string // CStorVolumeStatus is for handling status of cvr. type CStorVolumeStatus struct { - Phase CStorVolumePhase `json:"phase"` + Phase CStorVolumePhase `json:"phase,omitempty"` ReplicaStatuses []ReplicaStatus `json:"replicaStatuses,omitempty"` // Represents the actual capacity of the underlying volume. Capacity resource.Quantity `json:"capacity,omitempty"` // LastTransitionTime refers to the time when the phase changes + // +nullable LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` // LastUpdateTime refers to the time when last status updated due to any // operations + // +nullable LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"` // A human-readable message indicating details about why the volume is in this state. Message string `json:"message,omitempty"` diff --git a/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorvolumeconfig.go b/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorvolumeconfig.go index 5bd9066d..3a4101c9 100644 --- a/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorvolumeconfig.go +++ b/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorvolumeconfig.go @@ -23,11 +23,15 @@ import ( // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true // CStorVolumeConfig describes a cstor volume config resource created as // custom resource. CStorVolumeConfig is a request for creating cstor volume // related resources like deployment, svc etc. +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Namespaced,shortName=cvc +// +kubebuilder:printcolumn:name="Capacity",type=string,JSONPath=`.status.capacity.storage`,description="Identifies the volume capacity" +// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase`,description="Identifies the volume provisioning status" +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="Age of CStorVolumeReplica" type CStorVolumeConfig struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -103,10 +107,10 @@ const ( // defines the observed state of CStorVolumeConfig type CStorVolumeConfigStatus struct { // Phase represents the current phase of CStorVolumeConfig. - Phase CStorVolumeConfigPhase `json:"phase"` + Phase CStorVolumeConfigPhase `json:"phase,omitempty"` // PoolInfo represents current pool names where volume replicas exists - PoolInfo []string `json:"poolInfo"` + PoolInfo []string `json:"poolInfo,omitempty"` // Capacity the actual resources of the underlying volume. Capacity corev1.ResourceList `json:"capacity,omitempty"` diff --git a/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorvolumepolicy.go b/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorvolumepolicy.go index 6d300c61..eac21d0e 100644 --- a/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorvolumepolicy.go +++ b/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorvolumepolicy.go @@ -23,34 +23,35 @@ import ( // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true // CStorVolumePolicy describes a configuration required for cstor volume // resources +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Namespaced,shortName=cvp type CStorVolumePolicy struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // Spec defines a configuration info of a cstor volume required // to provisione cstor volume resources Spec CStorVolumePolicySpec `json:"spec"` - Status CStorVolumePolicyStatus `json:"status"` + Status CStorVolumePolicyStatus `json:"status,omitempty"` } // CStorVolumePolicySpec ... type CStorVolumePolicySpec struct { // replicaAffinity is set to true then volume replica resources need to be // distributed across the pool instances - Provision Provision `json:"provision"` + Provision Provision `json:"provision,omitempty"` // TargetSpec represents configuration related to cstor target and its resources - Target TargetSpec `json:"target"` + Target TargetSpec `json:"target,omitempty"` // ReplicaSpec represents configuration related to replicas resources - Replica ReplicaSpec `json:"replica"` + Replica ReplicaSpec `json:"replica,omitempty"` // ReplicaPoolInfo holds the pool information of volume replicas. // Ex: If volume is provisioned on which CStor pool volume replicas exist - ReplicaPoolInfo []ReplicaPoolInfo `json:"replicaPoolInfo"` + ReplicaPoolInfo []ReplicaPoolInfo `json:"replicaPoolInfo,omitempty"` } // TargetSpec represents configuration related to cstor target and its resources @@ -151,11 +152,10 @@ type ReplicaPoolInfo struct { // CStorVolumePolicyStatus is for handling status of CstorVolumePolicy type CStorVolumePolicyStatus struct { - Phase string `json:"phase"` + Phase string `json:"phase,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true // CStorVolumePolicyList is a list of CStorVolumePolicy resources type CStorVolumePolicyList struct { diff --git a/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorvolumereplica.go b/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorvolumereplica.go index cc3bf790..2721dbea 100644 --- a/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorvolumereplica.go +++ b/vendor/github.com/openebs/api/pkg/apis/cstor/v1/cstorvolumereplica.go @@ -41,34 +41,40 @@ const ( // +resource:path=cstorvolumereplica // CStorVolumeReplica describes a cstor volume resource created as custom resource +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Namespaced,shortName=cvr +// +kubebuilder:printcolumn:name="Allocated",type=string,JSONPath=`.status.capacity.total`,description="The amount of disk space consumed by a dataset and all its descendents" +// +kubebuilder:printcolumn:name="Used",type=string,JSONPath=`.status.capacity.used`,description="The amount of space that is logically consumed by this dataset" +// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase`,description="Identifies the current state of the replicas" +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="Age of CStorVolumeReplica" type CStorVolumeReplica struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec CStorVolumeReplicaSpec `json:"spec"` - Status CStorVolumeReplicaStatus `json:"status"` - VersionDetails VersionDetails `json:"versionDetails"` + Status CStorVolumeReplicaStatus `json:"status,omitempty"` + VersionDetails VersionDetails `json:"versionDetails,omitempty"` } // CStorVolumeReplicaSpec is the spec for a CStorVolumeReplica resource type CStorVolumeReplicaSpec struct { // TargetIP represents iscsi target IP through which replica cummunicates // IO workloads and other volume operations like snapshot and resize requests - TargetIP string `json:"targetIP"` + TargetIP string `json:"targetIP,omitempty"` //Represents the actual capacity of the underlying volume - Capacity string `json:"capacity"` + Capacity string `json:"capacity,omitempty"` // ZvolWorkers represents number of threads that executes client IOs - ZvolWorkers string `json:"zvolWorkers"` + ZvolWorkers string `json:"zvolWorkers,omitempty"` // ReplicaID is unique number to identify the replica - ReplicaID string `json:"replicaid"` + ReplicaID string `json:"replicaid,omitempty"` // Controls the compression algorithm used for this volumes // examples: on|off|gzip|gzip-N|lz4|lzjb|zle - Compression string `json:"compression"` + Compression string `json:"compression,omitempty"` // BlockSize is the logical block size in multiple of 512 bytes // BlockSize specifies the block size of the volume. The blocksize // cannot be changed once the volume has been written, so it should be // set at volume creation time. The default blocksize for volumes is 4 Kbytes. // Any power of 2 from 512 bytes to 128 Kbytes is valid. - BlockSize uint32 `json:"blockSize"` + BlockSize uint32 `json:"blockSize,omitempty"` } // CStorVolumeReplicaPhase is to hold result of action. @@ -131,15 +137,17 @@ const ( // CStorVolumeReplicaStatus is for handling status of cvr. type CStorVolumeReplicaStatus struct { // CStorVolumeReplicaPhase is to holds different phases of replica - Phase CStorVolumeReplicaPhase `json:"phase"` + Phase CStorVolumeReplicaPhase `json:"phase,omitempty"` // CStorVolumeCapacityDetails represents capacity info of replica - Capacity CStorVolumeReplicaCapacityDetails `json:"capacity"` + Capacity CStorVolumeReplicaCapacityDetails `json:"capacity,omitempty"` // LastTransitionTime refers to the time when the phase changes + // +nullable LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` // The last updated time + // +nullable LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"` // A human readable message indicating details about the transition. diff --git a/vendor/github.com/openebs/api/pkg/apis/cstor/v1/version_details_types.go b/vendor/github.com/openebs/api/pkg/apis/cstor/v1/version_details_types.go index b748646e..3183f9ca 100644 --- a/vendor/github.com/openebs/api/pkg/apis/cstor/v1/version_details_types.go +++ b/vendor/github.com/openebs/api/pkg/apis/cstor/v1/version_details_types.go @@ -22,29 +22,30 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" type VersionDetails struct { // If AutoUpgrade is set to true then the resource is // upgraded automatically without any manual steps - AutoUpgrade bool `json:"autoUpgrade"` + AutoUpgrade bool `json:"autoUpgrade,omitempty"` // Desired is the version that we want to // upgrade or the control plane version - Desired string `json:"desired"` + Desired string `json:"desired,omitempty"` // Status gives the status of reconciliation triggered // when the desired and current version are not same - Status VersionStatus `json:"status"` + Status VersionStatus `json:"status,omitempty"` } // VersionStatus is the status of the reconciliation of versions type VersionStatus struct { // DependentsUpgraded gives the details whether all children // of a resource are upgraded to desired version or not - DependentsUpgraded bool `json:"dependentsUpgraded"` + DependentsUpgraded bool `json:"dependentsUpgraded,omitempty"` // Current is the version of resource - Current string `json:"current"` + Current string `json:"current,omitempty"` // State is the state of reconciliation - State VersionState `json:"state"` + State VersionState `json:"state,omitempty"` // Message is a human readable message if some error occurs Message string `json:"message,omitempty"` // Reason is the actual reason for the error state Reason string `json:"reason,omitempty"` // LastUpdateTime is the time the status was last updated + // +nullable LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"` } diff --git a/vendor/github.com/openebs/api/pkg/apis/types/types.go b/vendor/github.com/openebs/api/pkg/apis/types/types.go index 0604088c..20c463ad 100644 --- a/vendor/github.com/openebs/api/pkg/apis/types/types.go +++ b/vendor/github.com/openebs/api/pkg/apis/types/types.go @@ -58,6 +58,11 @@ const ( // PersistentVolumeLabelKey label key set in all cstorvolume replicas of a // given volume PersistentVolumeLabelKey = "openebs.io/persistent-volume" + + // BlockDeviceTagLabelKey is the key to fetch tag of a block + // device. + // For more info : https://github.com/openebs/node-disk-manager/pull/400 + BlockDeviceTagLabelKey = "openebs.io/block-device-tag" ) const ( diff --git a/vendor/modules.txt b/vendor/modules.txt index 2fce328f..84cf1218 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -82,7 +82,7 @@ github.com/onsi/gomega/matchers/support/goraph/edge github.com/onsi/gomega/matchers/support/goraph/node github.com/onsi/gomega/matchers/support/goraph/util github.com/onsi/gomega/types -# github.com/openebs/api v1.11.1-0.20200714130107-dca81641f677 +# github.com/openebs/api v1.12.1-0.20200805040335-b9bd4809e80c github.com/openebs/api/pkg/apis/cstor github.com/openebs/api/pkg/apis/cstor/v1 github.com/openebs/api/pkg/apis/openebs.io