Skip to content

Commit

Permalink
Merge pull request #298 from dtantsur/OCPBUGS-1762
Browse files Browse the repository at this point in the history
OCPBUGS-1762: add a workaround for a NetworkManager issue
  • Loading branch information
openshift-merge-robot committed Nov 24, 2022
2 parents 14fcc2e + a7e189a commit c5fa438
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 9 deletions.
10 changes: 8 additions & 2 deletions provisioning/baremetal_pod.go
Expand Up @@ -238,6 +238,12 @@ func buildEnvVar(name string, baremetalProvisioningConfig *metal3iov1alpha1.Prov
}
}

func getKernelParams(config *metal3iov1alpha1.ProvisioningSpec, networkStack NetworkStackType) string {
// OCPBUGS-872: workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2111675
return fmt.Sprintf("rd.net.timeout.carrier=30 %s",
IpOptionForProvisioning(config, networkStack))
}

func setIronicHtpasswdHash(name string, secretName string) corev1.EnvVar {
return corev1.EnvVar{
Name: name,
Expand Down Expand Up @@ -641,7 +647,7 @@ func createContainerMetal3Ironic(images *Images, info *ProvisioningInfo, config
},
{
Name: ironicKernelParamsEnvVar,
Value: IpOptionForProvisioning(&info.ProvConfig.Spec, info.NetworkStack),
Value: getKernelParams(&info.ProvConfig.Spec, info.NetworkStack),
},
{
Name: ironicProxyEnvVar,
Expand Down Expand Up @@ -724,7 +730,7 @@ func createContainerMetal3IronicInspector(images *Images, info *ProvisioningInfo
},
{
Name: ironicKernelParamsEnvVar,
Value: IpOptionForProvisioning(&info.ProvConfig.Spec, info.NetworkStack),
Value: getKernelParams(&info.ProvConfig.Spec, info.NetworkStack),
},
{
Name: inspectorProxyEnvVar,
Expand Down
36 changes: 29 additions & 7 deletions provisioning/baremetal_pod_test.go
Expand Up @@ -237,7 +237,7 @@ func TestNewMetal3Containers(t *testing.T) {
Env: []corev1.EnvVar{
{Name: "IRONIC_INSECURE", Value: "true"},
{Name: "IRONIC_INSPECTOR_INSECURE", Value: "true"},
{Name: "IRONIC_KERNEL_PARAMS", Value: "ip=dhcp"},
{Name: "IRONIC_KERNEL_PARAMS", Value: "rd.net.timeout.carrier=30 ip=dhcp"},
{Name: "IRONIC_REVERSE_PROXY_SETUP", Value: "true"},
{Name: "IRONIC_HTTPD", Value: "true"},
{Name: "IRONIC_PRIVATE_PORT", Value: "6388"},
Expand All @@ -259,7 +259,7 @@ func TestNewMetal3Containers(t *testing.T) {
Name: "metal3-ironic-inspector",
Env: []corev1.EnvVar{
{Name: "IRONIC_INSECURE", Value: "true"},
{Name: "IRONIC_KERNEL_PARAMS", Value: "ip=dhcp"},
{Name: "IRONIC_KERNEL_PARAMS", Value: "rd.net.timeout.carrier=30 ip=dhcp"},
{Name: "INSPECTOR_REVERSE_PROXY_SETUP", Value: "true"},
{Name: "IRONIC_INSPECTOR_PRIVATE_PORT", Value: "5049"},
{Name: "PROVISIONING_IP", Value: "172.30.20.3/24"},
Expand Down Expand Up @@ -364,9 +364,17 @@ func TestNewMetal3Containers(t *testing.T) {
expectedContainers: []corev1.Container{
containers["metal3-baremetal-operator"],
withEnv(containers["metal3-httpd"], envWithValue("PROVISIONING_INTERFACE", "")),
withEnv(containers["metal3-ironic"], envWithValue("PROVISIONING_INTERFACE", ""), envWithValue("IRONIC_KERNEL_PARAMS", "ip=dhcp6")),
withEnv(
containers["metal3-ironic"],
envWithValue("PROVISIONING_INTERFACE", ""),
envWithValue("IRONIC_KERNEL_PARAMS", "rd.net.timeout.carrier=30 ip=dhcp6"),
),
containers["metal3-ramdisk-logs"],
withEnv(containers["metal3-ironic-inspector"], envWithValue("PROVISIONING_INTERFACE", ""), envWithValue("IRONIC_KERNEL_PARAMS", "ip=dhcp6")),
withEnv(
containers["metal3-ironic-inspector"],
envWithValue("PROVISIONING_INTERFACE", ""),
envWithValue("IRONIC_KERNEL_PARAMS", "rd.net.timeout.carrier=30 ip=dhcp6"),
),
},
sshkey: "",
},
Expand All @@ -375,10 +383,24 @@ func TestNewMetal3Containers(t *testing.T) {
config: disabledProvisioning().ProvisioningIP("").ProvisioningNetworkCIDR("").build(),
expectedContainers: []corev1.Container{
containers["metal3-baremetal-operator"],
withEnv(containers["metal3-httpd"], envWithValue("PROVISIONING_INTERFACE", ""), envWithFieldValue("PROVISIONING_IP", "status.hostIP")),
withEnv(containers["metal3-ironic"], envWithValue("PROVISIONING_INTERFACE", ""), envWithFieldValue("PROVISIONING_IP", "status.hostIP"), envWithValue("IRONIC_KERNEL_PARAMS", "ip=dhcp6")),
withEnv(
containers["metal3-httpd"],
envWithValue("PROVISIONING_INTERFACE", ""),
envWithFieldValue("PROVISIONING_IP", "status.hostIP"),
),
withEnv(
containers["metal3-ironic"],
envWithValue("PROVISIONING_INTERFACE", ""),
envWithFieldValue("PROVISIONING_IP", "status.hostIP"),
envWithValue("IRONIC_KERNEL_PARAMS", "rd.net.timeout.carrier=30 ip=dhcp6"),
),
containers["metal3-ramdisk-logs"],
withEnv(containers["metal3-ironic-inspector"], envWithValue("PROVISIONING_INTERFACE", ""), envWithFieldValue("PROVISIONING_IP", "status.hostIP"), envWithValue("IRONIC_KERNEL_PARAMS", "ip=dhcp6")),
withEnv(
containers["metal3-ironic-inspector"],
envWithValue("PROVISIONING_INTERFACE", ""),
envWithFieldValue("PROVISIONING_IP", "status.hostIP"),
envWithValue("IRONIC_KERNEL_PARAMS", "rd.net.timeout.carrier=30 ip=dhcp6"),
),
},
sshkey: "",
},
Expand Down

0 comments on commit c5fa438

Please sign in to comment.