From 7c22996f9dbcf5898a545bb38b2a7d800236bff8 Mon Sep 17 00:00:00 2001 From: Ashutosh Kumar Date: Sat, 4 Apr 2020 23:44:12 +0530 Subject: [PATCH] chore(cspc): update cspc api (#35) This commit does following : 1. Changes 'ThickProvisioning' field to 'ThickProvision'. 2. Add 'PoolManagerAvailable' condition type in cspc Signed-off-by: Ashutosh Kumar --- pkg/apis/cstor/v1/cstorpoolcluster.go | 11 +++++++++-- pkg/internalapis/apis/cstor/cstorpoolcluster.go | 11 +++++++++-- .../apis/cstor/v1/zz_generated.conversion.go | 4 ++-- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/pkg/apis/cstor/v1/cstorpoolcluster.go b/pkg/apis/cstor/v1/cstorpoolcluster.go index f174dc7d..13e8b113 100644 --- a/pkg/apis/cstor/v1/cstorpoolcluster.go +++ b/pkg/apis/cstor/v1/cstorpoolcluster.go @@ -99,9 +99,9 @@ type PoolConfig struct { // WriteCacheGroupType is the write cache raid type. WriteCacheGroupType string `json:"writeCacheGroupType"` - // ThickProvisioning to enable thick provisioning + // ThickProvision to enable thick provisioning // Optional -- defaults to false - ThickProvisioning bool `json:"thickProvisioning"` + ThickProvision bool `json:"thickProvision"` // Compression to enable compression // Optional -- defaults to off // Possible values : lz, off @@ -165,6 +165,13 @@ type CStorPoolClusterStatus struct { type CSPCConditionType string +// These are valid conditions of a cspc. +const ( + // PoolManagerAvailable means the PoolManagerAvailable deployment is available, ie. at least the minimum available + // replicas required are up and running and in ready state. + PoolManagerAvailable CSPCConditionType = "PoolManagerAvailable" +) + // CStorPoolClusterCondition describes the state of a CSPC at a certain point. type CStorPoolClusterCondition struct { // Type of CSPC condition. diff --git a/pkg/internalapis/apis/cstor/cstorpoolcluster.go b/pkg/internalapis/apis/cstor/cstorpoolcluster.go index 00a7fea2..2bee156a 100644 --- a/pkg/internalapis/apis/cstor/cstorpoolcluster.go +++ b/pkg/internalapis/apis/cstor/cstorpoolcluster.go @@ -99,9 +99,9 @@ type PoolConfig struct { // WriteCacheGroupType is the write cache raid type. WriteCacheGroupType string `json:"writeCacheGroupType"` - // ThickProvisioning to enable thick provisioning + // ThickProvision to enable thick provisioning // Optional -- defaults to false - ThickProvisioning bool `json:"thickProvisioning"` + ThickProvision bool `json:"thickProvision"` // Compression to enable compression // Optional -- defaults to off // Possible values : lz, off @@ -165,6 +165,13 @@ type CStorPoolClusterStatus struct { type CSPCConditionType string +// These are valid conditions of a cspc. +const ( + // PoolManagerAvailable means the PoolManagerAvailable deployment is available, ie. at least the minimum available + // replicas required are up and running and in ready state. + PoolManagerAvailable CSPCConditionType = "PoolManagerAvailable" +) + // CStorPoolClusterCondition describes the state of a CSPC at a certain point. type CStorPoolClusterCondition struct { // Type of CSPC condition. diff --git a/pkg/internalapis/apis/cstor/v1/zz_generated.conversion.go b/pkg/internalapis/apis/cstor/v1/zz_generated.conversion.go index 9330f9f7..7f035a04 100644 --- a/pkg/internalapis/apis/cstor/v1/zz_generated.conversion.go +++ b/pkg/internalapis/apis/cstor/v1/zz_generated.conversion.go @@ -1531,7 +1531,7 @@ func Convert_cstor_CVStatusResponse_To_v1_CVStatusResponse(in *cstor.CVStatusRes func autoConvert_v1_PoolConfig_To_cstor_PoolConfig(in *v1.PoolConfig, out *cstor.PoolConfig, s conversion.Scope) error { out.DataRaidGroupType = in.DataRaidGroupType out.WriteCacheGroupType = in.WriteCacheGroupType - out.ThickProvisioning = in.ThickProvisioning + out.ThickProvision = in.ThickProvision out.Compression = in.Compression out.Resources = (*corev1.ResourceRequirements)(unsafe.Pointer(in.Resources)) out.AuxResources = (*corev1.ResourceRequirements)(unsafe.Pointer(in.AuxResources)) @@ -1549,7 +1549,7 @@ func Convert_v1_PoolConfig_To_cstor_PoolConfig(in *v1.PoolConfig, out *cstor.Poo func autoConvert_cstor_PoolConfig_To_v1_PoolConfig(in *cstor.PoolConfig, out *v1.PoolConfig, s conversion.Scope) error { out.DataRaidGroupType = in.DataRaidGroupType out.WriteCacheGroupType = in.WriteCacheGroupType - out.ThickProvisioning = in.ThickProvisioning + out.ThickProvision = in.ThickProvision out.Compression = in.Compression out.Resources = (*corev1.ResourceRequirements)(unsafe.Pointer(in.Resources)) out.AuxResources = (*corev1.ResourceRequirements)(unsafe.Pointer(in.AuxResources))