Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ data:
- name: METAL_DEFAULT_EXTERNAL_NETWORK_ID
value: internet
- name: METAL_ADDITIONAL_NETWORKS
value: internet,${METAL_NODE_NETWORK_ID}
value: internet,${METAL_NODE_NETWORK_ID:=null}
- name: METAL_SSH_PUBLICKEY
value: ""
image: ghcr.io/metal-stack/metal-ccm:v0.9.7
Expand Down
2 changes: 1 addition & 1 deletion config/clusterctl-templates/cluster-template-calico.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ data:
- name: METAL_DEFAULT_EXTERNAL_NETWORK_ID
value: internet
- name: METAL_ADDITIONAL_NETWORKS
value: internet,${METAL_NODE_NETWORK_ID}
value: internet,${METAL_NODE_NETWORK_ID:=null}
- name: METAL_SSH_PUBLICKEY
value: ""
image: ghcr.io/metal-stack/metal-ccm:v0.9.7
Expand Down
2 changes: 1 addition & 1 deletion config/samples/metal-ccm/crs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ data:
- name: METAL_DEFAULT_EXTERNAL_NETWORK_ID
value: internet
- name: METAL_ADDITIONAL_NETWORKS
value: internet,${METAL_NODE_NETWORK_ID}
value: internet,${METAL_NODE_NETWORK_ID:=null}
- name: METAL_SSH_PUBLICKEY
value: ""
image: ghcr.io/metal-stack/metal-ccm:v0.9.8
Expand Down
2 changes: 1 addition & 1 deletion config/target-cluster/metal-ccm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ spec:
- name: METAL_DEFAULT_EXTERNAL_NETWORK_ID
value: internet
- name: METAL_ADDITIONAL_NETWORKS
value: internet,${METAL_NODE_NETWORK_ID}
value: internet,${METAL_NODE_NETWORK_ID:=null}
- name: METAL_SSH_PUBLICKEY
value: ""
image: ghcr.io/metal-stack/metal-ccm:v0.9.7
Expand Down
1 change: 0 additions & 1 deletion test/e2e/frmwrk/cluster_upgrade_kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ var _ = Describe("Upgrade Kubernetes Cluster Version", Ordered, Label("upgrade")
capi_e2e_ClusterUpgradeConformanceSpec(ctx, func() capi_e2e.ClusterUpgradeConformanceSpecInput {
Expect(cfg.Variables).NotTo(BeNil(), "E2E config variables map must be initialized")
Expect(cfg.Variables).To(HaveKey("CONTROL_PLANE_IP"))
Expect(cfg.Variables).To(HaveKey("METAL_NODE_NETWORK_ID"))
return capi_e2e.ClusterUpgradeConformanceSpecInput{
E2EConfig: cfg,
ClusterctlConfigPath: e2eCtx.Environment.ClusterctlConfigPath,
Expand Down
5 changes: 0 additions & 5 deletions test/e2e/frmwrk/shared_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ type E2ECluster struct {

type E2EClusterRefs struct {
Namespace *corev1.Namespace
NodeNetwork *metalmodels.V1NetworkResponse
ControlPlaneIP *metalmodels.V1IPResponse

Workload framework.ClusterProxy
Expand Down Expand Up @@ -89,10 +88,6 @@ func (e2e *E2ECluster) Variables() map[string]string {
vars["WORKER_MACHINE_SIZE"] = e2e.WorkerMachineSize
vars["WORKER_MACHINE_IMAGE"] = e2e.WorkerMachineImage

if e2e.Refs.NodeNetwork != nil {
vars["METAL_NODE_NETWORK_ID"] = *e2e.Refs.NodeNetwork.ID
}

return vars
}

Expand Down
10 changes: 9 additions & 1 deletion test/e2e/frmwrk/shared_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/metal-stack/metal-go/api/client/machine"
"github.com/metal-stack/metal-go/api/client/network"
"github.com/metal-stack/metal-go/api/models"
"github.com/metal-stack/metal-lib/pkg/tag"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -383,9 +384,16 @@ func (ee *E2EContext) TeardownMetalStackProject(ctx context.Context) {
Expect(err).ToNot(HaveOccurred(), "failed to list metal networks for project")

for _, net := range nets.Payload {
if label, ok := net.Labels[capmsv1alpha1.TagInfraClusterResource]; !ok || !strings.HasPrefix(label, ee.projectNamespacePrefix()) {
label, ok := net.Labels[capmsv1alpha1.TagInfraClusterResource]
isTestGenerated := !ok || !strings.HasPrefix(label, ee.projectNamespacePrefix())

label, ok = net.Labels[tag.ClusterID]
isCAPMSManaged := ok && strings.HasPrefix(label, ee.projectNamespacePrefix())

if !isTestGenerated && !isCAPMSManaged {
continue
}

_, err := ee.Environment.Metal.Network().FreeNetwork(network.NewFreeNetworkParamsWithContext(ctx).WithID(*net.ID), nil)
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("failed to free metal network %s", *net.ID))
}
Expand Down