Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1975711: Only start static ip set if provisioning net not disabled #166

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion provisioning/baremetal_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func newMetal3InitContainers(info *ProvisioningInfo) []corev1.Container {
// If the provisioning network is disabled, and the user hasn't requested a
// particular provisioning IP on the machine CIDR, we have nothing for this container
// to manage.
if info.ProvConfig.Spec.ProvisioningIP != "" {
if info.ProvConfig.Spec.ProvisioningIP != "" && info.ProvConfig.Spec.ProvisioningNetwork != metal3iov1alpha1.ProvisioningNetworkDisabled {
initContainers = append(initContainers, createInitContainerStaticIpSet(info.Images, &info.ProvConfig.Spec))
}

Expand Down
14 changes: 14 additions & 0 deletions provisioning/baremetal_pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,20 @@ func TestNewMetal3InitContainers(t *testing.T) {
},
},
},
{
name: "disabled with provisioning ip",
config: disabledProvisioning().ProvisioningIP("1.2.3.4").ProvisioningNetworkCIDR("").build(),
expectedContainers: []corev1.Container{
{
Name: "metal3-ipa-downloader",
Image: images.IpaDownloader,
},
{
Name: "metal3-machine-os-downloader",
Image: images.MachineOsDownloader,
},
},
},
}
for _, tc := range tCases {
t.Run(tc.name, func(t *testing.T) {
Expand Down