Skip to content

Commit

Permalink
Merge pull request #34 from ToxicWar/feature/fix-secret-config-ext
Browse files Browse the repository at this point in the history
Add `.yml` extension in secret config
  • Loading branch information
ToxicWar authored Dec 6, 2017
2 parents ba0e68f + 4f9d4d8 commit 3e9966f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions apsconnectcli/apsconnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,6 @@ def _create_secret(name, data_format, data, api, namespace='default', force=Fals

if data_format == 'json':
config = json.dumps(data, ensure_ascii=False)

elif data_format == 'yaml':
config = yaml.dump(data, allow_unicode=True, default_flow_style=False)
else:
Expand All @@ -708,7 +707,7 @@ def _create_secret(name, data_format, data, api, namespace='default', force=Fals
secret = {
'apiVersion': 'v1',
'data': {
'config': base64.b64encode(_to_bytes(config)).decode(),
'config.yml': base64.b64encode(_to_bytes(config)).decode(),
},
'kind': 'Secret',
'metadata': {
Expand Down Expand Up @@ -762,7 +761,7 @@ def _create_deployment(name, image, api, healthcheck_path='/', replicas=2,
'env': [
{
'name': 'CONFIG_FILE',
'value': '/config/config',
'value': '/config/config.yml',
},
],
'livenessProbe': {
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
setup(
name='apsconnectcli',
author='Ingram Micro',
version='1.7.15',
version='1.7.16',
keywords='aps apsconnect connector automation',
extras_require={
':python_version<="2.7"': ['backports.tempfile==1.0']},
Expand Down
4 changes: 2 additions & 2 deletions tests/test_apsconnect_internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _create_secret_dict(self, name, config):
return {
'apiVersion': 'v1',
'data': {
'config': base64.b64encode(_to_bytes(config)).decode(),
'config.yml': base64.b64encode(_to_bytes(config)).decode(),
},
'kind': 'Secret',
'metadata': {
Expand Down Expand Up @@ -229,7 +229,7 @@ def _create_test_body(self, name, replicas, image, healthcheck_path):
'env': [
{
'name': 'CONFIG_FILE',
'value': '/config/config',
'value': '/config/config.yml',
},
],
'livenessProbe': {
Expand Down

0 comments on commit 3e9966f

Please sign in to comment.