Skip to content

Commit 83a76f6

Browse files
committed
bumping Crystal & KCE ver, better error msg
Signed-off-by: Anastas Dancha <anapsix@random.io>
1 parent 2c8620d commit 83a76f6

File tree

6 files changed

+24
-7
lines changed

6 files changed

+24
-7
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010

11+
## [0.4.1] - 2021-06-10
12+
### Changed
13+
- using newer version of Crystal
14+
- bumped to KCE v0.6.1
15+
16+
### Fixed
17+
- log user-friendly error when requested context is not found in KUBECONFIG
18+
19+
1120
## [0.4.0] - 2021-02-17
1221
### Added
1322
- `CHANGELOG.md`

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
## this stage installs everything required to build the project
22
FROM alpine:3.13 as build
3-
RUN apk add --no-cache musl-dev yaml-static crystal shards upx
3+
RUN apk add --no-cache musl-dev yaml-static upx && \
4+
apk add --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main \
5+
llvm11-libs && \
6+
apk add --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \
7+
crystal shards
48
WORKDIR /tmp
59
COPY VERSION .
610
COPY shard.yml .
711
COPY k8s-vault_example.yaml .
812
COPY k8s-vault-completion.bash .
913
COPY ./src ./src
1014
RUN \
11-
shards install --production && \
15+
shards install && \
1216
crystal build --progress --release --static src/cli.cr -o /tmp/k8s-vault && \
1317
upx /tmp/k8s-vault && \
1418
echo >&2 "## Version check: $(/tmp/k8s-vault -v)" && \

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.0
1+
0.4.1

k8s-vault_example.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "0.4.0"
1+
version: "0.4.1"
22
k8s_api_timeout: 5 # in seconds
33
ssh_forwarding_port:
44
random: true

shard.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: k8s-vault
2-
version: 0.4.0
2+
version: 0.4.1
33

44
description: |
55
k8s-vault makes it easy to reach K8s API via jumphost, using SSH port forwarding.
@@ -8,7 +8,7 @@ dependencies:
88
kce:
99
# path: ../kce.cr
1010
github: anapsix/kce.cr
11-
version: ~> 0.6.0
11+
version: '~> 0.6'
1212

1313
authors:
1414
- Anastas Dancha <anapsix@random.io>
@@ -17,5 +17,5 @@ targets:
1717
k8s-vault:
1818
main: src/cli.cr
1919

20-
crystal: ~> 0.36.1
20+
crystal: '>= 0.36.1'
2121
license: MIT

src/k8s-vault.cr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@ module K8sVault
280280
K8sVault::Log.error "unable to parse config file at #{K8sVault::K8SVAULT_CONFIG}"
281281
cleanup
282282
exit 1
283+
rescue KCE::Exceptions::ContextMissingError
284+
K8sVault::Log.error "\"#{kubecontext}\" context is not found in KUBECONFIG (#{K8sVault::KUBECONFIG})"
285+
cleanup
286+
exit 1
283287
rescue ex
284288
K8sVault::Log.debug "#{ex.message} (#{ex.class})"
285289
K8sVault::Log.error "unexpected error"

0 commit comments

Comments
 (0)