From 145af6c5e15720921d0720189fc34a292e9b71dc Mon Sep 17 00:00:00 2001 From: Daniel Panzella Date: Tue, 14 Jul 2026 11:02:57 -0700 Subject: [PATCH 1/2] fix: Fix broken tests --- internal/controller/reconciler/reconcile_v2.go | 11 ++++++----- .../controller/weightsandbiases_controller_test.go | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/internal/controller/reconciler/reconcile_v2.go b/internal/controller/reconciler/reconcile_v2.go index 4d6ac794..4d98708c 100644 --- a/internal/controller/reconciler/reconcile_v2.go +++ b/internal/controller/reconciler/reconcile_v2.go @@ -412,6 +412,8 @@ func ReconcileWandbManifest( var result ctrl.Result var err error + statusBefore := wandb.DeepCopy().Status + redisReady := redisAllReady(wandb) mysqlReady := mysqlAllReady(wandb) kafkaReady := wandb.Status.KafkaStatus.Ready @@ -515,6 +517,10 @@ func ReconcileWandbManifest( } } + if err := updateWandbStatusIfChanged(ctx, client, wandb, statusBefore); err != nil { + return ctrl.Result{}, err + } + return ctrl.Result{}, nil } @@ -525,7 +531,6 @@ func reconcileApplications( manifest serverManifest.Manifest, telemetryConfig TelemetryRuntimeConfig, ) (ctrl.Result, error) { - statusBefore := wandb.DeepCopy().Status logger := logx.GetSlog(ctx) logger.Info("Reconciling applications") serviceAccountName := wandb.Spec.Wandb.ServiceAccount.ServiceAccountName @@ -732,10 +737,6 @@ func reconcileApplications( // haven't reached the workloads yet. wandb.Status.ObservedGeneration = wandb.GetGeneration() - if err := updateWandbStatusIfChanged(ctx, client, wandb, statusBefore); err != nil { - return ctrl.Result{}, err - } - return ctrl.Result{}, nil } diff --git a/internal/controller/weightsandbiases_controller_test.go b/internal/controller/weightsandbiases_controller_test.go index 32ef7df8..1b1c6d4c 100644 --- a/internal/controller/weightsandbiases_controller_test.go +++ b/internal/controller/weightsandbiases_controller_test.go @@ -357,7 +357,7 @@ var _ = Describe("WeightsAndBiases Controller V2", func() { // The 0.76.1.yaml manifest should have some applications defined. // We expect them to be created as Application CRs. - Expect(len(appList.Items)).Should(BeNumerically("==", len(wandbManifest.Applications)-2), "Expected all non-feature flagged applications to be created") + Expect(len(appList.Items)).Should(BeNumerically("==", len(wandbManifest.Applications)-1), "Expected all non-feature flagged applications to be created") }) It("Should advance status.observedGeneration only once applications are reconciled for a generation", func() { From 3cddd0910334cbc147b88af46e19cc8ddfb56a38 Mon Sep 17 00:00:00 2001 From: Daniel Panzella Date: Tue, 14 Jul 2026 11:25:27 -0700 Subject: [PATCH 2/2] fix: Don't reject a v2 object for missing bucket if there is a pending annotation --- internal/webhook/v2/weightsandbiases_webhook.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/webhook/v2/weightsandbiases_webhook.go b/internal/webhook/v2/weightsandbiases_webhook.go index 03255b2f..12f6db94 100644 --- a/internal/webhook/v2/weightsandbiases_webhook.go +++ b/internal/webhook/v2/weightsandbiases_webhook.go @@ -21,6 +21,7 @@ import ( "fmt" "strings" + v1 "github.com/wandb/operator/api/v1" "github.com/wandb/operator/internal/logx" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -538,7 +539,7 @@ func validateObjectStoreSpec(wandb *appsv2.WeightsAndBiases) field.ErrorList { if ext := spec.ExternalObjectStore; ext != nil { extPath := objectStorePath.Key(key).Child("externalObjectStore") // provider is sourced from a secret key, so it is resolved and defaulted at reconcile time, not here. - if ext.Bucket.Name == "" { + if _, ok := wandb.ObjectMeta.GetAnnotations()[v1.BucketPendingAnnotation]; !ok && ext.Bucket.Name == "" { errors = append(errors, field.Required( extPath.Child("bucket"), "externalObjectStore requires a bucket secret reference",