1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

fix: remove unused code in config (#5242)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2022-11-07 17:48:25 +01:00 committed by GitHub
parent e4c493093e
commit 35123af638
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -109,8 +109,6 @@ type Configuration interface {
GetExcludeUsername() []string
// GetGenerateSuccessEvents return if should generate success events
GetGenerateSuccessEvents() bool
// RestrictDevelopmentUsername return exclude development username
RestrictDevelopmentUsername() []string
// FilterNamespaces filters exclude namespace
FilterNamespaces(namespaces []string) []string
// GetWebhooks returns the webhook configs
@ -121,20 +119,18 @@ type Configuration interface {
// configuration stores the configuration
type configuration struct {
mux sync.RWMutex
filters []filter
excludeGroupRole []string
excludeUsername []string
restrictDevelopmentUsername []string
webhooks []WebhookConfig
generateSuccessEvents bool
mux sync.RWMutex
filters []filter
excludeGroupRole []string
excludeUsername []string
webhooks []WebhookConfig
generateSuccessEvents bool
}
// NewConfiguration ...
func NewDefaultConfiguration() *configuration {
return &configuration{
restrictDevelopmentUsername: []string{"minikube-user", "kubernetes-admin"},
excludeGroupRole: defaultExcludeGroupRole,
excludeGroupRole: defaultExcludeGroupRole,
}
}
@ -174,12 +170,6 @@ func (cd *configuration) GetExcludeGroupRole() []string {
return cd.excludeGroupRole
}
func (cd *configuration) RestrictDevelopmentUsername() []string {
cd.mux.RLock()
defer cd.mux.RUnlock()
return cd.restrictDevelopmentUsername
}
func (cd *configuration) GetExcludeUsername() []string {
cd.mux.RLock()
defer cd.mux.RUnlock()