-
Notifications
You must be signed in to change notification settings - Fork 295
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
Fixes #38084 - Add new REX job templates for bootc upgrade/switch/rollback #11256
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<%# | ||
kind: job_template | ||
name: Bootc Action - Katello Script Default | ||
model: JobTemplate | ||
job_category: Katello | ||
description_format: 'bootc %{action} %{options}' | ||
provider_type: script | ||
template_inputs: | ||
- name: action | ||
description: 'The bootc action: upgrade, switch, rollback or status' | ||
input_type: user | ||
options: "upgrade\nswitch\nrollback\nstatus" | ||
required: true | ||
- name: options | ||
description: Additional options for bootc action | ||
input_type: user | ||
required: false | ||
- name: target | ||
description: Target for bootc switch action | ||
input_type: user | ||
required: false | ||
%> | ||
|
||
bootc <%= input('action') %> <%= input('options') %> <%= input('target') %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I selected the bootc rollback command, I noticed that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same goes for bootc upgrade. In fact, switch is the only action that has a required target. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this is only an issue for the top-level action that has a dropdown with the action you pick. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Edit: I verified that I also get the "no target" error for the upgrade task. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<%# | ||
kind: job_template | ||
name: Bootc Rollback - Katello Script Default | ||
job_category: Katello | ||
description_format: 'bootc rollback' | ||
feature: katello_bootc_rollback | ||
provider_type: script | ||
foreign_input_sets: | ||
- template: Bootc Action - Script Default | ||
exclude: action, options, target | ||
%> | ||
|
||
<%= render_template('Bootc Action - Script Default', :action => 'rollback') %> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<%# | ||
kind: job_template | ||
name: Bootc Status - Katello Script Default | ||
job_category: Katello | ||
description_format: 'bootc status %{options}' | ||
feature: katello_bootc_status | ||
provider_type: script | ||
foreign_input_sets: | ||
- template: Bootc Action - Script Default | ||
exclude: action, target | ||
%> | ||
|
||
<%= render_template('Bootc Action - Script Default', :action => 'status') %> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<%# | ||
kind: job_template | ||
name: Bootc Switch - Katello Script Default | ||
job_category: Katello | ||
description_format: 'bootc switch %{options} %{target}' | ||
feature: katello_bootc_switch | ||
provider_type: script | ||
foreign_input_sets: | ||
- template: Bootc Action - Script Default | ||
exclude: action | ||
%> | ||
|
||
<%= render_template('Bootc Action - Script Default', :action => 'switch') %> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<%# | ||
kind: job_template | ||
name: Bootc Upgrade - Katello Script Default | ||
job_category: Katello | ||
description_format: 'bootc upgrade %{options}' | ||
feature: katello_bootc_upgrade | ||
provider_type: script | ||
foreign_input_sets: | ||
- template: Bootc Action - Script Default | ||
exclude: action, target | ||
%> | ||
|
||
<%= render_template('Bootc Action - Script Default', :action => 'upgrade') %> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -696,6 +696,9 @@ def katello_template_setting_values(name) | |
RemoteExecutionFeature.register(:katello_module_stream_action, N_("Katello: Module Stream Actions"), | ||
:description => N_("Perform a module stream action via Katello interface"), | ||
:provided_inputs => ['action', 'module_spec', 'options']) | ||
RemoteExecutionFeature.register(:katello_bootc_upgrade, N_("Katello: Bootc Upgrade"), :description => N_("Bootc upgrade via Katello interface"), :provided_inputs => ['options']) | ||
RemoteExecutionFeature.register(:katello_bootc_switch, N_("Katello: Bootc Switch"), :description => N_("Bootc switch via Katello interface"), :provided_inputs => ['options,target']) | ||
RemoteExecutionFeature.register(:katello_bootc_rollback, N_("Katello: Bootc Rollback"), :description => N_("Bootc rollback via Katello interface"), :provided_inputs => []) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need one for Bootc status too? |
||
allowed_template_helpers :errata | ||
|
||
RemoteExecutionProvider.singleton_class.prepend(Katello::Concerns::RemoteExecutionProviderExtensions) | ||
|
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.
A sort of common thing is to include an option to reboot the machine once the action is done, maybe that could be used here as well https://github.com/theforeman/foreman_leapp/blob/master/app/views/foreman_leapp/job_templates/leapp_upgrade.erb#L16 ?
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.
Thanks for your review and the comment @adamruzicka.
From bootc document:
With that information, maybe we just allow users decide if a reboot is necessary with
--apply
option. What is your opinion, @ianballou?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.
@lfu I'm asking around about if there is more information about that change. I do like the reboot strategy that Adam mentioned, it seems pretty straight-forward. I'll update here when I hear more from the bootc team.