Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/sirupsen/logrus v1.9.3
github.com/spf13/viper v1.20.1
github.com/stretchr/testify v1.10.0
github.com/swisscom/leaselocker v0.2.0
github.com/swisscom/leaselocker v0.3.0
go.uber.org/mock v0.5.2
go.uber.org/zap v1.27.0
k8s.io/api v0.33.4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/swisscom/leaselocker v0.2.0 h1:5bmfVD7TKzRMwQl4E9La3Lfwd80cKD4JOQjeXIqrLrM=
github.com/swisscom/leaselocker v0.2.0/go.mod h1:34qA0RtskqaqOqdrGWihIg4sinJRzNDd8kbmwhhMPO0=
github.com/swisscom/leaselocker v0.3.0 h1:kX8Bejnk51gj6EoSJye6CXblWnHlbLyreXVlawvPd4E=
github.com/swisscom/leaselocker v0.3.0/go.mod h1:34qA0RtskqaqOqdrGWihIg4sinJRzNDd8kbmwhhMPO0=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/ipaddress_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func (r *IpAddressReconciler) Reconcile(ctx context.Context, req ctrl.Request) (

// 3. unlock lease of parent prefix
if ll != nil {
ll.Unlock()
ll.UnlockWithRetry(ctx)
}

// 4. update status fields
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/iprange_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (r *IpRangeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct

// 3. unlock lease of parent prefix
if ll != nil {
ll.Unlock()
ll.UnlockWithRetry(ctx)
}

// 4. update status fields
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/prefix_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func (r *PrefixReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr

/* 3. unlock lease of parent prefix */
if ll != nil {
ll.Unlock()
ll.UnlockWithRetry(ctx)
}

/* 4. update status fields */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,4 @@ spec:
cleanup:
- script:
content: |-
LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker
if [ -n "$LEASES" ]; then
echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete
fi
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv4-apply-update -n $NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,4 @@ spec:
cleanup:
- script:
content: |-
LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker
if [ -n "$LEASES" ]; then
echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete
fi
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv4-invalid-cidr -n $NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,4 @@ spec:
cleanup:
- script:
content: |-
LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker
if [ -n "$LEASES" ]; then
echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete
fi
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv4-invalid-customfieldnotexisting -n $NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,4 @@ spec:
cleanup:
- script:
content: |-
LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker
if [ -n "$LEASES" ]; then
echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete
fi
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv4-invalid-customfieldwrongdatatype -n $NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,4 @@ spec:
cleanup:
- script:
content: |-
LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker
if [ -n "$LEASES" ]; then
echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete
fi
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv4-invalid-parentprefix -n $NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,4 @@ spec:
cleanup:
- script:
content: |-
LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker
if [ -n "$LEASES" ]; then
echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete
fi
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv4-invalid-size -n $NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,4 @@ spec:
cleanup:
- script:
content: |-
LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker
if [ -n "$LEASES" ]; then
echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete
fi
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv4-invalid-tenant -n $NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,6 @@ spec:
cleanup:
- script:
content: |-
LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker
if [ -n "$LEASES" ]; then
echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete
fi
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv4-prefixexhausted-1 -n $NAMESPACE
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv4-prefixexhausted-2 -n $NAMESPACE
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv4-prefixexhausted-3 -n $NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,5 @@ spec:
cleanup:
- script:
content: |-
LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker
if [ -n "$LEASES" ]; then
echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete
fi
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv4-restore-1 -n $NAMESPACE
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv4-restore-2 -n $NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,4 @@ spec:
cleanup:
- script:
content: |-
LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker
if [ -n "$LEASES" ]; then
echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete
fi
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv6-apply-update -n $NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,6 @@ spec:
cleanup:
- script:
content: |-
LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker
if [ -n "$LEASES" ]; then
echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete
fi
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv6-prefixexhausted-1 -n $NAMESPACE
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv6-prefixexhausted-2 -n $NAMESPACE
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv6-prefixexhausted-3 -n $NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,5 @@ spec:
cleanup:
- script:
content: |-
LEASES=$(kubectl -n netbox-operator-system get lease -oname | grep -v netbox) # to be enhanced in usage of leaselocker
if [ -n "$LEASES" ]; then
echo "$LEASES" | xargs -n1 kubectl -n netbox-operator-system delete
fi
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv6-restore-1 -n $NAMESPACE
kubectl delete events --field-selector involvedObject.name=iprangeclaim-ipv6-restore-2 -n $NAMESPACE
Loading