File tree Expand file tree Collapse file tree 7 files changed +19
-8
lines changed Expand file tree Collapse file tree 7 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -832,6 +832,9 @@ spec:
832832 items :
833833 type : string
834834 type : array
835+ imageCacheSize :
836+ default : " "
837+ type : string
835838 networkAttachments :
836839 items :
837840 type : string
@@ -961,6 +964,7 @@ spec:
961964 type : string
962965 required :
963966 - containerImage
967+ - imageCacheSize
964968 - storageRequest
965969 type : object
966970 type : object
Original file line number Diff line number Diff line change @@ -107,6 +107,10 @@ type GlanceAPITemplate struct {
107107 // +operator-sdk:csv:customresourcedefinitions:type=spec
108108 // TLS - Parameters related to the TLS
109109 TLS tls.API `json:"tls,omitempty"`
110+
111+ // ImageCacheSize, provides the size of the cache that will be reflected in the image_cache_max_size parameter
112+ // +kubebuilder:default=""
113+ ImageCacheSize string `json:"imageCacheSize"`
110114}
111115
112116// APIOverrideSpec to override the generated manifest of several child resources.
Original file line number Diff line number Diff line change @@ -77,10 +77,6 @@ type GlanceAPISpec struct {
7777 // QuotaEnforce if true, per-tenant quotas are enforced according to the
7878 // registered keystone limits
7979 Quota bool `json:"quota"`
80-
81- // ImageCacheSize, provides the size of the cache that will be reflected in the image_cache_max_size parameter
82- // +kubebuilder:default=""
83- ImageCacheSize string `json:"imageCacheSize"`
8480}
8581
8682// GlanceAPIStatus defines the observed state of GlanceAPI
Original file line number Diff line number Diff line change @@ -832,6 +832,9 @@ spec:
832832 items :
833833 type : string
834834 type : array
835+ imageCacheSize :
836+ default : " "
837+ type : string
835838 networkAttachments :
836839 items :
837840 type : string
@@ -961,6 +964,7 @@ spec:
961964 type : string
962965 required :
963966 - containerImage
967+ - imageCacheSize
964968 - storageRequest
965969 type : object
966970 type : object
Original file line number Diff line number Diff line change @@ -813,13 +813,17 @@ func (r *GlanceReconciler) apiDeploymentCreateOrUpdate(
813813 ServiceUser : instance .Spec .ServiceUser ,
814814 ServiceAccount : instance .RbacResourceName (),
815815 Quota : instance .IsQuotaEnabled (),
816- ImageCacheSize : instance .Spec .ImageCacheSize ,
817816 }
818817
819818 if apiSpec .GlanceAPITemplate .NodeSelector == nil {
820819 apiSpec .GlanceAPITemplate .NodeSelector = instance .Spec .NodeSelector
821820 }
822821
822+ // Inherit the ImageCacheSize from the top level if not specified
823+ if apiSpec .GlanceAPITemplate .ImageCacheSize == "" {
824+ apiSpec .GlanceAPITemplate .ImageCacheSize = instance .Spec .ImageCacheSize
825+ }
826+
823827 // Inherit the values required for PVC creation from the top-level CR
824828 apiSpec .GlanceAPITemplate .StorageRequest = instance .Spec .StorageRequest
825829 apiSpec .GlanceAPITemplate .StorageClass = instance .Spec .StorageClass
Original file line number Diff line number Diff line change @@ -283,7 +283,7 @@ func GetHttpdVolumeMount() []corev1.VolumeMount {
283283func GetCacheVolume (pvcName string ) []corev1.Volume {
284284 return []corev1.Volume {
285285 {
286- Name : "image -cache" ,
286+ Name : "glance -cache" ,
287287 VolumeSource : corev1.VolumeSource {
288288 PersistentVolumeClaim : & corev1.PersistentVolumeClaimVolumeSource {
289289 ClaimName : pvcName ,
@@ -297,7 +297,7 @@ func GetCacheVolume(pvcName string) []corev1.Volume {
297297func GetCacheVolumeMount () []corev1.VolumeMount {
298298 return []corev1.VolumeMount {
299299 {
300- Name : "image -cache" ,
300+ Name : "glance -cache" ,
301301 MountPath : ImageCacheDir ,
302302 ReadOnly : false ,
303303 },
Original file line number Diff line number Diff line change @@ -131,7 +131,6 @@ func StatefulSet(
131131 // If cache is provided, we expect the main glance_controller to request a
132132 // PVC that should be used for that purpose (according to ImageCacheSize)
133133 if len (instance .Spec .ImageCacheSize ) > 0 {
134- apiVolumes = append (apiVolumes , glance .GetCacheVolume (glance .ServiceName + "-cache" )... )
135134 apiVolumeMounts = append (apiVolumeMounts , glance .GetCacheVolumeMount ()... )
136135 }
137136
You can’t perform that action at this time.
0 commit comments