Skip to content

Commit bfcc946

Browse files
committed
Use sentinel file to control agent-check-config-image.service
We can enable this service unconditionally, because we already have a sentinel for disabling services related to the config-image.
1 parent 5cdd482 commit bfcc946

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

data/data/agent/systemd/units/agent-check-config-image.service

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Description=Displays message to console if config image has not been inserted or mounted in unconfigured-ignition environment
33
Wants=network-online.target
44
After=network-online.target
5+
ConditionPathExists=!/etc/assisted/no-config-image
56

67
[Service]
78
Type=oneshot

pkg/asset/agent/image/unconfigured_ignition.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ func (a *UnconfiguredIgnition) Generate(_ context.Context, dependencies asset.Pa
184184
case workflow.AgentWorkflowTypeInstall:
185185
agentTemplateData.ConfigImageFiles = strings.Join(GetConfigImageFiles(), ",")
186186

187-
// Enable the agent-check-config-image.service for the current workflow.
188-
enabledServices = append(enabledServices, "agent-check-config-image.service")
189-
190187
case workflow.AgentWorkflowTypeInstallInteractiveDisconnected:
191188
// Add the rendezvous host file. Agent TUI will interact with that file in case
192189
// the rendezvous IP wasn't previously configured, by managing it as a template file.
@@ -245,6 +242,8 @@ func (a *UnconfiguredIgnition) Generate(_ context.Context, dependencies asset.Pa
245242
config.Storage.Files = append(config.Storage.Files, manifestFile)
246243
}
247244

245+
// the agent-check-config-image.service added only to the unconfigured ignition
246+
enabledServices = append(enabledServices, "agent-check-config-image.service")
248247
err = bootstrap.AddSystemdUnits(&config, "agent/systemd/units", agentTemplateData, enabledServices)
249248
if err != nil {
250249
return err

0 commit comments

Comments
 (0)