Skip to content

Commit 9e2c50c

Browse files
authored
Merge pull request #110 from britive/develop
v1.6.0rc2
2 parents 6d879a2 + 45163d3 commit 9e2c50c

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
* As of v1.4.0 release candidates will be published in an effort to get new features out faster while still allowing time for full QA testing before moving the release candidate to a full release.
44

5+
## v1.6.0rc2 [2023-10-27]
6+
#### What's New
7+
* None
8+
9+
#### Enhancements
10+
* None
11+
12+
#### Bug Fixes
13+
* Fixed bug with auto generated kube config when no alias existed for a profile.
14+
15+
#### Dependencies
16+
* None
17+
18+
#### Other
19+
* None
20+
21+
22+
523
## v1.6.0rc1 [2023-10-25]
624
#### What's New
725
* Initial support for Kubernetes - this functionality is not yet available publicly on the Britive Platform - this is a beta feature for internal use only

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = pybritive
3-
version = 1.6.0rc1
3+
version = 1.6.0rc2
44
author = Britive Inc.
55
author_email = support@britive.com
66
description = A pure Python CLI for Britive

src/pybritive/britive_cli.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -386,13 +386,17 @@ def construct_kube_config(self, from_cache_command=False):
386386
'url': url,
387387
'cert': cert,
388388
})
389-
from .helpers.kube_config_builder import build_kube_config # lazy import as not everyone will want this
390-
build_kube_config(
391-
profiles=profiles,
392-
config=self.config,
393-
username=self.b.my_access.whoami()['username'],
394-
cli=self
395-
)
389+
390+
try:
391+
from .helpers.kube_config_builder import build_kube_config # lazy import as not everyone will want this
392+
build_kube_config(
393+
profiles=profiles,
394+
config=self.config,
395+
username=self.b.my_access.whoami()['username'],
396+
cli=self
397+
)
398+
except Exception as e: # do NOT fail the CLI invocation because of this
399+
self.print(f'error auto-generating the Britive managed kube config file: {str(e)}')
396400

397401
def _get_app_type(self, application_id):
398402
self._set_available_profiles()

src/pybritive/helpers/kube_config_builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def build_tenant_config(tenant, cluster_names, username):
136136
{
137137
'name': 'client.authentication.k8s.io/exec',
138138
'extension': {
139-
'britive-profile': details.get('alias', details['escaped_profile'])
139+
'britive-profile': details.get('alias') or details['escaped_profile']
140140
}
141141
}
142142
]
@@ -146,7 +146,7 @@ def build_tenant_config(tenant, cluster_names, username):
146146

147147
contexts.append(
148148
{
149-
'name': details.get('alias', f'{tenant}-{name}'),
149+
'name': details.get('alias') or f'{tenant}-{name}',
150150
'context': {
151151
'cluster': f'{tenant}-{name}',
152152
'user': username

0 commit comments

Comments
 (0)