Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for Ruby 2.5 as its close to EOL #782

Merged
merged 4 commits into from
Jan 14, 2021
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
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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 (Assuming the idea is to test each version of ruby w/o building an entire matrix)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup! 2.6 default and then 2.7 and 3 on single k8s versions

- 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's strange that this changed just from the Ruby version :/ I would have that it specific to Mocha. Regardless, I think it's ok for now, though I'm not a huge fan of introducing so much static info into the stub :(

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruby 2.7 deprecated some stuff with keyword args I haven't fully read up on it https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ but maybe this smells like it could be related.

.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