From f863218f03c246530bfa78326ce7d2a167256a31 Mon Sep 17 00:00:00 2001 From: Ryan Zhang Date: Sat, 4 Oct 2025 00:30:28 +0000 Subject: [PATCH 1/9] fix the e2e and adjust log Signed-off-by: Ryan Zhang --- pkg/controllers/workapplier/process.go | 2 +- pkg/propertyprovider/azure/suite_test.go | 2 +- pkg/propertyprovider/azure/trackers/nodes.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/controllers/workapplier/process.go b/pkg/controllers/workapplier/process.go index 1df00762a..73bfe82c1 100644 --- a/pkg/controllers/workapplier/process.go +++ b/pkg/controllers/workapplier/process.go @@ -229,7 +229,7 @@ func (r *Reconciler) takeOverInMemberClusterObjectIfApplicable( ) (shouldSkipProcessing bool) { if !shouldInitiateTakeOverAttempt(bundle.inMemberClusterObj, work.Spec.ApplyStrategy, expectedAppliedWorkOwnerRef) { // Takeover is not necessary; proceed with the processing. - klog.V(2).InfoS("Takeover is not needed; skip the step") + klog.V(2).InfoS("Takeover is not needed; skip the step", "work", klog.KObj(work), "GVR", *bundle.gvr, "manifestObj", bundle.workResourceIdentifierStr) return false } diff --git a/pkg/propertyprovider/azure/suite_test.go b/pkg/propertyprovider/azure/suite_test.go index cc756b14e..d31301c3a 100644 --- a/pkg/propertyprovider/azure/suite_test.go +++ b/pkg/propertyprovider/azure/suite_test.go @@ -45,7 +45,7 @@ const ( region = "eastus" aksNodeSKU1 = "Standard_B4ms" - aksNodeSKU2 = "Standard_A4_v2" + aksNodeSKU2 = "Standard_A2m_v2" aksNodeSKU3 = "Standard_F4s" // Note (chenyu1): cross-reference between the Azure VM SKU list and the Azure Retail Prices API // for a list of currently known SKUs to be missing from the Azure Retail Prices API. diff --git a/pkg/propertyprovider/azure/trackers/nodes.go b/pkg/propertyprovider/azure/trackers/nodes.go index 53b11ba8e..4cc888a56 100644 --- a/pkg/propertyprovider/azure/trackers/nodes.go +++ b/pkg/propertyprovider/azure/trackers/nodes.go @@ -326,7 +326,7 @@ func (nt *NodeTracker) trackSKU(node *corev1.Node) bool { return true default: // No further action is needed if the node's SKU remains the same. - klog.V(2).InfoS("The node's SKU has not changed", "sku", sku, "node", klog.KObj(node)) + klog.V(3).InfoS("The node's SKU has not changed", "sku", sku, "node", klog.KObj(node)) return false } } From e7362434722d6a1150745efbacc265cf6cfbaf38 Mon Sep 17 00:00:00 2001 From: Ryan Zhang Date: Sat, 4 Oct 2025 00:58:55 +0000 Subject: [PATCH 2/9] add debug log Signed-off-by: Ryan Zhang --- test/e2e/utils_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/utils_test.go b/test/e2e/utils_test.go index 72407e4ba..111cb27cb 100644 --- a/test/e2e/utils_test.go +++ b/test/e2e/utils_test.go @@ -330,7 +330,7 @@ func checkIfAzurePropertyProviderIsWorking() { return fmt.Errorf("member cluster status conditions diff (-got, +want):\n%s", diff) } return nil - }, longEventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to confirm that Azure property provider is up and running") + }, longEventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to confirm that Azure property provider is up and running on cluster", memberCluster) } } From a47b825ea3d5994241e377792face39a1aee3189 Mon Sep 17 00:00:00 2001 From: Ryan Zhang Date: Tue, 7 Oct 2025 23:58:39 +0000 Subject: [PATCH 3/9] add more debugging info and fix e2e Signed-off-by: Ryan Zhang --- Makefile | 2 +- .../azure/provider_integration_test.go | 7 ++----- pkg/propertyprovider/azure/suite_test.go | 8 ++++---- test/e2e/utils_test.go | 14 ++++++++++++-- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 8ed3b47e4..6a63f404d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ REGISTRY ?= ghcr.io -KIND_IMAGE ?= kindest/node:v1.31.0 +KIND_IMAGE ?= kindest/node:v1.33.4 ifndef TAG TAG ?= $(shell git rev-parse --short=7 HEAD) endif diff --git a/pkg/propertyprovider/azure/provider_integration_test.go b/pkg/propertyprovider/azure/provider_integration_test.go index 03e2e87b1..a1876c611 100644 --- a/pkg/propertyprovider/azure/provider_integration_test.go +++ b/pkg/propertyprovider/azure/provider_integration_test.go @@ -305,11 +305,8 @@ var ( ) var ( - // The nodes below use actual capacities of their respective AKS SKUs; for more information, - // see: - // https://learn.microsoft.com/en-us/azure/virtual-machines/av2-series (for A-series nodes), - // https://learn.microsoft.com/en-us/azure/virtual-machines/sizes-b-series-burstable (for B-series nodes), and - // https://learn.microsoft.com/en-us/azure/virtual-machines/dv2-dsv2-series (for D/DS v2 series nodes). + // The nodes below use actual capacities of their respective AKS SKUs; We need to change them periodically as + // they will be deprecated over time. nodes = []corev1.Node{ { ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/propertyprovider/azure/suite_test.go b/pkg/propertyprovider/azure/suite_test.go index d31301c3a..61d27a4de 100644 --- a/pkg/propertyprovider/azure/suite_test.go +++ b/pkg/propertyprovider/azure/suite_test.go @@ -43,10 +43,10 @@ const ( const ( region = "eastus" - - aksNodeSKU1 = "Standard_B4ms" - aksNodeSKU2 = "Standard_A2m_v2" - aksNodeSKU3 = "Standard_F4s" + // we need to regularly update the SKUs used in tests as some of them get deprecated over time. + aksNodeSKU1 = "Standard_D8s_v5" + aksNodeSKU2 = "Standard_E16_v5" + aksNodeSKU3 = "Standard_M16ms" // Note (chenyu1): cross-reference between the Azure VM SKU list and the Azure Retail Prices API // for a list of currently known SKUs to be missing from the Azure Retail Prices API. aksNodeKnownMissingSKU1 = "Standard_DS2_v2" diff --git a/test/e2e/utils_test.go b/test/e2e/utils_test.go index 111cb27cb..034225030 100644 --- a/test/e2e/utils_test.go +++ b/test/e2e/utils_test.go @@ -330,7 +330,7 @@ func checkIfAzurePropertyProviderIsWorking() { return fmt.Errorf("member cluster status conditions diff (-got, +want):\n%s", diff) } return nil - }, longEventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to confirm that Azure property provider is up and running on cluster", memberCluster) + }, longEventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to confirm that Azure property provider is up and running on cluster", memberCluster.ClusterName) } } @@ -722,7 +722,17 @@ func createWorkResources() { func createNamespace() { ns := appNamespace() - Expect(hubClient.Create(ctx, &ns)).To(Succeed(), "Failed to create namespace %s", ns.Name) + Eventually(func() error { + err := hubClient.Create(ctx, &ns) + if k8serrors.IsAlreadyExists(err) { + err = hubClient.Get(ctx, types.NamespacedName{Name: ns.Name}, &ns) + if err != nil { + return fmt.Errorf("failed to get the namespace %s, err is %+w", ns.Name, err) + } + return fmt.Errorf("namespace %s already exists, delete time is %v", ns.Name, ns.GetDeletionTimestamp()) + } + return err + }, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to create namespace %s", ns.Name) } func createConfigMap() { From eb91f0d26f1a13734016061e416ef5af38e0ab45 Mon Sep 17 00:00:00 2001 From: Ryan Zhang Date: Wed, 8 Oct 2025 02:25:03 +0000 Subject: [PATCH 4/9] minor fix Signed-off-by: Ryan Zhang --- test/e2e/setup.sh | 2 +- test/e2e/utils_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/setup.sh b/test/e2e/setup.sh index 4ede036c0..0dc34c5b5 100755 --- a/test/e2e/setup.sh +++ b/test/e2e/setup.sh @@ -6,7 +6,7 @@ set -o pipefail # Before updating the default kind image to use, verify that the version is supported # by the current kind release. -KIND_IMAGE="${KIND_IMAGE:-kindest/node:v1.31.0}" +KIND_IMAGE="${KIND_IMAGE:-kindest/node:v1.33.0}" KUBECONFIG="${KUBECONFIG:-$HOME/.kube/config}" MEMBER_CLUSTER_COUNT=$1 diff --git a/test/e2e/utils_test.go b/test/e2e/utils_test.go index 034225030..98ac1dc6b 100644 --- a/test/e2e/utils_test.go +++ b/test/e2e/utils_test.go @@ -721,8 +721,8 @@ func createWorkResources() { } func createNamespace() { - ns := appNamespace() Eventually(func() error { + ns := appNamespace() err := hubClient.Create(ctx, &ns) if k8serrors.IsAlreadyExists(err) { err = hubClient.Get(ctx, types.NamespacedName{Name: ns.Name}, &ns) From 118167e3c93ceaff00b254436b5d0e354da6a86a Mon Sep 17 00:00:00 2001 From: Ryan Zhang Date: Wed, 8 Oct 2025 02:51:31 +0000 Subject: [PATCH 5/9] increase the log file size Signed-off-by: Ryan Zhang --- charts/hub-agent/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/hub-agent/values.yaml b/charts/hub-agent/values.yaml index a873dd6c3..97f391411 100644 --- a/charts/hub-agent/values.yaml +++ b/charts/hub-agent/values.yaml @@ -49,5 +49,5 @@ hubAPIQPS: 250 hubAPIBurst: 1000 MaxConcurrentClusterPlacement: 100 ConcurrentResourceChangeSyncs: 20 -logFileMaxSize: "10000000" +logFileMaxSize: "100000000" MaxFleetSizeSupported: 100 From cb04a8a7381f888bd6b0c69af37c43f9153a8ffe Mon Sep 17 00:00:00 2001 From: Ryan Zhang Date: Wed, 8 Oct 2025 21:41:35 +0000 Subject: [PATCH 6/9] fix build Signed-off-by: Ryan Zhang --- charts/hub-agent/values.yaml | 2 +- charts/member-agent/templates/deployment.yaml | 1 + charts/member-agent/values.yaml | 1 + test/e2e/setup.sh | 2 +- test/e2e/utils_test.go | 3 ++- 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/charts/hub-agent/values.yaml b/charts/hub-agent/values.yaml index 97f391411..05dc33d6b 100644 --- a/charts/hub-agent/values.yaml +++ b/charts/hub-agent/values.yaml @@ -11,6 +11,7 @@ image: tag: main logVerbosity: 5 +logFileMaxSize: "100000000" enableWebhook: true webhookServiceName: fleetwebhook @@ -49,5 +50,4 @@ hubAPIQPS: 250 hubAPIBurst: 1000 MaxConcurrentClusterPlacement: 100 ConcurrentResourceChangeSyncs: 20 -logFileMaxSize: "100000000" MaxFleetSizeSupported: 100 diff --git a/charts/member-agent/templates/deployment.yaml b/charts/member-agent/templates/deployment.yaml index 6b302b801..6172debb3 100644 --- a/charts/member-agent/templates/deployment.yaml +++ b/charts/member-agent/templates/deployment.yaml @@ -117,6 +117,7 @@ spec: - --{{ $key }}={{ $value }} {{- end }} - --v={{ .Values.logVerbosity }} + - --log_file_max_size={{ .Values.logFileMaxSize }} ports: - name: http containerPort: 4000 diff --git a/charts/member-agent/values.yaml b/charts/member-agent/values.yaml index 0bb28cc5d..d31437ff3 100644 --- a/charts/member-agent/values.yaml +++ b/charts/member-agent/values.yaml @@ -6,6 +6,7 @@ image: tag: main logVerbosity: 5 +logFileMaxSize: "100000000" refreshtoken: repository: ghcr.io/azure/fleet/refresh-token diff --git a/test/e2e/setup.sh b/test/e2e/setup.sh index 0dc34c5b5..66279bb27 100755 --- a/test/e2e/setup.sh +++ b/test/e2e/setup.sh @@ -6,7 +6,7 @@ set -o pipefail # Before updating the default kind image to use, verify that the version is supported # by the current kind release. -KIND_IMAGE="${KIND_IMAGE:-kindest/node:v1.33.0}" +KIND_IMAGE="${KIND_IMAGE:-kindest/node:v1.33.4}" KUBECONFIG="${KUBECONFIG:-$HOME/.kube/config}" MEMBER_CLUSTER_COUNT=$1 diff --git a/test/e2e/utils_test.go b/test/e2e/utils_test.go index 98ac1dc6b..09c8cee42 100644 --- a/test/e2e/utils_test.go +++ b/test/e2e/utils_test.go @@ -721,8 +721,9 @@ func createWorkResources() { } func createNamespace() { + var ns corev1.Namespace Eventually(func() error { - ns := appNamespace() + ns = appNamespace() err := hubClient.Create(ctx, &ns) if k8serrors.IsAlreadyExists(err) { err = hubClient.Get(ctx, types.NamespacedName{Name: ns.Name}, &ns) From ca2eca3cfb0f14598be710c2227a2df4a76edbcf Mon Sep 17 00:00:00 2001 From: Ryan Zhang Date: Wed, 8 Oct 2025 21:55:09 +0000 Subject: [PATCH 7/9] update kind in ci Signed-off-by: Ryan Zhang --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index feb32c5ed..87a2a1e8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -136,7 +136,7 @@ jobs: # Before updating the kind version to use, verify that the current kind image # is still supported by the version. run: | - go install sigs.k8s.io/kind@v0.22.0 + go install sigs.k8s.io/kind@v0.30.0 - name: Run e2e tests run: | From 879646e83d3ff558dd41b67c3904bb2b58c62cbe Mon Sep 17 00:00:00 2001 From: Ryan Zhang Date: Wed, 8 Oct 2025 22:36:54 +0000 Subject: [PATCH 8/9] test Signed-off-by: Ryan Zhang --- .github/workflows/ci.yml | 30 +-------------------- test/e2e/resource_placement_rollout_test.go | 2 +- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87a2a1e8d..1ccc68f80 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,34 +57,6 @@ jobs: ## Comma-separated list of files to upload files: ./it-coverage.xml;./ut-coverage.xml - e2e-tests-v1alpha1: - runs-on: ubuntu-latest - needs: [ - detect-noop, - ] - if: needs.detect-noop.outputs.noop != 'true' - steps: - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version: ${{ env.GO_VERSION }} - - - name: Check out code into the Go module directory - uses: actions/checkout@v5 - - - name: Install Kind - # Before updating the kind version to use, verify that the current kind image - # is still supported by the version. - run: | - go install sigs.k8s.io/kind@v0.20.0 - - - name: Run e2e tests - run: | - OUTPUT_TYPE=type=docker make docker-build-member-agent docker-build-hub-agent docker-build-refresh-token e2e-tests-v1alpha1 - env: - KUBECONFIG: '/home/runner/.kube/config' - HUB_SERVER_URL: 'https://172.19.0.2:6443' - e2e-tests: strategy: fail-fast: false @@ -130,7 +102,7 @@ jobs: - name: Install Ginkgo CLI run: | - go install github.com/onsi/ginkgo/v2/ginkgo@v2.19.1 + go install github.com/onsi/ginkgo/v2/ginkgo@v2.23.4 - name: Install Kind # Before updating the kind version to use, verify that the current kind image diff --git a/test/e2e/resource_placement_rollout_test.go b/test/e2e/resource_placement_rollout_test.go index 6548a2a15..1d77a013b 100644 --- a/test/e2e/resource_placement_rollout_test.go +++ b/test/e2e/resource_placement_rollout_test.go @@ -58,7 +58,7 @@ var ( testCustomResource testv1alpha1.TestResource ) -var _ = Describe("placing namespaced scoped resources using a RP with rollout", Label("resourceplacement"), func() { +var _ = FDescribe("placing namespaced scoped resources using a RP with rollout", Label("resourceplacement"), func() { crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess()) rpName := fmt.Sprintf(rpNameTemplate, GinkgoParallelProcess()) rpKey := types.NamespacedName{Name: rpName, Namespace: appNamespace().Name} From c02cd415472b4816c6e83041069d464220e903f7 Mon Sep 17 00:00:00 2001 From: Ryan Zhang Date: Thu, 9 Oct 2025 00:09:00 +0000 Subject: [PATCH 9/9] add debugging Signed-off-by: Ryan Zhang --- test/e2e/actuals_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e/actuals_test.go b/test/e2e/actuals_test.go index 21389d2a6..dd31d0213 100644 --- a/test/e2e/actuals_test.go +++ b/test/e2e/actuals_test.go @@ -1506,7 +1506,7 @@ func crpStatusWithExternalStrategyActual( } if diff := cmp.Diff(crp.Status, wantStatus, placementStatusCmpOptions...); diff != "" { - return fmt.Errorf("CRP status diff (-got, +want): %s", diff) + return fmt.Errorf("CRP status diff (-got, +want): %s for CRP %s", diff, crpName) } return nil } @@ -1529,11 +1529,11 @@ func customizedPlacementStatusUpdatedActual( if wantObservedResourceIndex == "0" { // When the observedResourceIndex is "0", it means the placement is just created and the placement controller if diff := cmp.Diff(placement.GetPlacementStatus(), wantStatus, placementStatusCmpOptionsOnCreate...); diff != "" { - return fmt.Errorf("Placement status diff (-got, +want): %s", diff) + return fmt.Errorf("Placement status diff (-got, +want): %s for placement %v", diff, placementKey) } } else { if diff := cmp.Diff(placement.GetPlacementStatus(), wantStatus, placementStatusCmpOptions...); diff != "" { - return fmt.Errorf("Placement status diff (-got, +want): %s", diff) + return fmt.Errorf("Placement status diff (-got, +want): %s for placement %v", diff, placementKey) } } return nil