Skip to content
This repository has been archived by the owner on Apr 27, 2020. It is now read-only.

Add support for Kubernetes 1.14 #68

Merged
merged 1 commit into from
Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -79,7 +80,7 @@ resource_types:
type: docker-image
source:
repository: zlabjp/kubernetes-resource
tag: "1.13"
tag: "1.14"

resources:
- name: kubernetes-production
Expand Down
54 changes: 53 additions & 1 deletion ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ci/pipeline.yml.erb
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 2 additions & 0 deletions test/helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ assert_success() {
if [[ "$status" != 0 ]]; then
echo "expected: 0"
echo "actual: $status"
echo "output: $output"
return 1
fi
}
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions test/suite.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down