kubernetes-deploy 0.9.0 → 0.9.1

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: 7dea248a33790949829292f8e55958c44bacfc02
4
- data.tar.gz: 95dd54cf01868dcd65f15a3dfe99c606e7913740
3
+ metadata.gz: 10f350d410bd5c15f27b68c18e35c63d8a8ac361
4
+ data.tar.gz: b1dea0ec0e6638bb91b38f73dcf06eae69435ad2
5
5
  SHA512:
6
- metadata.gz: 50cf1550cc2fc26d303f0142ecf8f8515cad66eded851f319cbde3fee512f3039a238eebe7a9a2727637b541e268df8f3e81f740af26c06c05990ce1e6140a2d
7
- data.tar.gz: e7a96a70120f591e67ea4cb6ed96b2933c09bf6f906969380a716c3b96ed16062f861fb09ffba453886778bcfc14dc69e8fc2c01ea0d2abc7295cb567c925a8b
6
+ metadata.gz: 44d974d7f3c78403c43fa8682a1177a806fe675836733412d5ca59d7bb732decce7b38a4fe32c6f8e49bf41eb396265a61b50dd53cadf570677dabd404dd4148
7
+ data.tar.gz: 765a27bf59e8575df9e8cd469535935f74c538d7a4d543ccdb2c695b189300f8403d2019cc5edfa3c2cf29ef137cff4e7e17bf12cbe8d2096a15f56cbaace1ea
data/.gitignore CHANGED
@@ -13,3 +13,4 @@
13
13
 
14
14
  .byebug_history
15
15
  .ruby-version
16
+ coverage/*
data/Gemfile CHANGED
@@ -8,3 +8,4 @@ gem 'pry-byebug'
8
8
  gem 'rubocop'
9
9
  gem 'timecop'
10
10
  gem 'byebug'
11
+ gem 'codecov', require: false, group: :test
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # kubernetes-deploy [![Build status](https://badge.buildkite.com/0f2d4956d49fbc795f9c17b0a741a6aa9ea532738e5f872ac8.svg?branch=master)](https://buildkite.com/shopify/kubernetes-deploy-gem)
1
+ # kubernetes-deploy [![Build status](https://badge.buildkite.com/0f2d4956d49fbc795f9c17b0a741a6aa9ea532738e5f872ac8.svg?branch=master)](https://buildkite.com/shopify/kubernetes-deploy-gem) [![codecov](https://codecov.io/gh/Shopify/kubernetes-deploy/branch/master/graph/badge.svg)](https://codecov.io/gh/Shopify/kubernetes-deploy)
2
2
 
3
3
  `kubernetes-deploy` is a command line tool that helps you ship changes to a Kubernetes namespace and understand the result. At Shopify, we use it within our much-beloved, open-source [Shipit](https://github.com/Shopify/shipit-engine#kubernetes) deployment app.
4
4
 
@@ -71,7 +71,7 @@ module KubernetesDeploy
71
71
  # Example:
72
72
  # # The resulting summary will begin with "Created 3 secrets and failed to deploy 2 resources"
73
73
  # @logger.summary.add_action("created 3 secrets")
74
- # @logger.summary.add_cation("failed to deploy 2 resources")
74
+ # @logger.summary.add_action("failed to deploy 2 resources")
75
75
  def add_action(sentence_fragment)
76
76
  @actions_taken << sentence_fragment
77
77
  end
@@ -184,7 +184,8 @@ module KubernetesDeploy
184
184
  "Failed to start (exit #{exit_code}): #{@status['lastState']['terminated']['message']}"
185
185
  elsif limbo_reason == "CrashLoopBackOff"
186
186
  "Crashing repeatedly (exit #{exit_code}). See logs for more information."
187
- elsif %w(ImagePullBackOff ErrImagePull).include?(limbo_reason) && limbo_message.match("not found")
187
+ elsif %w(ImagePullBackOff ErrImagePull).include?(limbo_reason) &&
188
+ limbo_message.match(/(?:not found)|(?:back-off)/i)
188
189
  "Failed to pull image #{@image}. "\
189
190
  "Did you wait for it to be built and pushed to the registry before deploying?"
190
191
  elsif limbo_message == "Generate Container Config Failed"
@@ -7,10 +7,16 @@ module KubernetesDeploy
7
7
  _, _err, st = kubectl.run("get", type, @name)
8
8
  @found = st.success?
9
9
  @related_deployment_replicas = fetch_related_replica_count
10
- @status = if @num_pods_selected = fetch_related_pod_count
11
- "Selects #{@num_pods_selected} #{'pod'.pluralize(@num_pods_selected)}"
12
- else
10
+ @num_pods_selected = fetch_related_pod_count
11
+ end
12
+
13
+ def status
14
+ if @num_pods_selected.blank?
13
15
  "Failed to count related pods"
16
+ elsif selects_some_pods?
17
+ "Selects at least 1 pod"
18
+ else
19
+ "Selects 0 pods"
14
20
  end
15
21
  end
16
22
 
@@ -157,7 +157,6 @@ module KubernetesDeploy
157
157
 
158
158
  if success_count > 0
159
159
  @logger.summary.add_action("successfully deployed #{success_count} #{'resource'.pluralize(success_count)}")
160
- successful_resources.map(&:sync) # make sure we're printing the latest on resources that succeeded early
161
160
  final_statuses = successful_resources.map(&:pretty_status).join("\n")
162
161
  @logger.summary.add_paragraph("#{ColorizedString.new('Successful resources').green}\n#{final_statuses}")
163
162
  end
@@ -417,7 +416,7 @@ module KubernetesDeploy
417
416
  return unless pruned.present?
418
417
 
419
418
  @logger.info("The following resources were pruned: #{pruned.join(', ')}")
420
- @logger.summary.add_action("pruned #{pruned.length} resources")
419
+ @logger.summary.add_action("pruned #{pruned.length} #{'resource'.pluralize(pruned.length)}")
421
420
  end
422
421
 
423
422
  def confirm_context_exists
@@ -1,3 +1,3 @@
1
1
  module KubernetesDeploy
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  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.9.0
4
+ version: 0.9.1
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-07-12 00:00:00.000000000 Z
12
+ date: 2017-07-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport