Agent unable to start container during discovery
Add timeout of 300 seconds by default to wait for image pull
@@ -85,6 +85,7 @@ type Config struct {
SkipCertVerification bool `envconfig:"SKIP_CERT_VERIFICATION" default:"false"`
InstallRHCa bool `envconfig:"INSTALL_RH_CA" default:"false"`
RhQaRegCred string `envconfig:"REGISTRY_CREDS" default:""`
+ AgentTimeoutStart time.Duration `envconfig:"AGENT_TIMEOUT_START" default:"3m"`
}
const agentMessageOfTheDay = `
@@ -137,7 +138,7 @@ const ignitionConfigFormat = `{
"units": [{
"name": "agent.service",
"enabled": true,
- "contents": "[Service]\nType=simple\nRestart=always\nRestartSec=3\nStartLimitIntervalSec=0\nEnvironment=HTTP_PROXY={{.HTTPProxy}}\nEnvironment=http_proxy={{.HTTPProxy}}\nEnvironment=HTTPS_PROXY={{.HTTPSProxy}}\nEnvironment=https_proxy={{.HTTPSProxy}}\nEnvironment=NO_PROXY={{.NoProxy}}\nEnvironment=no_proxy={{.NoProxy}}\nEnvironment=PULL_SECRET_TOKEN={{.PullSecretToken}}\nExecStartPre=podman run --privileged --rm -v /usr/local/bin:/hostbin {{.AgentDockerImg}} cp /usr/bin/agent /hostbin\nExecStart=/usr/local/bin/agent --url {{.ServiceBaseURL}} --cluster-id {{.clusterId}} --agent-version {{.AgentDockerImg}} --insecure={{.SkipCertVerification}}\n\n[Install]\nWantedBy=multi-user.target"
+ "contents": "[Service]\nType=simple\nRestart=always\nRestartSec=3\nStartLimitIntervalSec=0\nEnvironment=HTTP_PROXY={{.HTTPProxy}}\nEnvironment=http_proxy={{.HTTPProxy}}\nEnvironment=HTTPS_PROXY={{.HTTPSProxy}}\nEnvironment=https_proxy={{.HTTPSProxy}}\nEnvironment=NO_PROXY={{.NoProxy}}\nEnvironment=no_proxy={{.NoProxy}}\nEnvironment=PULL_SECRET_TOKEN={{.PullSecretToken}}\nTimeoutStartSec={{.AgentTimeoutStartSec}}\nExecStartPre=podman run --privileged --rm -v /usr/local/bin:/hostbin {{.AgentDockerImg}} cp /usr/bin/agent /hostbin\nExecStart=/usr/local/bin/agent --url {{.ServiceBaseURL}} --cluster-id {{.clusterId}} --agent-version {{.AgentDockerImg}} --insecure={{.SkipCertVerification}}\n\n[Install]\nWantedBy=multi-user.target"
}]
},
"storage": {
@@ -266,6 +267,7 @@ func (b *bareMetalInventory) formatIgnitionFile(cluster *common.Cluster, params
"HTTPSProxy": cluster.HTTPSProxy,
"NoProxy": cluster.NoProxy,
"SkipCertVerification": strconv.FormatBool(b.SkipCertVerification),
+ "AgentTimeoutStartSec": strconv.FormatInt(int64(b.AgentTimeoutStart.Seconds()), 10),
}
tmpl, err := template.New("ignitionConfig").Parse(ignitionConfigFormat)
if err != nil {
