(t *testing.T)
| 17 | ) |
| 18 | |
| 19 | func writeKeepSA(t *testing.T) string { |
| 20 | t.Helper() |
| 21 | |
| 22 | saPath := defaultLayoutForTest(t, config.PathKindData).KeepServiceAccountPath("a@b.com") |
| 23 | if mkdirErr := os.MkdirAll(filepath.Dir(saPath), 0o700); mkdirErr != nil { |
| 24 | t.Fatalf("mkdir: %v", mkdirErr) |
| 25 | } |
| 26 | if writeErr := os.WriteFile(saPath, []byte("{}"), 0o600); writeErr != nil { |
| 27 | t.Fatalf("write: %v", writeErr) |
| 28 | } |
| 29 | return saPath |
| 30 | } |
| 31 | |
| 32 | func TestGetKeepService_NoServiceAccountConfigured(t *testing.T) { |
| 33 | home := t.TempDir() |
no test coverage detected