Skip to content

Commit

Permalink
bumping Crystal & KCE ver, better error msg
Browse files Browse the repository at this point in the history
Signed-off-by: Anastas Dancha <[email protected]>
  • Loading branch information
anapsix committed Jun 10, 2021
1 parent 2c8620d commit 83a76f6
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 7 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]


## [0.4.1] - 2021-06-10
### Changed
- using newer version of Crystal
- bumped to KCE v0.6.1

### Fixed
- log user-friendly error when requested context is not found in KUBECONFIG


## [0.4.0] - 2021-02-17
### Added
- `CHANGELOG.md`
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
## this stage installs everything required to build the project
FROM alpine:3.13 as build
RUN apk add --no-cache musl-dev yaml-static crystal shards upx
RUN apk add --no-cache musl-dev yaml-static upx && \
apk add --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main \
llvm11-libs && \
apk add --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \
crystal shards
WORKDIR /tmp
COPY VERSION .
COPY shard.yml .
COPY k8s-vault_example.yaml .
COPY k8s-vault-completion.bash .
COPY ./src ./src
RUN \
shards install --production && \
shards install && \
crystal build --progress --release --static src/cli.cr -o /tmp/k8s-vault && \
upx /tmp/k8s-vault && \
echo >&2 "## Version check: $(/tmp/k8s-vault -v)" && \
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.0
0.4.1
2 changes: 1 addition & 1 deletion k8s-vault_example.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "0.4.0"
version: "0.4.1"
k8s_api_timeout: 5 # in seconds
ssh_forwarding_port:
random: true
Expand Down
6 changes: 3 additions & 3 deletions shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: k8s-vault
version: 0.4.0
version: 0.4.1

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

authors:
- Anastas Dancha <[email protected]>
Expand All @@ -17,5 +17,5 @@ targets:
k8s-vault:
main: src/cli.cr

crystal: ~> 0.36.1
crystal: '>= 0.36.1'
license: MIT
4 changes: 4 additions & 0 deletions src/k8s-vault.cr
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ module K8sVault
K8sVault::Log.error "unable to parse config file at #{K8sVault::K8SVAULT_CONFIG}"
cleanup
exit 1
rescue KCE::Exceptions::ContextMissingError
K8sVault::Log.error "\"#{kubecontext}\" context is not found in KUBECONFIG (#{K8sVault::KUBECONFIG})"
cleanup
exit 1
rescue ex
K8sVault::Log.debug "#{ex.message} (#{ex.class})"
K8sVault::Log.error "unexpected error"
Expand Down

0 comments on commit 83a76f6

Please sign in to comment.