|
@@ -1571,6 +1571,18 @@ spec:
|
|
|
|
|
|
return False
|
|
|
|
|
|
+ def get_env_var(self, key):
|
|
|
+ '''return a environment variables '''
|
|
|
+ results = self.get(DeploymentConfig.env_path) or []
|
|
|
+ if not results:
|
|
|
+ return None
|
|
|
+
|
|
|
+ for env_var in results:
|
|
|
+ if env_var['name'] == key:
|
|
|
+ return env_var
|
|
|
+
|
|
|
+ return None
|
|
|
+
|
|
|
def get_env_vars(self):
|
|
|
'''return a environment variables '''
|
|
|
return self.get(DeploymentConfig.env_path) or []
|
|
@@ -1655,18 +1667,6 @@ spec:
|
|
|
|
|
|
return None
|
|
|
|
|
|
- def get_env_var(self, key):
|
|
|
- '''return a environment variables '''
|
|
|
- results = self.get(DeploymentConfig.env_path) or []
|
|
|
- if not results:
|
|
|
- return None
|
|
|
-
|
|
|
- for env_var in results:
|
|
|
- if env_var['name'] == key:
|
|
|
- return env_var
|
|
|
-
|
|
|
- return None
|
|
|
-
|
|
|
def get_replicas(self):
|
|
|
''' return replicas setting '''
|
|
|
return self.get(DeploymentConfig.replicas_path)
|
|
@@ -2369,9 +2369,10 @@ class Registry(OpenShiftCLI):
|
|
|
# The environment variable for REGISTRY_HTTP_SECRET is autogenerated
|
|
|
# We should set the generated deploymentconfig to the in memory version
|
|
|
# the following modifications will overwrite if needed
|
|
|
- result = self.deploymentconfig.get_env_var('REGISTRY_HTTP_SECRET')
|
|
|
- if result:
|
|
|
- deploymentconfig.update_env_var('REGISTRY_HTTP_SECRET', result['value'])
|
|
|
+ if self.deploymentconfig:
|
|
|
+ result = self.deploymentconfig.get_env_var('REGISTRY_HTTP_SECRET')
|
|
|
+ if result:
|
|
|
+ deploymentconfig.update_env_var('REGISTRY_HTTP_SECRET', result['value'])
|
|
|
|
|
|
# Currently we know that our deployment of a registry requires a few extra modifications
|
|
|
# Modification 1
|