Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What/Why
First, thanks for the gem! We have been using it for about 2 years with no issues and it has been really helpful for our background processing workflows. However, it's time for us to upgrade to Ruby > 2.7 and have ran into an issue here.
This is an alternative implementation of #28.
In our app, we were getting the following error after upgrading to Ruby 3:
Passing the keyword argument as the last hash parameter is deprecated in Ruby 3.0 and this requires a change in this repo as
Resque::Kubernetes::ContextFactory::Context
declares the client options to be a hash and sends them over as a hash when building the kubeclient. Also seeKubeclient::Client#initialize
. To make it clear, going forward we are explicitly using hashes for the options internally and double splatting them when instantiating a kubeclient.While Kubeclient added Ruby 3.0 support in version 4.9.2, they also fixed a major security vulnerability in 4.9.3. Given that neither of these were backported to 3.x, I think the project will need to drop the dual support to move forward. I have removed 3.x from the appraisals, but left the structure in place in case we want to support 4.x and 5.x in the future; I can completely remove the dependency if you would prefer.
Additionally updating all
get_ENTITY
methods to explicitly use a hash for its arguments as that aligns with the method signature.Upgrades to
bundler
2.x
since that is a default gem for Ruby 3.If there's anything you need from me to get this merged, just let me know!
How was it tested?
Ran the test suite locally using Ruby 3.0.5.
Additionally deployed this branch to our integration environment that creates GCE resources via the workflow:
App -> Resque -> Kubernetes Job -> Create GCE VM
and confirmed that the Kubernetes Jobs were started and stopped as expected based on workload.