mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 21:39:40 +02:00
Co-authored-by: testA113 <aliharriss1995@gmail.com> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Ali <83188384+testA113@users.noreply.github.com>
33 lines
820 B
Go
33 lines
820 B
Go
package kubernetes
|
|
|
|
import (
|
|
"errors"
|
|
"net/http"
|
|
"time"
|
|
|
|
rbacv1 "k8s.io/api/rbac/v1"
|
|
"k8s.io/apimachinery/pkg/types"
|
|
)
|
|
|
|
type (
|
|
K8sClusterRoleBinding struct {
|
|
Name string `json:"name"`
|
|
UID types.UID `json:"uid"`
|
|
Namespace string `json:"namespace"`
|
|
RoleRef rbacv1.RoleRef `json:"roleRef"`
|
|
Subjects []rbacv1.Subject `json:"subjects"`
|
|
CreationDate time.Time `json:"creationDate"`
|
|
IsSystem bool `json:"isSystem"`
|
|
}
|
|
|
|
// K8sRoleBindingDeleteRequests slice of cluster role cluster bindings.
|
|
K8sClusterRoleBindingDeleteRequests []string
|
|
)
|
|
|
|
func (r K8sClusterRoleBindingDeleteRequests) Validate(request *http.Request) error {
|
|
if len(r) == 0 {
|
|
return errors.New("missing deletion request list in payload")
|
|
}
|
|
|
|
return nil
|
|
}
|