()
| 22 | } |
| 23 | |
| 24 | func (s *testingSecretSource) GetSecret() ([][]byte, error) { |
| 25 | if s.failingGetSecret { |
| 26 | return nil, fmt.Errorf("failed to get secret") |
| 27 | } |
| 28 | |
| 29 | s.getCount++ |
| 30 | |
| 31 | if s.changingGetSecret { |
| 32 | return [][]byte{[]byte(s.secretKey + strconv.Itoa(s.getCount))}, nil |
| 33 | } |
| 34 | return [][]byte{[]byte(s.secretKey)}, nil |
| 35 | } |
| 36 | |
| 37 | func (s *testingSecretSource) SetSecret(key string) { |
| 38 | s.secretKey = key |