Skip to content

Commit

Permalink
Merge pull request #37 from stat-kwon/master
Browse files Browse the repository at this point in the history
Add image_pull_secrets field in labels of plugin_info
  • Loading branch information
stat-kwon authored Oct 25, 2023
2 parents 38f8fd3 + 43f17ce commit 79782f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/spaceone/supervisor/connector/kubernetes_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ def _create_deployment(self, image, name, labels):
if _image_pull_secrets := self.config.get('imagePullSecrets'):
deployment['spec']['template']['spec']['imagePullSecrets'] = _image_pull_secrets

if _image_pull_secrets := labels.get('spaceone.supervisor.plugin.image_pull_secrets'):
deployment['spec']['template']['spec']['imagePullSecrets'] = [{"name": _image_pull_secrets}]

if _volumes := self.config.get('volumes'):
deployment['spec']['template']['spec']['volumes'] = _volumes

Expand Down
4 changes: 4 additions & 0 deletions src/spaceone/supervisor/service/supervisor_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ def install_plugin(self, params):
'spaceone.supervisor.plugin.version': params['version'],
'spaceone.supervisor.plugin.service_type': plugin_info.service_type
}

if image_pull_secrets := plugin_info.registry_config.get('image_pull_secrets'):
labels.update({'spaceone.supervisor.plugin.image_pull_secrets': image_pull_secrets})

# Determine port mapping
host_port = self._supervisor_mgr.find_host_port()
_LOGGER.debug("Choose Host Port: %d" % host_port)
Expand Down

0 comments on commit 79782f0

Please sign in to comment.