kubernetes-deploy 0.12.6 → 0.12.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30e7fe8de60782a48c2a07c64744f39c5b0f991d
4
- data.tar.gz: 7ab5e12db39d05c5b5a881db0b8a955c5e74ee70
3
+ metadata.gz: 354e84986f12ef307946408879b5c6d181a273fc
4
+ data.tar.gz: bc326119695e2d3bdc202d5f34af02b96787c197
5
5
  SHA512:
6
- metadata.gz: b56c3a7fce60ad02ed740205468b0c0dc6a9e038b43dd0459b6e93ec7f835aaa2d80f9dd826416e91f62f672bf403767dcfad67dbd7d84d8df1967cfee9a6a70
7
- data.tar.gz: 0c03d3ca4a194ac8ec3bb864e44d4395df059111c58a1f28d39ab19782eecc9faab64dcc5eb1b599d4cdf8b74b43f33396dfb93335dcfe1f62a768231a86ce65
6
+ metadata.gz: '09ed8b6ff1a64e0a1e23e2b575bd29ab39e6d16608cb002f44158aaf92761344ead3b0ff0295322d30c2d009e03687af569085212973a228e0f3dcb899da55a9'
7
+ data.tar.gz: ba9e47d26b21cb351e3b4971f4fa2e1bc4a30ff029b7917e8448171463d6938631341f8d3ea7ab8f5d6eb669a32be844c50ba5f1cc3e41391e3f6b703fb57bce
data/bin/ci CHANGED
@@ -10,7 +10,7 @@ docker run --rm \
10
10
  -v "$HOME/.kube":/"$HOME/.kube" \
11
11
  -v "$HOME/.minikube":/"$HOME/.minikube" \
12
12
  -v "$PWD":/usr/src/app \
13
- -v "/usr/local/google-cloud-sdk/bin/kubectl":"/usr/bin/kubectl" \
13
+ -v "/usr/bin/minikube/kubectl":"/usr/bin/kubectl" \
14
14
  -e CI=1 \
15
15
  -e CODECOV_TOKEN=$CODECOV_TOKEN \
16
16
  -e COVERAGE=1 \
@@ -2,16 +2,16 @@
2
2
  module KubernetesDeploy
3
3
  class Memcached < KubernetesResource
4
4
  TIMEOUT = 5.minutes
5
- SECRET_NAME = "memcached-url"
5
+ CONFIGMAP_NAME = "memcached-url"
6
6
 
7
7
  def sync
8
8
  _, _err, st = kubectl.run("get", type, @name)
9
9
  @found = st.success?
10
10
  @deployment_exists = memcached_deployment_exists?
11
11
  @service_exists = memcached_service_exists?
12
- @secret_exists = memcached_secret_exists?
12
+ @configmap_exists = memcached_configmap_exists?
13
13
 
14
- @status = if @deployment_exists && @service_exists && @secret_exists
14
+ @status = if @deployment_exists && @service_exists && @configmap_exists
15
15
  "Provisioned"
16
16
  else
17
17
  "Unknown"
@@ -19,7 +19,7 @@ module KubernetesDeploy
19
19
  end
20
20
 
21
21
  def deploy_succeeded?
22
- @deployment_exists && @service_exists && @secret_exists
22
+ @deployment_exists && @service_exists && @configmap_exists
23
23
  end
24
24
 
25
25
  def deploy_failed?
@@ -33,26 +33,22 @@ module KubernetesDeploy
33
33
  private
34
34
 
35
35
  def memcached_deployment_exists?
36
- deployments, _err, st = kubectl.run("get", "deployments", "-l name=#{@name}", "-o=json")
36
+ deployment, _err, st = kubectl.run("get", "deployments", "memcached-#{@name}", "-o=json")
37
37
  return false unless st.success?
38
- parsed = JSON.parse(deployments)
39
- return false if parsed.fetch("items", []).count == 0
40
- deployment = parsed.fetch("items", []).first
41
- status = deployment.fetch("status", {})
38
+ parsed = JSON.parse(deployment)
39
+ status = parsed.fetch("status", {})
42
40
  status.fetch("availableReplicas", -1) == status.fetch("replicas", 0)
43
41
  end
44
42
 
45
43
  def memcached_service_exists?
46
- services, _err, st = kubectl.run("get", "services", "-l name=#{@name}", "-o=json")
44
+ service, _err, st = kubectl.run("get", "services", "memcached-#{@name}", "-o=json")
47
45
  return false unless st.success?
48
- parsed = JSON.parse(services)
49
- return false if parsed.fetch("items", []).count == 0
50
- service = parsed.fetch("items", []).first
51
- service.dig("spec", "clusterIP").present?
46
+ parsed = JSON.parse(service)
47
+ parsed.dig("spec", "clusterIP").present?
52
48
  end
53
49
 
54
- def memcached_secret_exists?
55
- secret, _err, st = kubectl.run("get", "secrets", SECRET_NAME, "-o=json")
50
+ def memcached_configmap_exists?
51
+ secret, _err, st = kubectl.run("get", "configmaps", CONFIGMAP_NAME, "-o=json")
56
52
  return false unless st.success?
57
53
  parsed = JSON.parse(secret)
58
54
  parsed.dig("data", @name).present?
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module KubernetesDeploy
3
- VERSION = "0.12.6"
3
+ VERSION = "0.12.7"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubernetes-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.6
4
+ version: 0.12.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Verey
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-10-03 00:00:00.000000000 Z
12
+ date: 2017-10-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -263,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
263
  version: '0'
264
264
  requirements: []
265
265
  rubyforge_project:
266
- rubygems_version: 2.5.2
266
+ rubygems_version: 2.5.2.1
267
267
  signing_key:
268
268
  specification_version: 4
269
269
  summary: Kubernetes deploy scripts