kubernetes-deploy 0.20.3 → 0.20.4

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: 73125d92c7edc8d3142ce9b995c4fe41bf8b1e49
4
- data.tar.gz: 8943574aab76cfe9f03ff27236a666a64ec57ec9
3
+ metadata.gz: f0b4318bc1b5546351e5aaaa8a2e5a40675349c6
4
+ data.tar.gz: 3f4df1e8c2010d668118fae08a15de4ab21b67b3
5
5
  SHA512:
6
- metadata.gz: 4525f78d274caf4a18b5412f5ec8ade338248751df8b60a9a149052481103191d6c610d829eec3e11b92992980b936f24dd819d6db21636c5c32cbda2dcafb02
7
- data.tar.gz: b7650e855730492bb34fd9b1f431a47118c560b7567770d86f379f683b3fd929284ac787192fae6610b51ece6b585ce8cb8780bac321070f2cee26740128e4df
6
+ metadata.gz: db3e58f8c6ae85a41a436f24068a03d7312df2080a62ab05abb818f5723b07e7875be5d3a7af95f56edf67d5f4be5cff5536a2506465152f205f49c32b5686e5
7
+ data.tar.gz: 3093b949fa36286f03548c3e91ebbc0378d27dafd922b7677dd7b902b9288fee2e8e2120306b3eaccd70f74337ddf2713842457445410b4fd77ee6030191aa97
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ### Master
2
2
 
3
+ ### 0.20.4
4
+ - Don't consider pod preempting a failure ([#317](https://github.com/shopify/kubernetes-deploy/pull/317))
5
+
3
6
  ### 0.20.3
4
7
  *Enhancements*
5
8
  - Evictions are recoverable so prevent them from triggering fast failure detection ([#293](https://github.com/Shopify/kubernetes-deploy/pull/293)).
data/README.md CHANGED
@@ -14,7 +14,7 @@ Especially in a CI/CD environment, we need a clear, actionable pass/fail result
14
14
 
15
15
  :closed_lock_with_key: [Creates Kubernetes secrets from encrypted EJSON](#deploying-kubernetes-secrets-from-ejson), which you can safely commit to your repository
16
16
 
17
- ​:running: [Runs tasks at the beginning of the deploy](#deploy-time-tasks) using bare pods (example use case: Rails migrations)
17
+ ​:running: [Running tasks at the beginning of a deploy](#running-tasks-at-the-beginning-of-a-deploy) using bare pods (example use case: Rails migrations)
18
18
 
19
19
  This repo also includes related tools for [running tasks](#kubernetes-run) and [restarting deployments](#kubernetes-restart).
20
20
 
@@ -4,6 +4,10 @@ module KubernetesDeploy
4
4
  TIMEOUT = 10.minutes
5
5
 
6
6
  FAILED_PHASE_NAME = "Failed"
7
+ TRANSIENT_FAILURE_REASONS = %w(
8
+ Evicted
9
+ Preempting
10
+ )
7
11
 
8
12
  def initialize(namespace:, context:, definition:, logger:,
9
13
  statsd_tags: nil, parent: nil, deploy_started_at: nil)
@@ -57,7 +61,7 @@ module KubernetesDeploy
57
61
  end
58
62
 
59
63
  def failure_message
60
- if phase == FAILED_PHASE_NAME && reason != "Evicted"
64
+ if phase == FAILED_PHASE_NAME && !TRANSIENT_FAILURE_REASONS.include?(reason)
61
65
  phase_problem = "Pod status: #{status}. "
62
66
  end
63
67
 
@@ -7,8 +7,12 @@ module KubernetesDeploy
7
7
  SYNC_DEPENDENCIES = %w(Deployment Service)
8
8
  def sync(mediator)
9
9
  super
10
- @deployment = mediator.get_instance(Deployment.kind, "redis-#{redis_resource_uuid}")
11
- @service = mediator.get_instance(Service.kind, "redis-#{redis_resource_uuid}")
10
+
11
+ @deployment = mediator.get_instance(Deployment.kind, name)
12
+ @deployment = mediator.get_instance(Deployment.kind, deprecated_name) if @deployment.empty?
13
+
14
+ @service = mediator.get_instance(Service.kind, name)
15
+ @service = mediator.get_instance(Service.kind, deprecated_name) if @service.empty?
12
16
  end
13
17
 
14
18
  def status
@@ -41,6 +45,14 @@ module KubernetesDeploy
41
45
  @service.dig("spec", "clusterIP").present?
42
46
  end
43
47
 
48
+ def name
49
+ @definition.dig('metadata', 'name')
50
+ end
51
+
52
+ def deprecated_name
53
+ "redis-#{redis_resource_uuid}"
54
+ end
55
+
44
56
  def redis_resource_uuid
45
57
  return unless @instance_data.present?
46
58
  @instance_data.dig("metadata", "uid")
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module KubernetesDeploy
3
- VERSION = "0.20.3"
3
+ VERSION = "0.20.4"
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.20.3
4
+ version: 0.20.4
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: 2018-06-19 00:00:00.000000000 Z
12
+ date: 2018-07-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport