From 6ed3827cbefc2a82982649f191ffde38896e200d Mon Sep 17 00:00:00 2001 From: Vaibhav Sethi Date: Tue, 21 Jan 2025 17:09:02 +0000 Subject: [PATCH] [CDAP-21096] Make appfabric service backward compatible after splitting into processor --- api/v1alpha1/cdapmaster_types.go | 8 ++++++++ api/v1alpha1/zz_generated.deepcopy.go | 10 ++++++++++ config/crd/bases/cdap.cdap.io_cdapmasters.yaml | 8 ++++++++ 3 files changed, 26 insertions(+) diff --git a/api/v1alpha1/cdapmaster_types.go b/api/v1alpha1/cdapmaster_types.go index c48035f4..707de642 100644 --- a/api/v1alpha1/cdapmaster_types.go +++ b/api/v1alpha1/cdapmaster_types.go @@ -223,6 +223,14 @@ type CDAPScalableStatefulServiceSpec struct { // AppFabricSpec defines the specification for the AppFabric service. type AppFabricSpec struct { CDAPScalableServiceSpec `json:",inline"` + // StorageSize is specification for the persistent volume size used by the service. + // Note: This is added for backward compatibility where Appfabric runs as CDAP stateful service. + // This field can be set to nil if appfabric is run as CDAP scalable service. + StorageSize *string `json:"storageSize,omitempty"` + // StorageClassName is the name of the StorageClass for the persistent volume used by the service. + // Note: This is added for backward compatibility where Appfabric runs as CDAP stateful service. + // This field can be set to nil if appfabric is run as CDAP scalable service. + StorageClassName *string `json:"storageClassName,omitempty"` } // AppFabricProcessorSpec defines the specification for the AppFabric Processor service. diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index ce26a1a8..aeefe7c3 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -45,6 +45,16 @@ func (in *AppFabricProcessorSpec) DeepCopy() *AppFabricProcessorSpec { func (in *AppFabricSpec) DeepCopyInto(out *AppFabricSpec) { *out = *in in.CDAPScalableServiceSpec.DeepCopyInto(&out.CDAPScalableServiceSpec) + if in.StorageSize != nil { + in, out := &in.StorageSize, &out.StorageSize + *out = new(string) + **out = **in + } + if in.StorageClassName != nil { + in, out := &in.StorageClassName, &out.StorageClassName + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppFabricSpec. diff --git a/config/crd/bases/cdap.cdap.io_cdapmasters.yaml b/config/crd/bases/cdap.cdap.io_cdapmasters.yaml index 8afb3193..a45b638b 100644 --- a/config/crd/bases/cdap.cdap.io_cdapmasters.yaml +++ b/config/crd/bases/cdap.cdap.io_cdapmasters.yaml @@ -4411,6 +4411,14 @@ spec: description: ServiceAccountName overrides the service account for the service pods. type: string + storageClassName: + description: StorageClassName is the name of the StorageClass + for the persistent volume used by the service. + type: string + storageSize: + description: StorageSize is specification for the persistent volume + size used by the service. + type: string type: object appFabricProcessor: description: AppFabricProcessor is specification for the CDAP app-fabric