Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return existing reservation if podRef matches #12

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

xagent003
Copy link

k8snetworkplumbingwg#291

Was able to verify fix works, tried same upgrade scenario. I see an ADD coming in, full IP pool. It returns the existing reservation:

2023-01-13T00:30:34.593Z	DEBUG	PF9: Current Allocations: [IP: 10.128.165.32 is reserved for pod: default/asdasd-0 IP: 10.128.165.33 is reserved for pod: default/asdasd-1 IP: 10.128.165.34 is reserved for pod: default/asdasd-2]
2023-01-13T00:30:34.593Z	DEBUG	IterateForAssignment input >> ip: 10.128.165.32 | ipnet: {10.128.165.0 ffffff00} | first IP: 10.128.165.32 | last IP: 10.128.165.34
2023-01-13T00:30:34.593Z	DEBUG	Found existing reservation 10.128.165.33 with matching podRef default/asdasd-1
2023-01-13T00:30:34.593Z	DEBUG	Reserving IP: |10.128.165.33 4374da0039f84c87613d7c53823923b1682b5714fbe31253a8e1516d111cc383|
2023-01-13T00:30:34.593Z	DEBUG	OverlappingRangewide allocation check for IP: 10.128.165.33
2023-01-13T00:30:34.607Z	DEBUG	IP 10.128.165.33 matches existing podRef default/asdasd-1
2023-01-13T00:30:34.607Z	DEBUG	PF9: updatedreservelist: [IP: 10.128.165.32 is reserved for pod: default/asdasd-0 IP: 10.128.165.33 is reserved for pod: default/asdasd-1 IP: 10.128.165.34 is reserved for pod: default/asdasd-2 IP: 10.128.165.33 is reserved for pod: default/asdasd-1]
2023-01-13T00:30:34.607Z	DEBUG	PF9: patch = [{replace /spec/allocations/33/id 4374da0039f84c87613d7c53823923b1682b5714fbe31253a8e1516d111cc383}]
2023-01-13T00:30:34.609Z	DEBUG	PF9: wrote patchdata: [{"op":"test","path":"/metadata/resourceVersion","value":"11983"},{"op":"replace","path":"/spec/allocations/33/id","value":"4374da0039f84c87613d7c53823923b1682b5714fbe31253a8e1516d111cc383"}]
2023-01-13T00:30:34.609Z	DEBUG	PF9: New reservelist: [IP: 10.128.165.32 is reserved for pod: default/asdasd-0 IP: 10.128.165.33 is reserved for pod: default/asdasd-1 IP: 10.128.165.34 is reserved for pod: default/asdasd-2 IP: 10.128.165.33 is reserved for pod: default/asdasd-1]
2023-01-13T00:30:34.612Z	DEBUG	clusteripres already exists, updating with {4374da0039f84c87613d7c53823923b1682b5714fbe31253a8e1516d111cc383 default/asdasd-1}
2023-01-13T00:30:34.614Z	DEBUG	K8s UpdateOverlappingRangeAllocation success on allocate: &{TypeMeta:{Kind: APIVersion:} ObjectMeta:{Name:10.128.165.33 GenerateName: Namespace:default SelfLink: UID: ResourceVersion: Generation:0 CreationTimestamp:0001-01-01 00:00:00 +0000 UTC DeletionTimestamp:<nil> DeletionGracePeriodSeconds:<nil> Labels:map[] Annotations:map[] OwnerReferences:[] Finalizers:[] ClusterName: ManagedFields:[]} Spec:{ContainerID:4374da0039f84c87613d7c53823923b1682b5714fbe31253a8e1516d111cc383 PodRef:default/asdasd-1}}

@xagent003 xagent003 merged commit fda3471 into master Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant