@@ -73,22 +73,23 @@ class RegistryService {
7373 }
7474
7575 async deployRegistry ( registryLocation : string , forceDeploy = false ) {
76- const deployments = await k3s . apps . listNamespacedDeployment ( BUILD_NAMESPACE ) ;
77- if ( deployments . body . items . length > 0 && ! forceDeploy ) {
78- return ;
79- }
80-
8176 const useLocalStorage = registryLocation === Constants . INTERNAL_REGISTRY_LOCATION ;
8277 const s3Target = useLocalStorage ? undefined : await s3TargetService . getById ( registryLocation ! ) ;
8378
84-
85- console . log ( "(Re)deploying registry because it is not deployed or forced..." ) ;
86- console . log ( `Registry storage location is set to ${ registryLocation } .` ) ;
8779 console . log ( "Ensuring namespace is created..." ) ;
8880 await namespaceService . createNamespaceIfNotExists ( BUILD_NAMESPACE ) ;
8981
82+ // Always update the ConfigMap so storage settings are never stale
9083 await this . createOrUpdateRegistryConfigMap ( s3Target ) ;
9184
85+ const deployments = await k3s . apps . listNamespacedDeployment ( BUILD_NAMESPACE ) ;
86+ if ( deployments . body . items . length > 0 && ! forceDeploy ) {
87+ return ;
88+ }
89+
90+ console . log ( "(Re)deploying registry because it is not deployed or forced..." ) ;
91+ console . log ( `Registry storage location is set to ${ registryLocation } .` ) ;
92+
9293 if ( useLocalStorage ) {
9394 await this . createPersistenvColumeCLaim ( ) ;
9495 }
@@ -224,7 +225,7 @@ class RegistryService {
224225 containers : [
225226 {
226227 name : deploymentName ,
227- image : 'registry:latest ' ,
228+ image : 'registry:2.8 ' ,
228229 volumeMounts : [
229230 ...localStorageVolumeMount ,
230231 {
@@ -314,7 +315,6 @@ http:
314315`
315316 } ,
316317 } ;
317-
318318 const existingConfigMaps = await k3s . core . listNamespacedConfigMap ( BUILD_NAMESPACE ) ;
319319 if ( existingConfigMaps . body . items . find ( cm => cm . metadata ?. name === REGISTRY_CONFIG_MAP_NAME ) ) {
320320 console . log ( "ConfigMap already exists, deleting and recreating..." ) ;
0 commit comments