Bug 2065288

Summary: Day-2 ignition override is ignored
Product: Red Hat Advanced Cluster Management for Kubernetes Reporter: Mat Kowalski <mko>
Component: Infrastructure OperatorAssignee: Mat Kowalski <mko>
Status: CLOSED CURRENTRELEASE QA Contact: Chad Crum <ccrum>
Severity: unspecified Docs Contact: Derek <dcadzow>
Priority: unspecified    
Version: rhacm-2.5CC: ccrum, ercohen, mfilanov, trwest, yfirst
Target Milestone: ---   
Target Release: rhacm-2.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2070949 (view as bug list) Environment:
Last Closed: 2022-10-03 20:21:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2068050    

Description Mat Kowalski 2022-03-17 15:26:41 UTC
+++ PROBLEM DESCRIPTION

Ignition override available via `bmac.agent-install.openshift.io/ignition-config-overrides` annotation or `/v2/infra-envs/{infra_env_id}/hosts/{host_id}/ignition` endpoint is being currently ignored for day-2 workers.

By design the ignition provided by the override should be merged with the default template embedded in the service. What happens is that those do work for following

* discovery ISO
* day-1 master
* day-1 worker

and do not work for 

* day-2 worker

The override is transparently ignored so that the user is not aware of it happening.

+++ PROBLEM EXAMPLE

Applying the following override

"""
{
  "config": "{\"ignition\": {\"version\": \"3.1.0\"}, \"storage\": {\"files\": [{\"path\": \"/tmp/example\", \"contents\": {\"source\": \"data:text/plain;base64,aGVscGltdHJhcHBlZGluYXN3YWdnZXJzcGVj\"}}]}}"
}
"""

we have a resulting day-2 worker ignition rendered as

"""
{
  "config": "{\"ignition\":{\"config\":{\"merge\":[{\"source\":\"http://api.test-infra-cluster-fb61821c.redhat.com:22624/config/worker\",\"verification\":{}}],\"replace\":{\"verification\":{}}},\"proxy\":{},\"security\":{\"tls\":{}},\"timeouts\":{},\"version\":\"3.1.0\"},\"passwd\":{},\"storage\":{\"files\":[{\"group\":{},\"overwrite\":true,\"path\":\"/etc/hostname\",\"user\":{\"name\":\"root\"},\"contents\":{\"source\":\"data:,chocobomb-1\",\"verification\":{}},\"mode\":420}]},\"systemd\":{}}"
}
"""

+++ EXPECTED BEHAVIOUR

In the example above we expect the rendered day-2 worker ignition to look as follows

"""
{
  "config": "{\"ignition\":{\"config\":{\"merge\":[{\"source\":\"http://api.test-infra-cluster-fb61821c.redhat.com:22624/config/worker\",\"verification\":{}}],\"replace\":{\"verification\":{}}},\"proxy\":{},\"security\":{\"tls\":{}},\"timeouts\":{},\"version\":\"3.1.0\"},\"passwd\":{},\"storage\":{\"files\":[{\"group\":{},\"path\":\"/tmp/example\",\"user\":{},\"contents\":{\"source\":\"data:text/plain;base64,aGVscGltdHJhcHBlZGluYXN3YWdnZXJzcGVj\",\"verification\":{}}},{\"group\":{},\"overwrite\":true,\"path\":\"/etc/hostname\",\"user\":{\"name\":\"root\"},\"contents\":{\"source\":\"data:,chocobomb-3\",\"verification\":{}},\"mode\":420}]},\"systemd\":{}}"
}
"""