Skip to content

Commit

Permalink
Merge pull request #16 from spoved/k8s-v1.28
Browse files Browse the repository at this point in the history
Add K8S v1.28 support
  • Loading branch information
kalinon authored Sep 26, 2023
2 parents 5a58abd + ea41c9f commit 4caf349
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ clean:
@k3d cluster delete k3d-cluster-test

docs: ## Generate docs
@crystal ./bin/gen_docs.cr
@crystal ./support/gen_docs.cr

.PHONY: help spec gen docs clean
4 changes: 2 additions & 2 deletions shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ authors:
repository: "https://github.com/spoved/kube-client.cr"
license: MIT

version: 0.4.7
version: 0.4.8
crystal: ">= 1.4.0, < 2.0.0"

dependencies:
k8s:
github: spoved/k8s.cr
version: "~> 0.1.11"
version: "~> 0.1.12"
spoved:
github: spoved/spoved.cr
db:
Expand Down
6 changes: 6 additions & 0 deletions spec/files/k3d/v1.28.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: k3d.io/v1alpha4
kind: Simple
metadata:
name: k3d-cluster-test
image: docker.io/rancher/k3s:v1.28.1-k3s1
2 changes: 1 addition & 1 deletion src/kube-client.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% begin %}
{% flag_provided = false %}
{% for ver in (11..27) %}
{% for ver in (11..28) %}
{% flag = :k8s_v1 + "." + "#{ver}" %}
{% if flag?(flag) %}
{% flag_provided = true %}
Expand Down
3 changes: 3 additions & 0 deletions src/kube-client/v1.28.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require "./version"
require "k8s/versions/v1.28"
require "../kube/*"
4 changes: 2 additions & 2 deletions src/kube/transport.cr
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ module Kube
@ssl_contxt.private_key = @options[:client_key].not_nil! unless @options[:client_key].nil?
@ssl_contxt.certificate_chain = @options[:client_cert].not_nil! unless @options[:client_cert].nil?
@ssl_contxt.ca_certificates = @options[:ssl_ca_file].not_nil! unless @options[:ssl_ca_file].nil?

@pool = DB::Pool(HTTP::Client).new(max_pool_size: pool_options.pool_capacity, initial_pool_size: pool_options.initial_pool_size, checkout_timeout: pool_options.pool_timeout) do
pool_ops = DB::Pool::Options.new(max_pool_size: pool_options.pool_capacity, initial_pool_size: pool_options.initial_pool_size, checkout_timeout: pool_options.pool_timeout)
@pool = DB::Pool(HTTP::Client).new(pool_ops) do
if @server.scheme == "https"
HTTP::Client.new(uri: @server, tls: @ssl_contxt)
else
Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ jsonpath="{.clusters[?(@.name==\"k3d-${CLUSTER_NAME}\")].cluster.server}"
export KUBE_API_SERVER=$(kubectl config view -o jsonpath="${jsonpath}")

# Gets the token value
export KUBE_TOKEN=$(kubectl get secrets -n kube-system -o jsonpath="{.items[?(@.metadata.annotations['kubernetes\.io/service-account\.name']=='default')].data.token}" | base64 -d)
export KUBE_TOKEN=$(kubectl create token default)
env | egrep "APP_NS|APP_NAME|CLUSTER_NAME|KUBE_" | sort >.env_test

0 comments on commit 4caf349

Please sign in to comment.