cluster-api-provider-openstack icon indicating copy to clipboard operation
cluster-api-provider-openstack copied to clipboard

⚠️ Store []ResolvedPortSpec in ReferencedMachineResources

Open mdbooth opened this issue 1 year ago • 14 comments

The purpose of this change is fix an issue where we are storing unresolved references in ReferencedMachineResources. Specifically we are storing a PortOpts, which is a user-intent struct. PortOpts can contain unresolved references to both subnets and security groups, as well fields requiring additional processing which reference external objects: the port name, description, and tags.

We create a new type, ResolvedPortSpec, which can contain only fully resolved data. This can be seen in the new signature of CreatePorts(), which no longer requires any source of data other than the []ResolvedPortSpec from ReferencedMachineResources, and is now greatly simplified.

Fully resolving the port name also allows a simplification in port adoption.

All of the complexity now moves to ConstructPorts(), which is updated to return []ResolvedPortSpec instead of []PortOpts. ConstructPorts() is updated to resolve security groups, port name, description, and all subnets referenced in FixedIPs.

Fixes: #1943

TODO:

  • [x] Merge #1944

/hold

mdbooth avatar Mar 15 '24 13:03 mdbooth

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mdbooth

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Mar 15 '24 13:03 k8s-ci-robot

Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!

Name Link
Latest commit b6d7748a7800f0cfde7d6edea510b3d55f0503fc
Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-openstack/deploys/65fd5bc413150c00080ada66
Deploy Preview https://deploy-preview-1951--kubernetes-sigs-cluster-api-openstack.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Mar 15 '24 13:03 netlify[bot]

/test pull-cluster-api-provider-openstack-e2e-full-test

mdbooth avatar Mar 15 '24 13:03 mdbooth

/test pull-cluster-api-provider-openstack-e2e-full-test

mdbooth avatar Mar 15 '24 13:03 mdbooth

/test pull-cluster-api-provider-openstack-e2e-full-test

mdbooth avatar Mar 15 '24 20:03 mdbooth

/test pull-cluster-api-provider-openstack-e2e-full-test

mdbooth avatar Mar 16 '24 17:03 mdbooth

/test pull-cluster-api-provider-openstack-e2e-full-test

mdbooth avatar Mar 18 '24 11:03 mdbooth

/test pull-cluster-api-provider-openstack-e2e-full-test

mdbooth avatar Mar 19 '24 15:03 mdbooth

@dulek Comments addressed.

mdbooth avatar Mar 20 '24 10:03 mdbooth

Nothing obvious, could be a flake. /test pull-cluster-api-provider-openstack-e2e-test

mdbooth avatar Mar 21 '24 11:03 mdbooth

/test pull-cluster-api-provider-openstack-e2e-full-test

mdbooth avatar Mar 21 '24 12:03 mdbooth

/test pull-cluster-api-provider-openstack-e2e-full-test

Error was:

INFO: Applying the cluster template yaml to the cluster
[FAILED] Expected success, but got an error:
    <*errors.fundamental | 0xc002709368>: 
    exit status 1: stderr: 
    {
        msg: "exit status 1: stderr: ",
        stack: [0x1e615ee, 0x1efc805, 0x84ee73, 0x862ecd, 0x47b0c1],
    }
In [It] at: /root/go/pkg/mod/sigs.k8s.io/cluster-api/[email protected]/e2e/clusterctl_upgrade.go:389 @ 03/21/24 13:25:03.601

Referring to https://github.com/kubernetes-sigs/cluster-api/blob/14efefeb46dbe8d0cd0f5b7d1718e00ec58fc079/test/e2e/clusterctl_upgrade.go#L389

That's not very illuminating! Lets see if it was a flake.

mdbooth avatar Mar 21 '24 14:03 mdbooth

Same error.

mdbooth avatar Mar 21 '24 16:03 mdbooth

/test pull-cluster-api-provider-openstack-e2e-full-test

mdbooth avatar Mar 21 '24 18:03 mdbooth

~~I'm not going to re-run the full test on this latest push because it just updates function and variable names.~~

Actually we just broke the upgrade test with a search and replace the other day. Do I learn nothing? 🤦

mdbooth avatar Mar 22 '24 10:03 mdbooth

/test pull-cluster-api-provider-openstack-e2e-full-test

mdbooth avatar Mar 22 '24 11:03 mdbooth

/lgtm

Lets hope the full e2e test passes 🤞

huxcrux avatar Mar 22 '24 11:03 huxcrux

Passed!

/hold cancel

mdbooth avatar Mar 22 '24 12:03 mdbooth