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:
parent
e4c493093e
commit
35123af638
1 changed files with 7 additions and 17 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue