Closed mdbooth closed 4 months ago
/kind bug
This is from code inspection. In CreatePorts we generate the port's name by index:
CreatePorts
https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/654d714fd0b0fbdaec2a16489a0d4eb4a5d4f06f/pkg/cloud/services/networking/port.go#L335-L337
However, this index is not absolute. It is relative to the number of ports which were previously created:
https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/654d714fd0b0fbdaec2a16489a0d4eb4a5d4f06f/controllers/openstackmachine_controller.go#L501-L512
This means that if we declare 2 ports, create 1, fail, then create the other one on the next reconcile, they will both get the index 1.
This is not just untidy, it is also something we rely on in port adoption:
https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/654d714fd0b0fbdaec2a16489a0d4eb4a5d4f06f/pkg/cloud/services/networking/port.go#L553-L557
/kind bug
This is from code inspection. In
CreatePorts
we generate the port's name by index:https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/654d714fd0b0fbdaec2a16489a0d4eb4a5d4f06f/pkg/cloud/services/networking/port.go#L335-L337
However, this index is not absolute. It is relative to the number of ports which were previously created:
https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/654d714fd0b0fbdaec2a16489a0d4eb4a5d4f06f/controllers/openstackmachine_controller.go#L501-L512
This means that if we declare 2 ports, create 1, fail, then create the other one on the next reconcile, they will both get the index 1.
This is not just untidy, it is also something we rely on in port adoption:
https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/654d714fd0b0fbdaec2a16489a0d4eb4a5d4f06f/pkg/cloud/services/networking/port.go#L553-L557