Skip to content

Commit

Permalink
multus: use rook image for ip range detection
Browse files Browse the repository at this point in the history
Use the Rook image (defined by the operator pod) to detect the Multus
network address ranges. It is reasonable for users to want to have a
minimal Ceph image that does not have the `ip` utility installed, which
is used for detecting the address ranges of multus interfaces. Instead,
use the Rook image, which Rook can ensure has the `ip` tool if Ceph ever
removes it from their image.

Signed-off-by: Blaine Gardner <[email protected]>
(cherry picked from commit 8aec30a)
  • Loading branch information
BlaineEXE committed Oct 31, 2023
1 parent 3469de8 commit ac5083a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/operator/ceph/controller/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func discoverAddressRanges(
`},
[]string{},
rookImage,
clusterSpec.CephVersion.Image,
rookImage,
clusterSpec.CephVersion.ImagePullPolicy,
)
if err != nil {
Expand All @@ -273,7 +273,7 @@ func discoverAddressRanges(
netStatusVol, netStatusMount := networkStatusVolumeAndMount()
job.Spec.Template.Spec.Volumes = append(job.Spec.Template.Spec.Volumes, netStatusVol)
job.Spec.Template.Spec.Containers[0].VolumeMounts = append(job.Spec.Template.Spec.Containers[0].VolumeMounts, netStatusMount)
job.Spec.Template.Spec.InitContainers = append(job.Spec.Template.Spec.InitContainers, containerWaitForNetworkStatus(clusterSpec))
job.Spec.Template.Spec.InitContainers = append(job.Spec.Template.Spec.InitContainers, containerWaitForNetworkStatus(clusterSpec, rookImage))

stdout, stderr, retcode, err := networkCanary.Run(ctx, detectNetworkCIDRTimeout)
if err != nil {
Expand Down Expand Up @@ -354,7 +354,7 @@ func networkStatusVolumeAndMount() (corev1.Volume, corev1.VolumeMount) {
// to wait until the network status annotation is present to output info before running so that it
// reports all the info. separate step of waiting for network status annotation into an init
// container so that it can be more easily debugged (output not present in cmd reporter's result)
func containerWaitForNetworkStatus(clusterSpec *cephv1.ClusterSpec) corev1.Container {
func containerWaitForNetworkStatus(clusterSpec *cephv1.ClusterSpec, rookImage string) corev1.Container {
_, mount := networkStatusVolumeAndMount()
return corev1.Container{
Name: "wait-for-network-status-annotation",
Expand All @@ -370,7 +370,7 @@ func containerWaitForNetworkStatus(clusterSpec *cephv1.ClusterSpec) corev1.Conta
echo "" # newline
`,
},
Image: clusterSpec.CephVersion.Image,
Image: rookImage,
ImagePullPolicy: clusterSpec.CephVersion.ImagePullPolicy,
VolumeMounts: []corev1.VolumeMount{
mount,
Expand Down

0 comments on commit ac5083a

Please sign in to comment.