Skip to content
Snippets Groups Projects
Commit 41b168ee authored by Alex ubuntu vm's avatar Alex ubuntu vm
Browse files

pod webhook: removed useless loggers

parent e2d17fa5
No related branches found
No related tags found
1 merge request!2repo: added new directory where utils scripts will be
...@@ -87,8 +87,6 @@ func (a *PodAnnotator) Handle(ctx context.Context, req admission.Request) admiss ...@@ -87,8 +87,6 @@ func (a *PodAnnotator) Handle(ctx context.Context, req admission.Request) admiss
return admission.Allowed("No interfaces available for node") return admission.Allowed("No interfaces available for node")
} }
fmt.Println("esto funcsiona")
log.Info(fmt.Sprintf("Networks: %v", networks))
// Now we create the multus annotations, by using the network attachment definition name // Now we create the multus annotations, by using the network attachment definition name
// And the desired IP address. // And the desired IP address.
for index, network := range networks { for index, network := range networks {
...@@ -96,7 +94,6 @@ func (a *PodAnnotator) Handle(ctx context.Context, req admission.Request) admiss ...@@ -96,7 +94,6 @@ func (a *PodAnnotator) Handle(ctx context.Context, req admission.Request) admiss
netAttachDef := &netAttachDefs.Items[index] netAttachDef := &netAttachDefs.Items[index]
newAnnotation := NetworkAnnotation{Name: netAttachDef.Name, IPAdresses: network.IPAdresses, Namespace: a.SwitchesNamespace} newAnnotation := NetworkAnnotation{Name: netAttachDef.Name, IPAdresses: network.IPAdresses, Namespace: a.SwitchesNamespace}
netAttachDef.Labels[netAttachDefLabel] = "true" netAttachDef.Labels[netAttachDefLabel] = "true"
log.Info(fmt.Sprintf("updating network attachment definition %v", netAttachDef))
err = a.Client.Update(ctx, netAttachDef) err = a.Client.Update(ctx, netAttachDef)
if err != nil { if err != nil {
...@@ -105,7 +102,6 @@ func (a *PodAnnotator) Handle(ctx context.Context, req admission.Request) admiss ...@@ -105,7 +102,6 @@ func (a *PodAnnotator) Handle(ctx context.Context, req admission.Request) admiss
} }
multusAnnotations = append(multusAnnotations, newAnnotation) multusAnnotations = append(multusAnnotations, newAnnotation)
} }
log.Info(fmt.Sprintf("%v", multusAnnotations))
pod.Annotations[MULTUS_ANNOTATION_KEY] = multusAnnotationToString(multusAnnotations) pod.Annotations[MULTUS_ANNOTATION_KEY] = multusAnnotationToString(multusAnnotations)
// pod.Annotations["k8s.v1.cni.cncf.io/networks"] = `[{"name": "veth10","ips": ["10.0.0.1/24"]}]` // pod.Annotations["k8s.v1.cni.cncf.io/networks"] = `[{"name": "veth10","ips": ["10.0.0.1/24"]}]`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment