Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-78420

NMStateConfig discarded as "dirty" when agent-config is on disk

    • None
    • Agent Sprint 285
    • 1
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

          When using the agent-based installer in the OVE (OpenShift Virtualization Extension) workflow,providing both `agent-config.yaml` (with only rendezvousIP) and `nmstateconfig.yaml` (with network configuration) results in the nmstateconfig.yaml being discarded and the network configuration being lost in the generated unconfigured ignition file.  This occurs because the asset store's dependency tracking incorrectly treats user-provided configuration files as "dirty dependencies" that require regeneration of child assets, even when both files are independently user-provided and should coexist.
      

      Version-Release number of selected component (if applicable):

          

      How reproducible:

          Always

      Steps to Reproduce:

      1. Create agent-config.yaml with only rendezvousIP (no hosts section)
      2. Create `cluster-manifests` directory and add nmstateconfig.yaml, infraenv.yaml, pull-secret.yaml
      3. Run the command `./openshift-install agent create unconfigured-ignition --log-level debug`     

      Actual results:

      1. The installer outputs a warning:  WARNING: Discarding the NMState Config that was provided in the target directory  because its dependencies are dirty and it needs to be regenerated  
      
      2. The NMState Config asset is regenerated, but since agent-config.yaml has no hosts  defined (only rendezvousIP), the regeneration produces an empty NMStateConfig.  
      
      3. The generated unconfigured-agent.ign file does NOT contain the network configuration  files:    - Missing: /etc/assisted/network/host0/eth0.nmconnection    - Missing: /etc/assisted/network/host1/eth0.nmconnection    - Missing: /etc/assisted/network/host2/eth0.nmconnection    - Missing: /etc/assisted/network/*/mac_interface.ini  
      
      4. The user-provided network configuration from nmstateconfig.yaml is completely lost.  
      
      5. Debug log shows:  DEBUG Discarding the NMState Config that was provided in the target directory because  its dependencies are dirty and it needs to be regenerated  DEBUG Generating NMState Config...  DEBUG   (exits early because agentHosts.Hosts is empty)

      Expected results:

      1. No warning should be displayed about discarding the NMState Config.  
      
      2. Both user-provided configuration files should be preserved:    - agent-config.yaml provides the rendezvousIP    - nmstateconfig.yaml provides the network configuration  
      
      3. The generated unconfigured-agent.ign file SHOULD contain all network configuration  files from nmstateconfig.yaml:    - /etc/assisted/network/host0/eth0.nmconnection    - /etc/assisted/network/host1/eth0.nmconnection    - /etc/assisted/network/host2/eth0.nmconnection    - /etc/assisted/network/*/mac_interface.ini    - /usr/local/bin/pre-network-manager-config.sh  
      
      4. The pre-network-manager-config.service should be enabled in the ignition.  
      
      5. Debug log should show:  DEBUG Using NMState Config loaded from target directory (preserving user-provided  config despite on-disk dependencies)  DEBUG Using Agent Config loaded from target directory

      Additional info:

      Root Cause  The asset store's load logic in pkg/asset/store/store.go marks any asset with an on-disk dependency as "dirty" (anyParentsDirty = true), which triggers regeneration even when both the parent and child are user-provided configs that should coexist.  
      
      Dependency chain:
        agent-config.yaml (loaded from disk)
          ↓ (marks AgentHosts as dirty)
        AgentHosts (generated with empty Hosts list)
          ↓ (marks NMStateConfig as dirty)
        nmstateconfig.yaml (discarded, regeneration finds no hosts, returns early)  
      
      Additional Info  - This is a blocker for the OVE use case where install-config.yaml cannot be provided
        
      - The rendezvousIP must come from agent-config.yaml for the SaaS UI integration
        
      - The network configuration must come from nmstateconfig.yaml since agent-config has no hosts
        
      - Both files are required and should be able to coexist without one invalidating the other    

              ppinjark@redhat.com Pawan Pinjarkar
              ppinjark@redhat.com Pawan Pinjarkar
              Biagio Manzari Biagio Manzari
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: