Skip to content

Commit 19e6aeb

Browse files
committed
Renaming constant
1 parent c18b9b6 commit 19e6aeb

3 files changed

Lines changed: 9 additions & 11 deletions

File tree

internal/controller/appserver/deployment.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ func GenerateOLSDeployment(r reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) (
389389
Annotations: map[string]string{
390390
utils.OLSConfigMapResourceVersionAnnotation: configMapResourceVersion,
391391
utils.OpenShiftMCPServerConfigMapResourceVersionAnnotation: mcpConfigMapResourceVersion,
392-
utils.ProxyCACertResourceVersionAnnotation: proxyCACMResourceVersion,
392+
utils.ProxyCACertHashAnnotation: proxyCACMResourceVersion,
393393
},
394394
},
395395
Spec: appsv1.DeploymentSpec{
@@ -565,7 +565,7 @@ func updateOLSDeployment(r reconciler.Reconciler, ctx context.Context, cr *olsv1
565565
r.GetLogger().Info("failed to get Proxy CA certificate hash", "error", err)
566566
changed = true
567567
} else {
568-
storedProxyCACMHash := existingDeployment.Annotations[utils.ProxyCACertResourceVersionAnnotation]
568+
storedProxyCACMHash := existingDeployment.Annotations[utils.ProxyCACertHashAnnotation]
569569
if storedProxyCACMHash != currentProxyCACMHash {
570570
r.GetLogger().Info("Proxy CA certificate content changed, updating deployment")
571571
changed = true
@@ -587,7 +587,7 @@ func updateOLSDeployment(r reconciler.Reconciler, ctx context.Context, cr *olsv1
587587

588588
existingDeployment.Annotations[utils.OLSConfigMapResourceVersionAnnotation] = desiredDeployment.Annotations[utils.OLSConfigMapResourceVersionAnnotation]
589589
existingDeployment.Annotations[utils.OpenShiftMCPServerConfigMapResourceVersionAnnotation] = desiredDeployment.Annotations[utils.OpenShiftMCPServerConfigMapResourceVersionAnnotation]
590-
existingDeployment.Annotations[utils.ProxyCACertResourceVersionAnnotation] = currentProxyCACMHash
590+
existingDeployment.Annotations[utils.ProxyCACertHashAnnotation] = currentProxyCACMHash
591591

592592
r.GetLogger().Info("updating OLS deployment", "name", existingDeployment.Name)
593593

internal/controller/lcore/deployment.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ func generateLCoreServerDeployment(r reconciler.Reconciler, ctx context.Context,
997997
utils.LCoreConfigMapResourceVersionAnnotation: lcoreConfigMapResourceVersion,
998998
utils.LlamaStackConfigMapResourceVersionAnnotation: llamaStackConfigMapResourceVersion,
999999
utils.OpenShiftMCPServerConfigMapResourceVersionAnnotation: mcpConfigMapResourceVersion,
1000-
utils.ProxyCACertResourceVersionAnnotation: proxyCACMResourceVersion,
1000+
utils.ProxyCACertHashAnnotation: proxyCACMResourceVersion,
10011001
},
10021002
},
10031003
Spec: appsv1.DeploymentSpec{
@@ -1136,7 +1136,7 @@ func updateLCoreDeployment(r reconciler.Reconciler, ctx context.Context, cr *ols
11361136
r.GetLogger().Info("failed to get Proxy CA certificate hash", "error", err)
11371137
changed = true
11381138
} else {
1139-
storedProxyCACMHash := existingDeployment.Annotations[utils.ProxyCACertResourceVersionAnnotation]
1139+
storedProxyCACMHash := existingDeployment.Annotations[utils.ProxyCACertHashAnnotation]
11401140
if storedProxyCACMHash != currentProxyCACMHash {
11411141
r.GetLogger().Info("Proxy CA certificate content changed, updating deployment")
11421142
changed = true
@@ -1159,7 +1159,7 @@ func updateLCoreDeployment(r reconciler.Reconciler, ctx context.Context, cr *ols
11591159
existingDeployment.Annotations[utils.LCoreConfigMapResourceVersionAnnotation] = desiredDeployment.Annotations[utils.LCoreConfigMapResourceVersionAnnotation]
11601160
existingDeployment.Annotations[utils.LlamaStackConfigMapResourceVersionAnnotation] = desiredDeployment.Annotations[utils.LlamaStackConfigMapResourceVersionAnnotation]
11611161
existingDeployment.Annotations[utils.OpenShiftMCPServerConfigMapResourceVersionAnnotation] = desiredDeployment.Annotations[utils.OpenShiftMCPServerConfigMapResourceVersionAnnotation]
1162-
existingDeployment.Annotations[utils.ProxyCACertResourceVersionAnnotation] = currentProxyCACMHash
1162+
existingDeployment.Annotations[utils.ProxyCACertHashAnnotation] = currentProxyCACMHash
11631163

11641164
r.GetLogger().Info("updating LCore deployment", "name", existingDeployment.Name)
11651165

@@ -1276,7 +1276,7 @@ func generateLCoreLibraryDeployment(r reconciler.Reconciler, ctx context.Context
12761276
utils.LCoreConfigMapResourceVersionAnnotation: lcoreConfigMapResourceVersion,
12771277
utils.LlamaStackConfigMapResourceVersionAnnotation: llamaStackConfigMapResourceVersion,
12781278
utils.OpenShiftMCPServerConfigMapResourceVersionAnnotation: mcpConfigMapResourceVersion,
1279-
utils.ProxyCACertResourceVersionAnnotation: proxyCACMResourceVersion,
1279+
utils.ProxyCACertHashAnnotation: proxyCACMResourceVersion,
12801280
},
12811281
},
12821282
Spec: appsv1.DeploymentSpec{

internal/controller/utils/constants.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,8 @@ const (
107107
OLSConsoleTLSHashKey = "hash/olsconsoletls"
108108
// AdditionalCAHashKey is the key of the hash value of the additional CA certificates in the deployment annotations
109109
AdditionalCAHashKey = "hash/additionalca"
110-
// ProxyCACertResourceVersionAnnotation is the annotation key for tracking Proxy CA certificate content hash.
111-
// Despite the name referencing "ResourceVersion" for backward compatibility, this now stores a SHA256 hash
112-
// of the certificate content to ensure deployments only restart when the cert actually changes.
113-
ProxyCACertResourceVersionAnnotation = "ols.openshift.io/proxy-ca-configmap-version"
110+
// ProxyCACertHashAnnotation is the annotation key for tracking Proxy CA certificate content hash.
111+
ProxyCACertHashAnnotation = "ols.openshift.io/proxy-ca-configmap-version"
114112
// OLSAppServerContainerPort is the port number of the lightspeed-service-api container exposes
115113
OLSAppServerContainerPort = 8443
116114
// OLSAppServerServicePort is the port number for OLS application server service.

0 commit comments

Comments
 (0)