Skip to content

Conversation

@Arvindthiru
Copy link
Contributor

@Arvindthiru Arvindthiru commented Sep 20, 2022

Description of your changes

Fixes #

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

Special notes for your reviewer

@Arvindthiru Arvindthiru changed the title Move join/leave to Before/After Suites test: Move join/leave to Before/After Suites Sep 20, 2022
@Arvindthiru
Copy link
Contributor Author

Had to create a new suite for a test @ryanzhang-oss added which involves placement API before joining and after joining

@Arvindthiru
Copy link
Contributor Author

Only made changes/removed helper files used by join/leave workflow, other helper methods will be refactored in #286

@Arvindthiru Arvindthiru marked this pull request as ready for review September 21, 2022 02:17
@Arvindthiru Arvindthiru marked this pull request as draft September 22, 2022 21:59
@Arvindthiru Arvindthiru marked this pull request as ready for review September 22, 2022 22:12
@ryanzhang-oss ryanzhang-oss merged commit b085bed into Azure:main Sep 22, 2022
Comment on lines +107 to +124
Expect(HubCluster.KubeClient.Get(ctx, types.NamespacedName{Name: mc.Name}, mc)).Should(Succeed(), "Failed to retrieve member cluster %s in %s cluster", mc.Name, HubCluster.ClusterName)
mc.Spec.State = v1alpha1.ClusterStateJoin
Expect(HubCluster.KubeClient.Update(ctx, mc)).Should(Succeed(), "Failed to update member cluster %s in %s cluster", mc.Name, HubCluster.ClusterName)

By("check if member cluster condition is updated to Joined")
wantMCStatus = v1alpha1.MemberClusterStatus{
AgentStatus: imcJoinedAgentStatus,
Conditions: mcJoinedConditions,
}
Eventually(func() error {
if err := HubCluster.KubeClient.Get(ctx, types.NamespacedName{Name: mc.Name}, mc); err != nil {
return err
}
if statusDiff := cmp.Diff(wantMCStatus, mc.Status, mcStatusCmpOptions...); statusDiff != "" {
return fmt.Errorf("member cluster(%s) status mismatch (-want +got):\n%s", mc.Name, statusDiff)
}
return nil
}, testutils.PollTimeout, testutils.PollInterval).Should(Succeed(), "Failed to wait for member cluster %s to have status %s", mc.Name, wantMCStatus)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could refactor it as the util, cause it's more like a setup. The whole test is to focus on validating the placement behavior.

weng271190436 added a commit to weng271190436/fleet that referenced this pull request Nov 3, 2025
* remove CRP and MC validation

Signed-off-by: Wei Weng <Wei.Weng@microsoft.com>

* remove v1alpha1 work

Signed-off-by: Wei Weng <Wei.Weng@microsoft.com>

* change Makefile

Signed-off-by: Wei Weng <Wei.Weng@microsoft.com>

* return error if v1alpha1 API is enabled

Signed-off-by: Wei Weng <Wei.Weng@microsoft.com>

* apply suggestion

Signed-off-by: Wei Weng <Wei.Weng@microsoft.com>

---------

Signed-off-by: Wei Weng <Wei.Weng@microsoft.com>
Co-authored-by: Wei Weng <Wei.Weng@microsoft.com>
@weng271190436 weng271190436 mentioned this pull request Nov 3, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants