Skip to content

Commit

Permalink
Drop support for Ruby 2.5 as its close to EOL (#782)
Browse files Browse the repository at this point in the history
  • Loading branch information
karanthukral committed Jan 14, 2021
1 parent 0c79b76 commit 1d137a6
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 14 deletions.
9 changes: 5 additions & 4 deletions .shopify-build/krane.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
containers:
default:
docker: circleci/ruby:2.5.7
docker: circleci/ruby:2.6.6

steps:
- label: Lint
timeout: 5m
run:
- bundle: ~
- bundle exec rubocop
- label: 'Run Test Suite (:kubernetes: 1.20-latest :ruby: 2.7)'
- label: 'Run Test Suite (:kubernetes: 1.20-latest :ruby: 3.0)'
command: bin/ci
agents:
queue: k8s-ci
env:
LOGGING_LEVEL: "4"
KUBERNETES_VERSION: v1.20-latest
RUBY_VERSION: "2.7"
- label: 'Run Test Suite (:kubernetes: 1.19-latest)'
RUBY_VERSION: "3.0"
- label: 'Run Test Suite (:kubernetes: 1.19-latest :ruby: 2.7)'
command: bin/ci
agents:
queue: k8s-ci
env:
LOGGING_LEVEL: "4"
KUBERNETES_VERSION: v1.19-latest
RUBY_VERSION: "2.7"
- label: 'Run Test Suite (:kubernetes: 1.18-latest)'
command: bin/ci
agents:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## next

*Other*
- Dropped support for Ruby 2.5 due to EoL. [#782](https://github.com/Shopify/krane/pull/782).

## 2.1.3

- Add version exception for ServiceNetworkEndpointGroup (GKE resource) [#768](https://github.com/Shopify/krane/pull/768)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ If you need the ability to render dynamic values in templates before deploying,

## Prerequisites

* Ruby 2.5+
* Ruby 2.6+
* Your cluster must be running Kubernetes v1.15.0 or higher<sup>1</sup>

<sup>1</sup> We run integration tests against these Kubernetes versions. You can find our
Expand Down
2 changes: 1 addition & 1 deletion bin/ci
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ docker run --rm \
-e VERBOSE=1 \
-e PARALLELISM=$PARALLELISM \
-w /usr/src/app \
ruby:"${RUBY_VERSION:-2.5}" \
ruby:"${RUBY_VERSION:-2.6.6}" \
bin/test
2 changes: 1 addition & 1 deletion dev.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: krane
up:
- ruby: 2.5.7 # Matches gemspec
- ruby: 2.6.6 # Matches gemspec
- bundler
- homebrew:
- homebrew/cask/minikube
Expand Down
2 changes: 1 addition & 1 deletion krane.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Gem::Specification.new do |spec|

spec.metadata['allowed_push_host'] = "https://rubygems.org"

spec.required_ruby_version = '>= 2.5.0'
spec.required_ruby_version = '>= 2.6.0'
spec.add_dependency("activesupport", ">= 5.0")
spec.add_dependency("kubeclient", "~> 4.3")
spec.add_dependency("googleauth", "~> 0.8")
Expand Down
3 changes: 2 additions & 1 deletion test/helpers/fixture_sets/ejson_cloud.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def assert_all_secrets_present
token_data = { "api-token" => "this-is-the-api-token", "service" => "Datadog" } # Impt: it isn't _service: Datadog
assert_secret_present("monitoring-token", token_data)

assert_secret_present("unused-secret", "this-is-for-testing-deletion" => "true")
token_data = { "this-is-for-testing-deletion" => "true" }
assert_secret_present("unused-secret", token_data)
end

def assert_web_resources_up
Expand Down
15 changes: 10 additions & 5 deletions test/unit/krane/kubernetes_resource_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,16 @@ def test_validate_definition_doesnt_log_raw_output_for_sensitive_resources
resource = DummySensitiveResource.new
kubectl.expects(:server_version).returns(Gem::Version.new('1.20'))

kubectl.expects(:run).with { |*_args, **kwargs| kwargs[:output_is_sensitive] == true }.returns([
"Some Raw Output",
"Error from kubectl: something went wrong and by the way here's your secret: S3CR3T",
stub(success?: false),
])
kubectl.expects(:run)
.with('apply', '-f', "/tmp/foo/bar", "--dry-run=server", '--output=name', {
log_failure: false, output_is_sensitive: true,
retry_whitelist: [:client_timeout, :empty, :context_deadline], attempts: 3
})
.returns([
"Some Raw Output",
"Error from kubectl: something went wrong and by the way here's your secret: S3CR3T",
stub(success?: false),
])
resource.validate_definition(kubectl)
refute_includes(resource.validation_error_msg, 'S3CR3T')
end
Expand Down

0 comments on commit 1d137a6

Please sign in to comment.