diff --git a/Dockerfile b/Dockerfile index dae4909..8e2b130 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ COPY k8s-vault_example.yaml . COPY k8s-vault-completion.bash . COPY ./src ./src RUN \ - shards install && \ + shards install --production && \ crystal build --progress --release --static src/cli.cr -o /tmp/k8s-vault && \ upx /tmp/k8s-vault && \ echo >&2 "## Version check: $(/tmp/k8s-vault -v)" && \ diff --git a/VERSION b/VERSION index 0ea3a94..0c62199 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.0 +0.2.1 diff --git a/shard.yml b/shard.yml index 5e996f5..f478463 100644 --- a/shard.yml +++ b/shard.yml @@ -1,13 +1,14 @@ name: k8s-vault -version: 0.2.0 +version: 0.2.1 description: | `k8s-vault` makes it easy to reach K8s API via jumphost, using SSH port forwarding. dependencies: kce: + # path: ../kce.cr github: anapsix/kce.cr - version: ~> 0.5.0 + version: ~> 0.6.0 authors: - Anastas Dancha diff --git a/src/k8s-vault.cr b/src/k8s-vault.cr index e8de699..15f27fd 100644 --- a/src/k8s-vault.cr +++ b/src/k8s-vault.cr @@ -32,8 +32,8 @@ module K8sVault end ssh_jump_host = context_config.ssh_jump_host - kubeconfig = KCE.config_obj(target_context: kubecontext, kubeconfig: kubeconfig_path) - cluster_server = kubeconfig["clusters"].first.cluster["server"].to_s + kubeconfig = KCE.config(kubecontext: kubecontext, kubeconfig: kubeconfig_path) + cluster_server = kubeconfig.clusters.first.cluster.server.to_s remote_proto = cluster_server.split(/https?:\/\//).first?.to_s remote_proto = remote_proto.empty? ? "https" : remote_proto remote_host, remote_port = cluster_server.split(/https?:\/\//).last.split(":") @@ -45,9 +45,9 @@ module K8sVault end # update config with values for SSH forwarding - kubeconfig["clusters"].first.cluster.delete("certificate-authority-data") - kubeconfig["clusters"].first.cluster["insecure-skip-tls-verify"] = true - kubeconfig["clusters"].first.cluster["server"] = "#{remote_proto}://127.0.0.1:#{local_port}" + kubeconfig.clusters.first.cluster.certificate_authority_data = nil + kubeconfig.clusters.first.cluster.insecure_skip_tls_verify = true + kubeconfig.clusters.first.cluster.server = "#{remote_proto}://127.0.0.1:#{local_port}" Config.new( config_path: config_path.to_s,