@@ -885,32 +885,33 @@ func (instance FdbInstance) GetPublicIPs() []string {
885
885
886
886
source := instance .Metadata .Annotations [fdbtypes .PublicIPSourceAnnotation ]
887
887
if source == "" || source == string (fdbtypes .PublicIPSourcePod ) {
888
- return getPublicIpsForPod (instance .Pod )
888
+ return getPublicIPsForPod (instance .Pod )
889
889
}
890
890
891
891
return []string {instance .Pod .ObjectMeta .Annotations [fdbtypes .PublicIPAnnotation ]}
892
892
}
893
893
894
- func getPublicIpsForPod (pod * corev1.Pod ) []string {
894
+ func getPublicIPsForPod (pod * corev1.Pod ) []string {
895
895
var podIPFamily * int
896
896
897
897
if pod == nil {
898
898
return []string {}
899
899
}
900
900
901
901
for _ , container := range pod .Spec .Containers {
902
- if container .Name == "foundationdb-kubernetes-sidecar" {
903
- for indexOfArgument , argument := range container .Args {
904
- if argument == "--public-ip-family" && indexOfArgument < len (container .Args )- 1 {
905
- familyString := container .Args [indexOfArgument + 1 ]
906
- family , err := strconv .Atoi (familyString )
907
- if err != nil {
908
- log .Error (err , "Error parsing public IP family" , "family" , familyString )
909
- return nil
910
- }
911
- podIPFamily = & family
912
- break
902
+ if container .Name != "foundationdb-kubernetes-sidecar" {
903
+ continue
904
+ }
905
+ for indexOfArgument , argument := range container .Args {
906
+ if argument == "--public-ip-family" && indexOfArgument < len (container .Args )- 1 {
907
+ familyString := container .Args [indexOfArgument + 1 ]
908
+ family , err := strconv .Atoi (familyString )
909
+ if err != nil {
910
+ log .Error (err , "Error parsing public IP family" , "family" , familyString )
911
+ return nil
913
912
}
913
+ podIPFamily = & family
914
+ break
914
915
}
915
916
}
916
917
}
0 commit comments