Skip to content

Commit

Permalink
Add nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
super-harsh committed Jun 17, 2024
1 parent a0c05c7 commit 2cda280
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func configMapToWrite(obj *network.PrivateEndpoint, configs map[string]string) (
}

collector := configmaps.NewCollector(obj.Namespace)

primaryNicPrivateIPAddress, ok := configs["PrimaryNicPrivateIPAddress"]
if ok {
collector.AddValue(operatorSpecConfigs.PrimaryNicPrivateIPAddress, primaryNicPrivateIPAddress)
Expand All @@ -150,6 +150,10 @@ func configMapToWrite(obj *network.PrivateEndpoint, configs map[string]string) (
}

func configMapSpecified(endpoint *network.PrivateEndpoint) bool {
if endpoint.Spec.OperatorSpec == nil || endpoint.Spec.OperatorSpec.ConfigMaps == nil {
return false
}

hasIpConfiguration := false
configMaps := endpoint.Spec.OperatorSpec.ConfigMaps

Expand Down

0 comments on commit 2cda280

Please sign in to comment.