Skip to content

Commit 8013aa0

Browse files
committed
test: replace platform metadata test
It seems that the integration test introduced in #10792 is causing some unintented side-effects in kube-apiserver -> kubelet communication (most probably around the TLS certificate??). Instead of assigning dummy external IP, create a dummy link. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent 2b89c28 commit 8013aa0

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

internal/integration/api/platform.go

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package api
88

99
import (
1010
"context"
11-
"net/netip"
1211
"time"
1312

1413
"github.com/cosi-project/runtime/pkg/resource"
@@ -20,6 +19,7 @@ import (
2019
"github.com/siderolabs/talos/internal/integration/base"
2120
"github.com/siderolabs/talos/pkg/machinery/client"
2221
"github.com/siderolabs/talos/pkg/machinery/meta"
22+
"github.com/siderolabs/talos/pkg/machinery/nethelpers"
2323
"github.com/siderolabs/talos/pkg/machinery/resources/network"
2424
"github.com/siderolabs/talos/pkg/machinery/resources/runtime"
2525
)
@@ -80,12 +80,18 @@ func (suite *PlatformSuite) TestMetalPlatformMetadata() {
8080

8181
suite.T().Logf("verifying metal platform network config on node %s", node)
8282

83-
// fake external IP attached to the machine
84-
const externalIP = "1.2.3.4"
83+
const linkName = "dummy-platform"
8584

8685
platformNetworkConfig := v1alpha1runtime.PlatformNetworkConfig{
87-
ExternalIPs: []netip.Addr{
88-
netip.MustParseAddr(externalIP),
86+
Links: []network.LinkSpecSpec{
87+
{
88+
Name: linkName,
89+
Logical: true,
90+
Up: false,
91+
MTU: 1500,
92+
Type: nethelpers.LinkEther,
93+
Kind: "dummy",
94+
},
8995
},
9096
}
9197

@@ -94,13 +100,13 @@ func (suite *PlatformSuite) TestMetalPlatformMetadata() {
94100

95101
suite.Require().NoError(suite.Client.MetaWrite(ctx, meta.MetalNetworkPlatformConfig, platformNetworkConfigMarshaled))
96102

97-
// address should appear on the node
98-
rtestutils.AssertResource(ctx, suite.T(), suite.Client.COSI, "external/"+externalIP+"/32", func(*network.AddressStatus, *assert.Assertions) {})
103+
// link should appear on the node
104+
rtestutils.AssertResource(ctx, suite.T(), suite.Client.COSI, linkName, func(*network.LinkStatus, *assert.Assertions) {})
99105

100106
suite.Require().NoError(suite.Client.MetaDelete(ctx, meta.MetalNetworkPlatformConfig))
101107

102108
// address should be removed
103-
rtestutils.AssertNoResource[*network.AddressStatus](ctx, suite.T(), suite.Client.COSI, "external/"+externalIP)
109+
rtestutils.AssertNoResource[*network.LinkStatus](ctx, suite.T(), suite.Client.COSI, linkName)
104110
}
105111

106112
func init() {

0 commit comments

Comments
 (0)