Skip to content

Commit

Permalink
Merge pull request #277 from rabi/fix_default
Browse files Browse the repository at this point in the history
Set defaulted values in spec
  • Loading branch information
openshift-merge-bot[bot] authored Sep 17, 2024
2 parents af18c66 + 85947c4 commit 7e2d290
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apis/network/v1beta1/netconfig_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ var _ webhook.Defaulter = &NetConfig{}

// Default implements webhook.Defaulter so a webhook will be registered for the type
func (r *NetConfig) Default() {
for _, net := range r.Spec.Networks {
for idx, net := range r.Spec.Networks {
if net.ServiceNetwork == "" {
net.ServiceNetwork = ToDefaultServiceNetwork(net.Name)
r.Spec.Networks[idx].ServiceNetwork = ToDefaultServiceNetwork(net.Name)
}
}

}

//+kubebuilder:webhook:path=/validate-network-openstack-org-v1beta1-netconfig,mutating=false,failurePolicy=fail,sideEffects=None,groups=network.openstack.org,resources=netconfigs,verbs=create;update;delete,versions=v1beta1,name=vnetconfig.kb.io,admissionReviewVersions=v1
Expand Down

0 comments on commit 7e2d290

Please sign in to comment.