mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-04-06 18:57:23 +00:00
* chore(deps): update dependency golangci/golangci-lint to v2.8.0 * chore(deps): update dependency golangci/golangci-lint to v2.8.0 Signed-off-by: Hristo Hristov <me@hhristov.info> * chore(deps): update dependency golangci/golangci-lint to v2.8.0 Signed-off-by: Hristo Hristov <me@hhristov.info> * chore(deps): update dependency golangci/golangci-lint to v2.8.0 Signed-off-by: Hristo Hristov <me@hhristov.info> --------- Signed-off-by: Hristo Hristov <me@hhristov.info> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Hristo Hristov <me@hhristov.info>
30 lines
790 B
Go
30 lines
790 B
Go
// Copyright 2020-2026 Project Capsule Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package pod
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/projectcapsule/capsule/internal/webhook/utils"
|
|
"github.com/projectcapsule/capsule/pkg/api"
|
|
)
|
|
|
|
type podPriorityClassForbiddenError struct {
|
|
priorityClassName string
|
|
spec api.DefaultAllowedListSpec
|
|
}
|
|
|
|
func NewPodPriorityClassForbidden(priorityClassName string, spec api.DefaultAllowedListSpec) error {
|
|
return &podPriorityClassForbiddenError{
|
|
priorityClassName: priorityClassName,
|
|
spec: spec,
|
|
}
|
|
}
|
|
|
|
func (f podPriorityClassForbiddenError) Error() (err string) {
|
|
msg := fmt.Sprintf("Pod Priority Class %s is forbidden for the current Tenant: ", f.priorityClassName)
|
|
|
|
return utils.DefaultAllowedValuesErrorMessage(f.spec, msg)
|
|
}
|