@@ -1494,17 +1494,12 @@ var _ = Describe("Dataplane NodeSet Test", func() {
14941494
14951495 When ("Testing deployment filtering logic" , func () {
14961496 var secondDeploymentName types.NamespacedName
1497- var thirdDeploymentName types.NamespacedName
14981497
14991498 BeforeEach (func () {
15001499 secondDeploymentName = types.NamespacedName {
15011500 Name : "edpm-deployment-2" ,
15021501 Namespace : namespace ,
15031502 }
1504- thirdDeploymentName = types.NamespacedName {
1505- Name : "edpm-deployment-3" ,
1506- Namespace : namespace ,
1507- }
15081503 })
15091504
15101505 When ("Multiple deployments exist with ServicesOverride" , func () {
@@ -1546,7 +1541,7 @@ var _ = Describe("Dataplane NodeSet Test", func() {
15461541 }, th .Timeout , th .Interval ).Should (Succeed ())
15471542
15481543 // Both deployments should be in status (for visibility)
1549- // But only latest deployment affects overall nodeset state
1544+ // All completed deployments are processed, with latest deployment determining final state
15501545 Eventually (func (g Gomega ) {
15511546 instance := GetDataplaneNodeSet (dataplaneNodeSetName )
15521547 g .Expect (instance .Status .DeploymentStatuses ).Should (HaveKey (dataplaneDeploymentName .Name ))
@@ -1581,7 +1576,7 @@ var _ = Describe("Dataplane NodeSet Test", func() {
15811576 SimulateDNSDataComplete (dataplaneNodeSetName )
15821577 })
15831578
1584- It ("Should show all deployments in status but only latest affects overall state " , func () {
1579+ It ("Should show all deployments in status and process all completed deployments " , func () {
15851580 // Complete the first deployment
15861581 Eventually (func (g Gomega ) {
15871582 ansibleeeName := types.NamespacedName {
@@ -1594,7 +1589,7 @@ var _ = Describe("Dataplane NodeSet Test", func() {
15941589 }, th .Timeout , th .Interval ).Should (Succeed ())
15951590
15961591 // Both deployments should be included (for visibility)
1597- // But only latest deployment affects overall nodeset state
1592+ // All completed deployments are processed, with latest determining final state
15981593 Eventually (func (g Gomega ) {
15991594 instance := GetDataplaneNodeSet (dataplaneNodeSetName )
16001595 g .Expect (instance .Status .DeploymentStatuses ).Should (HaveKey (dataplaneDeploymentName .Name ))
@@ -1642,10 +1637,10 @@ var _ = Describe("Dataplane NodeSet Test", func() {
16421637
16431638 // Leave second deployment running (don't complete it)
16441639 // Both deployments should be in status (for visibility)
1645- // Second deployment affects overall state (running and latest)
1640+ // First deployment is processed (completed), second affects final state (running and latest)
16461641 Eventually (func (g Gomega ) {
16471642 instance := GetDataplaneNodeSet (dataplaneNodeSetName )
1648- // Should have first deployment (for visibility )
1643+ // Should have first deployment (completed, processed )
16491644 g .Expect (instance .Status .DeploymentStatuses ).Should (HaveKey (dataplaneDeploymentName .Name ))
16501645 // Should have second deployment (running and latest)
16511646 g .Expect (instance .Status .DeploymentStatuses ).Should (HaveKey (secondDeploymentName .Name ))
@@ -1702,10 +1697,10 @@ var _ = Describe("Dataplane NodeSet Test", func() {
17021697 }, th .Timeout , th .Interval ).Should (Succeed ())
17031698
17041699 // Both error deployments should be in status (for visibility)
1705- // But only latest error affects overall nodeset state
1700+ // First failed deployment is skipped (not latest), second error affects final state (latest)
17061701 Eventually (func (g Gomega ) {
17071702 instance := GetDataplaneNodeSet (dataplaneNodeSetName )
1708- // Should have first deployment (for visibility)
1703+ // Should have first deployment (for visibility only )
17091704 g .Expect (instance .Status .DeploymentStatuses ).Should (HaveKey (dataplaneDeploymentName .Name ))
17101705 // Should have second deployment (latest - affects overall state)
17111706 g .Expect (instance .Status .DeploymentStatuses ).Should (HaveKey (secondDeploymentName .Name ))
@@ -1721,7 +1716,7 @@ var _ = Describe("Dataplane NodeSet Test", func() {
17211716 })
17221717 })
17231718
1724- When ("Mixed deployment states exist " , func () {
1719+ When ("Failed deployment followed by completed deployment " , func () {
17251720 BeforeEach (func () {
17261721 nodeSetSpec := DefaultDataPlaneNodeSetSpec ("edpm-compute" )
17271722 nodeSetSpec ["preProvisioned" ] = true
@@ -1731,18 +1726,13 @@ var _ = Describe("Dataplane NodeSet Test", func() {
17311726 DeferCleanup (th .DeleteInstance , CreateDNSMasq (dnsMasqName , DefaultDNSMasqSpec ()))
17321727 DeferCleanup (th .DeleteInstance , CreateDataplaneNodeSet (dataplaneNodeSetName , nodeSetSpec ))
17331728
1734- // Create first deployment (will have error - should be ignored )
1729+ // Create first deployment (will fail )
17351730 firstDeploymentSpec := DefaultDataPlaneDeploymentSpec ()
17361731 DeferCleanup (th .DeleteInstance , CreateDataplaneDeployment (dataplaneDeploymentName , firstDeploymentSpec ))
17371732
1738- // Create second deployment with ServicesOverride (should be ignored)
1739- overrideDeploymentSpec := DefaultDataPlaneDeploymentSpec ()
1740- overrideDeploymentSpec ["servicesOverride" ] = []string {"bootstrap" }
1741- DeferCleanup (th .DeleteInstance , CreateDataplaneDeployment (secondDeploymentName , overrideDeploymentSpec ))
1742-
1743- // Create third deployment (will succeed - should be processed)
1744- thirdDeploymentSpec := DefaultDataPlaneDeploymentSpec ()
1745- DeferCleanup (th .DeleteInstance , CreateDataplaneDeployment (thirdDeploymentName , thirdDeploymentSpec ))
1733+ // Create second deployment (will complete successfully)
1734+ secondDeploymentSpec := DefaultDataPlaneDeploymentSpec ()
1735+ DeferCleanup (th .DeleteInstance , CreateDataplaneDeployment (secondDeploymentName , secondDeploymentSpec ))
17461736
17471737 CreateSSHSecret (dataplaneSSHSecretName )
17481738 CreateCABundleSecret (caBundleSecretName )
@@ -1751,7 +1741,7 @@ var _ = Describe("Dataplane NodeSet Test", func() {
17511741 SimulateDNSDataComplete (dataplaneNodeSetName )
17521742 })
17531743
1754- It ("Should show all deployments in status but only latest affects overall state " , func () {
1744+ It ("Should show all deployments in status and process completed deployment " , func () {
17551745 // Fail the first deployment
17561746 Eventually (func (g Gomega ) {
17571747 ansibleeeName := types.NamespacedName {
@@ -1763,27 +1753,31 @@ var _ = Describe("Dataplane NodeSet Test", func() {
17631753 g .Expect (th .K8sClient .Status ().Update (th .Ctx , ansibleEE )).To (Succeed ())
17641754 }, th .Timeout , th .Interval ).Should (Succeed ())
17651755
1766- // Complete the third deployment
1756+ // Complete the second deployment
17671757 Eventually (func (g Gomega ) {
17681758 ansibleeeName := types.NamespacedName {
1769- Name : "bootstrap-" + thirdDeploymentName .Name + "-" + dataplaneNodeSetName .Name ,
1759+ Name : "bootstrap-" + secondDeploymentName .Name + "-" + dataplaneNodeSetName .Name ,
17701760 Namespace : namespace ,
17711761 }
17721762 ansibleEE := GetAnsibleee (ansibleeeName )
17731763 ansibleEE .Status .Succeeded = 1
17741764 g .Expect (th .K8sClient .Status ().Update (th .Ctx , ansibleEE )).To (Succeed ())
17751765 }, th .Timeout , th .Interval ).Should (Succeed ())
17761766
1777- // All deployments should be in status (for visibility)
1778- // But only latest deployment affects overall nodeset state
1767+ // Wait for deployment controller to populate hashes
1768+ Eventually (func (g Gomega ) {
1769+ deployment := GetDataplaneDeployment (secondDeploymentName )
1770+ g .Expect (deployment .Status .NodeSetHashes ).Should (HaveKey (dataplaneNodeSetName .Name ))
1771+ }, th .Timeout , th .Interval ).Should (Succeed ())
1772+
1773+ // Both deployments should be in status (for visibility)
1774+ // First failed deployment is skipped (not latest), second completed deployment is processed and determines final state
17791775 Eventually (func (g Gomega ) {
17801776 instance := GetDataplaneNodeSet (dataplaneNodeSetName )
1781- // Should have first deployment (for visibility)
1777+ // Should have first deployment (for visibility only )
17821778 g .Expect (instance .Status .DeploymentStatuses ).Should (HaveKey (dataplaneDeploymentName .Name ))
1783- // Should have second deployment (for visibility )
1779+ // Should have second deployment (completed and latest - affects overall state )
17841780 g .Expect (instance .Status .DeploymentStatuses ).Should (HaveKey (secondDeploymentName .Name ))
1785- // Should have third deployment (latest - affects overall state)
1786- g .Expect (instance .Status .DeploymentStatuses ).Should (HaveKey (thirdDeploymentName .Name ))
17871781 }, th .Timeout , th .Interval ).Should (Succeed ())
17881782
17891783 // The overall deployment condition should be true from the successful deployment
0 commit comments