@@ -465,6 +465,61 @@ var _ = Describe("e2e tests [PR-Blocking]", func() {
465465 })
466466 })
467467
468+ Describe ("Workload cluster (with bastion and no workers)" , func () {
469+ It ("should be creatable and deletable" , func () {
470+ shared .Logf ("Creating a cluster" )
471+ clusterName := fmt .Sprintf ("cluster-%s" , namespace .Name )
472+ configCluster := defaultConfigCluster (clusterName , namespace .Name )
473+ configCluster .ControlPlaneMachineCount = pointer .Int64 (1 )
474+ configCluster .WorkerMachineCount = pointer .Int64 (0 )
475+ configCluster .Flavor = shared .FlavorBastionNoWorker
476+ createCluster (ctx , configCluster , clusterResources )
477+
478+ controlPlaneMachines := framework .GetControlPlaneMachinesByCluster (ctx , framework.GetControlPlaneMachinesByClusterInput {
479+ Lister : e2eCtx .Environment .BootstrapClusterProxy .GetClient (),
480+ ClusterName : clusterName ,
481+ Namespace : namespace .Name ,
482+ })
483+ Expect (controlPlaneMachines ).To (HaveLen (1 ))
484+
485+ workloadCluster := e2eCtx .Environment .BootstrapClusterProxy .GetWorkloadCluster (ctx , namespace .Name , clusterName )
486+
487+ // waitForDaemonSetRunning(ctx, workloadCluster.GetClient(), "kube-system", "openstack-cloud-controller-manager")
488+
489+ waitForNodesReadyWithoutCCMTaint (ctx , workloadCluster .GetClient (), 1 )
490+
491+ // We expect a control plane machine and a bastion host
492+ allServers , err := shared .DumpOpenStackServers (e2eCtx , servers.ListOpts {})
493+ Expect (err ).NotTo (HaveOccurred ())
494+ Expect (allServers ).To (HaveLen (2 ))
495+
496+ // When listing servers with multiple tags, nova api requires a single, comma-separated string
497+ // with all the tags
498+ controlPlaneTags := fmt .Sprintf ("%s,%s" , clusterName , "control-plane" )
499+ controlPlaneServers , err := shared .DumpOpenStackServers (e2eCtx , servers.ListOpts {Tags : controlPlaneTags })
500+ Expect (err ).NotTo (HaveOccurred ())
501+ Expect (controlPlaneServers ).To (HaveLen (1 ))
502+
503+ networksList , err := shared .DumpOpenStackNetworks (e2eCtx , networks.ListOpts {Tags : clusterName })
504+ Expect (err ).NotTo (HaveOccurred ())
505+ Expect (networksList ).To (HaveLen (1 ))
506+
507+ subnetsList , err := shared .DumpOpenStackSubnets (e2eCtx , subnets.ListOpts {Tags : clusterName })
508+ Expect (err ).NotTo (HaveOccurred ())
509+ Expect (subnetsList ).To (HaveLen (1 ))
510+
511+ routersList , err := shared .DumpOpenStackRouters (e2eCtx , routers.ListOpts {Tags : clusterName })
512+ Expect (err ).NotTo (HaveOccurred ())
513+ Expect (routersList ).To (HaveLen (1 ))
514+
515+ securityGroupsList , err := shared .DumpOpenStackSecurityGroups (e2eCtx , groups.ListOpts {Tags : clusterName })
516+ Expect (err ).NotTo (HaveOccurred ())
517+ Expect (securityGroupsList ).To (HaveLen (3 ))
518+
519+ // Here we want to test the part where we change the bastion spec and want to check
520+ // that the new bastion is created with the new spec and the old one is deleted.
521+ })
522+ })
468523 Describe ("MachineDeployment misconfigurations" , func () {
469524 It ("should fail to create MachineDeployment with invalid subnet or invalid availability zone" , func () {
470525 shared .Logf ("Creating a cluster" )
0 commit comments