Bug 2116904 - [Agent]: Improvement in error message for mismatching metadata name in case of agent and install config
Summary: [Agent]: Improvement in error message for mismatching metadata name in case o...
Keywords:
Status: RELEASE_PENDING
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 4.12
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.12.0
Assignee: Antoni Segura Puimedon
QA Contact: Manoj Hans
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-09 14:09 UTC by Manoj Hans
Modified: 2023-03-02 18:58 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift installer pull 6244 0 None open Bug 2116904: Base generated NMStateConfig on InstallConfig name 2022-08-19 21:04:59 UTC

Description Manoj Hans 2022-08-09 14:09:00 UTC
Description: Improvement in error message for mismatching metadata name in case of agent and install config

Here is the content of the files.
agent-config.yaml 
--------------------------------------------
kind: AgentConfig
metadata:
  name: sno-cluster
-------------------------------------------- 
install-config.yaml
--------------------------------------------
apiVersion: v1
baseDomain: test.example.com
compute:
- architecture: amd64
  hyperthreading: Enabled
  name: worker
  replicas: 0
controlPlane:
  architecture: amd64
  hyperthreading: Enabled
  name: master
  replicas: 1
metadata:
  name: sno-mismatch
-------------------------------------------- 

How reproducible:

always

Repro Steps: 

1) Get the latest agent-installer and build

git clone -b agent-installer https://github.com/openshift/installer.git
cd installer/
hack/build.sh

2) Create agent.iso using agent-config and install-config by providing a mismatch of metadata names.


Expected: Error message should be thrown something like agentConfig.metadata.name should be same as installConfig.metadata.name

Actual: Spec.NMStateConfigLabelSelector.MatchLabels: Required value: infraEnv and mhans-sno-0.NMStateConfig labels do not match. Expected: map[infraenvs.agent-install.openshift.io:sno-mismatch] Found: map[infraenvs.agent-install.openshift.io:sno-cluster]

Comment 1 Zane Bitter 2022-08-17 02:16:15 UTC
Even better would be if we could find a way to ensure that the name of the agent-config is irrelevant (i.e. that when generating the NMStateConfig we use the same cluster name used by the other resources). We shouldn't really have to specify a name for the agent-config at all, since it doesn't actually get installed in a cluster.

The dependency graph makes this tricky to do without causing the NMStateConfig to get overwritten when the other cluster-manifests files are different. But we could at least depend on the install-config and use the name from that if it exists, only falling back to the agent-config if it doesn't?

Comment 3 Manoj Hans 2022-09-30 10:29:01 UTC
Bug has been verified with 4.12.0-0.nightly-2022-09-28-204419 release. It's working fine. Now there is no need to specify "name" in the agent-config file as it is picking from the install-config.


Note You need to log in before you can comment on or make changes to this bug.