diff --git a/internal/actions/csr/csr.go b/internal/actions/csr/csr.go index 3a516ed..afbf392 100644 --- a/internal/actions/csr/csr.go +++ b/internal/actions/csr/csr.go @@ -318,7 +318,7 @@ func WatchCastAINodeCSRs(ctx context.Context, log logrus.FieldLogger, client kub continue } // We are only interested in kubelet-bootstrap csr and our own service account csr. - if csrResult.RequestingUser != "kubelet-bootstrap" && csrResult.RequestingUser != "serviceaccount:castai-agent:castai-cluster-controller" { + if csrResult.RequestingUser != "kubelet-bootstrap" && csrResult.RequestingUser != "system:serviceaccount:castai-agent:castai-cluster-controller" { log.WithFields(logrus.Fields{ "csr": name, "node_name": csrResult.RequestingUser, diff --git a/internal/actions/csr/svc_test.go b/internal/actions/csr/svc_test.go index be14942..5f5c81e 100644 --- a/internal/actions/csr/svc_test.go +++ b/internal/actions/csr/svc_test.go @@ -77,7 +77,7 @@ func TestCSRApprove(t *testing.T) { t.Parallel() csrName := "node-csr-123" - userName := "serviceaccount:castai-agent:castai-cluster-controller" + userName := "system:serviceaccount:castai-agent:castai-cluster-controller" client := fake.NewSimpleClientset(getCSR(csrName, userName)) s := NewApprovalManager(log, client) watcher := watch.NewFake() @@ -94,7 +94,7 @@ func TestCSRApprove(t *testing.T) { defer wg.Done() watcher.Add(getCSR(csrName, userName)) time.Sleep(100 * time.Millisecond) - s.Stop(ctx) + s.Stop() }() wg.Wait() diff --git a/internal/monitor/metatada_test.go b/internal/monitor/metatada_test.go index 07bacaa..3ecbd87 100644 --- a/internal/monitor/metatada_test.go +++ b/internal/monitor/metatada_test.go @@ -75,9 +75,8 @@ func Test_monitor_waitForMetadata(t *testing.T) { // create the file, expect the event to arrive at updates channel var meta Metadata maxI := int64(124) - for i := int64(0); i <= maxI; i++ { + for i := int64(1); i <= maxI; i++ { meta = Metadata{ - ClusterID: uuid.New().String(), LastStart: i, } require.NoError(t, meta.Save(syncFile))