From 0227b82358c7eec61622a9096cce38ff614b7397 Mon Sep 17 00:00:00 2001 From: Kazuki Suda Date: Wed, 27 Mar 2019 17:47:39 +0900 Subject: [PATCH] Add support for Kubernetes 1.14 --- .travis.yml | 6 ++--- README.md | 3 ++- ci/pipeline.yml | 54 ++++++++++++++++++++++++++++++++++++++++++++- ci/pipeline.yml.erb | 2 +- test/helper.bash | 2 ++ test/suite.bats | 4 ++-- 6 files changed, 63 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 61194a7..8a0d5a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,13 @@ language: go go: -- "1.11.x" +- "1.12.x" env: matrix: - - KUBECTL_VERSION=v1.13.0 NODE_VERSION=v1.12.3 # v1.13.x hasn't been released yet + - KUBECTL_VERSION=v1.14.0 NODE_VERSION=v1.14.0 + - KUBECTL_VERSION=v1.13.0 NODE_VERSION=v1.13.3 - KUBECTL_VERSION=v1.12.0 NODE_VERSION=v1.12.3 - - KUBECTL_VERSION=v1.11.0 NODE_VERSION=v1.11.3 services: - docker diff --git a/README.md b/README.md index 5e35f81..9bde664 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ A Concourse resource for controlling the Kubernetes cluster. The version of this resource corresponds to the version of kubectl. We recommend using different version depending on the kubernetes version of the cluster. + - `zlabjp/kubernetes-resource:1.14` ([stable-1.14](https://storage.googleapis.com/kubernetes-release/release/stable-1.14.txt)) - `zlabjp/kubernetes-resource:1.13` ([stable-1.13](https://storage.googleapis.com/kubernetes-release/release/stable-1.13.txt)) - `zlabjp/kubernetes-resource:1.12` ([stable-1.12](https://storage.googleapis.com/kubernetes-release/release/stable-1.12.txt)) - `zlabjp/kubernetes-resource:1.11` ([stable-1.11](https://storage.googleapis.com/kubernetes-release/release/stable-1.11.txt)) @@ -79,7 +80,7 @@ resource_types: type: docker-image source: repository: zlabjp/kubernetes-resource - tag: "1.13" + tag: "1.14" resources: - name: kubernetes-production diff --git a/ci/pipeline.yml b/ci/pipeline.yml index a17d6f3..e7e6dcb 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -4,7 +4,7 @@ # DO NOT MAKE CHANGES TO THIS FILE. Instead, modify ci/pipeline.yml.erb and # execute build-pipeline-yml. # -# created: 2019-01-10T14:27:08+09:00 +# created: 2019-04-01T13:26:45+09:00 # resource_types: - name: slack-notification @@ -108,6 +108,14 @@ resources: username: ((docker-username)) password: ((docker-password)) +- name: kubernetes-resource-image-1.14 + type: docker-image + source: + repository: zlabjp/kubernetes-resource + tag: "1.14" + username: ((docker-username)) + password: ((docker-password)) + - name: kubernetes-resource-image-latest type: docker-image source: @@ -174,6 +182,12 @@ resources: url: https://storage.googleapis.com/kubernetes-release/release/stable-1.13.txt filename: version +- name: stable-1.14 + type: file-url + source: + url: https://storage.googleapis.com/kubernetes-release/release/stable-1.14.txt + filename: version + - name: latest type: file-url source: @@ -525,6 +539,44 @@ jobs: text: | Failure! $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME +- name: build-kubernetes-resource-image-1.14 + public: true + serial: true + plan: + - do: + - aggregate: + - get: kubernetes-resource-release + trigger: true + - get: ubuntu-18.04 + params: {save: true} + trigger: true + - get: stable-1.14 + trigger: true + - task: build-build-args-file + file: kubernetes-resource-release/ci/tasks/build-build-args-file.yml + input_mapping: {version: stable-1.14} + - put: kubernetes-resource-image-1.14 + params: + build: kubernetes-resource-release + load_base: ubuntu-18.04 + build_args_file: output/build-args-file + on_success: + put: notify + params: + channel: ((slack-success-channel)) + username: concourse / kubernetes-resource-image-1.14 + icon_emoji: ":dancing-penguin:" + text: | + Success! $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME + on_failure: + put: notify + params: + channel: ((slack-failure-channel)) + username: concourse / kubernetes-resource-image-1.14 + icon_emoji: ":rage:" + text: | + Failure! $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME + - name: build-kubernetes-resource-image-latest public: true serial: true diff --git a/ci/pipeline.yml.erb b/ci/pipeline.yml.erb index 5edac64..fba2fbc 100644 --- a/ci/pipeline.yml.erb +++ b/ci/pipeline.yml.erb @@ -1,5 +1,5 @@ <% - kubernetes_versions = %w(stable-1.6 stable-1.7 stable-1.8 stable-1.9 stable-1.10 stable-1.11 stable-1.12 stable-1.13 latest) + kubernetes_versions = %w(stable-1.6 stable-1.7 stable-1.8 stable-1.9 stable-1.10 stable-1.11 stable-1.12 stable-1.13 stable-1.14 latest) def tag(version); version.sub(/^stable-/, ''); end def image_resource_name(version); "kubernetes-resource-image-" + tag(version); end diff --git a/test/helper.bash b/test/helper.bash index 7439aad..d9b16ee 100644 --- a/test/helper.bash +++ b/test/helper.bash @@ -4,6 +4,7 @@ assert_success() { if [[ "$status" != 0 ]]; then echo "expected: 0" echo "actual: $status" + echo "output: $output" return 1 fi } @@ -12,6 +13,7 @@ assert_failure() { if [[ "$status" == 0 ]]; then echo "expected: non-zero exit codde" echo "actual: $status" + echo "output: $output" return 1 fi } diff --git a/test/suite.bats b/test/suite.bats index e02f6fc..3babe2b 100644 --- a/test/suite.bats +++ b/test/suite.bats @@ -47,9 +47,9 @@ teardown() { } @test "with source.kubeconfig" { - run assets/out <<< "$(jq -n '{"source": {"kubeconfig": $kubeconfig}, "params": {"kubectl": $kubectl}}' \ + run assets/out <<< "$(jq -n '{"source": {"kubeconfig": $kubeconfig}, "params": {"kubectl": $kubectl, "wait_until_ready": 60}}' \ --arg kubeconfig "$(cat "$kubeconfig_file")" \ - --arg kubectl "run nginx --image nginx")" + --arg kubectl "create deployment nginx --image nginx")" assert_match 'deployment.apps/nginx created' "$output" assert_success }