Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions internal/ignition/installmanifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,10 @@ func (g *installerGenerator) updateBootstrap(ctx context.Context, bootstrapPath
// drop this from the list of Files because we don't want to run BMO
continue
}
case isNMConnection(&config.Storage.Files[i]):
// this nmconnection is used for configuring static networking on the bootstrap
// we already have our own way to configure static networking
continue
case isMOTD(&config.Storage.Files[i]):
// workaround for https://github.com/openshift/machine-config-operator/issues/2086
g.fixMOTDFile(&config.Storage.Files[i])
Expand Down Expand Up @@ -1443,6 +1447,10 @@ func isBaremetalProvisioningConfig(file *config_latest_types.File) bool {
return strings.Contains(file.Node.Path, "baremetal-provisioning-config")
}

func isNMConnection(file *config_latest_types.File) bool {
return file.Node.Path == "/etc/NetworkManager/system-connections/nmconnection"
}

func fileToBMH(file *config_latest_types.File) (*bmh_v1alpha1.BareMetalHost, error) {
parts := strings.Split(*file.Contents.Source, "base64,")
if len(parts) != 2 {
Expand Down
19 changes: 18 additions & 1 deletion internal/ignition/installmanifests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,19 @@ var _ = Describe("Bootstrap Ignition Update", func() {
"verification": {}
},
"mode": 420
}
},
{
"filesystem": "root",
"path": "/etc/NetworkManager/system-connections/nmconnection",
"user": {
"name": "root"
},
"contents": {
"source": "data:text/plain;charset=utf-8;base64,Cg==",
"verification": {}
},
"mode": 420
}
]
}
}`
Expand Down Expand Up @@ -161,16 +173,21 @@ var _ = Describe("Bootstrap Ignition Update", func() {

var file *config_32_types.File
foundNMConfig := false
foundNMConncetion := false
for i := range config.Storage.Files {
if isBMHFile(&config.Storage.Files[i]) {
file = &config.Storage.Files[i]
}
if config.Storage.Files[i].Node.Path == "/etc/NetworkManager/conf.d/99-kni.conf" {
foundNMConfig = true
}
if isNMConnection(&config.Storage.Files[i]) {
foundNMConncetion = true
}
}
bmh, _ = fileToBMH(file)
Expect(foundNMConfig).To(BeTrue(), "file /etc/NetworkManager/conf.d/99-kni.conf not present in bootstrap.ign")
Expect(foundNMConncetion).To(BeFalse())
})

AfterEach(func() {
Expand Down