Skip to content

Commit e19bef4

Browse files
committed
fix: scim test
1 parent 37c2530 commit e19bef4

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

internal/controller/core/workbench_test.go

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ func TestWorkbenchSCIM_DisableAfterEnable(t *testing.T) {
826826
}
827827

828828
// TestWorkbenchSCIM_BYOTokenMissingKey verifies that when a BYO secret exists but lacks the
829-
// "token" key, reconciliation still succeeds (with a warning) and uses the BYO secret name.
829+
// "token" key, reconciliation fails with a descriptive error.
830830
func TestWorkbenchSCIM_BYOTokenMissingKey(t *testing.T) {
831831
ctx := context.Background()
832832
ns := "posit-team"
@@ -854,21 +854,7 @@ func TestWorkbenchSCIM_BYOTokenMissingKey(t *testing.T) {
854854

855855
wb = getWorkbench(t, cli, ns, name)
856856

857-
// Reconciliation should succeed — the operator warns but does not block.
858-
res, err := r.ReconcileWorkbench(ctx, req, wb)
859-
require.NoError(t, err)
860-
require.True(t, res.IsZero())
861-
862-
// The volume should still reference the BYO secret (operator does not stop the deployment).
863-
deployment := getDeployment(t, cli, ns, wb.ComponentName())
864-
var foundVolume bool
865-
for _, v := range deployment.Spec.Template.Spec.Volumes {
866-
if v.Name == "scim-token" {
867-
foundVolume = true
868-
require.NotNil(t, v.Secret)
869-
assert.Equal(t, byoSecretName, v.Secret.SecretName)
870-
break
871-
}
872-
}
873-
assert.True(t, foundVolume, "scim-token volume should still be present even when BYO secret is missing 'token' key")
857+
// Reconciliation should fail — missing "token" key is a blocking error.
858+
_, err = r.ReconcileWorkbench(ctx, req, wb)
859+
require.ErrorContains(t, err, `BYO SCIM token secret "my-incomplete-scim-secret" is missing required key "token"`)
874860
}

0 commit comments

Comments
 (0)