-
Notifications
You must be signed in to change notification settings - Fork 898
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
Unify Worker Environment Variables systemd/k8s #23197
Unify Worker Environment Variables systemd/k8s #23197
Conversation
@@ -5,7 +5,6 @@ module DeploymentPerWorker | |||
def create_container_objects | |||
ContainerOrchestrator.new.create_deployment(worker_deployment_name) do |definition| | |||
configure_worker_deployment(definition, 1) | |||
definition[:spec][:template][:spec][:containers].first[:env] << {:name => "EMS_ID", :value => self.class.ems_id_from_queue_name(queue_name)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what bothered me originally, we already have EMS_ID env var handling for systemd in the per_ems_worker_mixin so I thought we should be able to let the worker class define this rather than DeploymentPerWorker
9a565b6
to
0e017ce
Compare
This is great! |
0e017ce
to
55732aa
Compare
f2fdad8
to
6524d81
Compare
Handling of worker environment variables was spread across a number of different locations and in a number of cases had to be duplicated for systemd/kubernetes. This adds a common `MiqWorker#environment_variables` method that applies to all runtime platforms, as well as specific systemd/container_environment_variables which are merged in depending on the runtime environment.
6524d81
to
80d99c9
Compare
Checked commit agrare@80d99c9 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint |
Okay I've tested this on openshift/appliances/local-development-environment and all runs correctly, taking out of WIP |
Handling of worker environment variables was spread across a number of different locations and in a number of cases had to be duplicated for systemd/kubernetes.
This adds a common
MiqWorker#environment_variables
method that applies to all runtime platforms, as well as specificsystemd/container_environment_variables which are merged in depending on the runtime environment.
TODO:
Live test of standard workers, provider workers, opentofu-runner on:
Dependent: