Skip to content

Commit b08a3bf

Browse files
committed
fix: add examples exclusions
fix: sonar bugs
1 parent a9068a6 commit b08a3bf

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

pkg/generator/defaultstrategy.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ func NewDefatultStrategy() *DefaultStrategy {
1212
}
1313

1414
func (implmt *DefaultStrategy) setToken(token string) {
15+
// this should never be used
1516
}
1617

1718
func (implmt *DefaultStrategy) setValue(val string) {
19+
// this should never be used
1820
}
1921

2022
func (implmt *DefaultStrategy) getTokenValue(v *retrieveStrategy) (string, error) {

pkg/generator/hashivault.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ func NewVaultStore(ctx context.Context, token, tokenSeparator, keySeparator stri
5252
// setToken already happens in Vault constructor
5353
// no need to re-set it here
5454
func (imp *VaultStore) setToken(token string) {
55+
// this happens inside the New func call
56+
// due to the way the client needs to be
57+
// initialised with a mountpath
58+
// and mountpath is part of the token so it is set then
5559
}
5660

5761
// getTokenValue implements the underlying techonology

pkg/generator/keyvault.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ func NewKvScrtStore(ctx context.Context, token, tokenSeparator, keySeparator str
5555
}, nil
5656
}
5757

58-
// setToken already happens in AzureKVClient in the constructor
59-
// no need to re-set it here
6058
func (implmt *KvScrtStore) setToken(token string) {
59+
// setToken already happens in AzureKVClient in the constructor
60+
// no need to re-set it here
6161
}
6262

6363
func (imp *KvScrtStore) getTokenValue(v *retrieveStrategy) (string, error) {

sonar-project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sonar.projectName=configmanager
55

66
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
77
sonar.sources=.
8-
sonar.exclusions=**/*_test.go,**/*_generated*.go,**/*_generated/**,**/vendor/**
8+
sonar.exclusions=**/*_test.go,**/*_generated*.go,**/*_generated/**,**/vendor/**,**/examples/**
99
sonar.inclusions=**/*.go
1010

1111
# Encoding of the source code. Default is default system encoding

0 commit comments

Comments
 (0)