Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions internal/controller/reconciler/reconcile_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -515,6 +517,10 @@ func ReconcileWandbManifest(
}
}

if err := updateWandbStatusIfChanged(ctx, client, wandb, statusBefore); err != nil {
return ctrl.Result{}, err
}

return ctrl.Result{}, nil
}

Expand All @@ -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
Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/weightsandbiases_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion internal/webhook/v2/weightsandbiases_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down
Loading