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]
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?
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.