mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-08-25 16:07:24 +00:00
chore(deps): update dependency golangci/golangci-lint to v2 (#1405)
* chore(deps): update dependency golangci/golangci-lint to v2 * chore(golint): bump v2 and satisfy linters Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com> --------- Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Oliver Bähler <oliverbaehler@hotmail.com>
This commit is contained in:
@@ -33,7 +33,7 @@ type SelectorAllowedListSpec struct {
|
||||
|
||||
func (in *SelectorAllowedListSpec) MatchSelectByName(obj client.Object) bool {
|
||||
if obj != nil {
|
||||
return in.AllowedListSpec.Match(obj.GetName()) || in.SelectorMatch(obj)
|
||||
return in.Match(obj.GetName()) || in.SelectorMatch(obj)
|
||||
}
|
||||
|
||||
return false
|
||||
|
||||
@@ -58,6 +58,10 @@ func NewForbiddenError(key string, forbiddenSpec ForbiddenListSpec) error {
|
||||
}
|
||||
}
|
||||
|
||||
func (f ForbiddenError) Error() string {
|
||||
return fmt.Sprintf("%s is forbidden for the current Tenant. %s", f.key, f.appendForbiddenError())
|
||||
}
|
||||
|
||||
//nolint:predeclared,revive
|
||||
func (f *ForbiddenError) appendForbiddenError() (append string) {
|
||||
append += "Forbidden are "
|
||||
@@ -75,10 +79,6 @@ func (f *ForbiddenError) appendForbiddenError() (append string) {
|
||||
return
|
||||
}
|
||||
|
||||
func (f ForbiddenError) Error() string {
|
||||
return fmt.Sprintf("%s is forbidden for the current Tenant. %s", f.key, f.appendForbiddenError())
|
||||
}
|
||||
|
||||
func ValidateForbidden(metadata map[string]string, forbiddenList ForbiddenListSpec) error {
|
||||
if reflect.DeepEqual(ForbiddenListSpec{}, forbiddenList) {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user