Documentation
¶
Index ¶
- Constants
- Variables
- func CheckNamespaceExist(namespace string, k8sClient *kubernetes.Clientset) bool
- func NamespaceObj(name string) *corev1.Namespace
- func ServiceAccountObj(name string, namespace string) *corev1.ServiceAccount
- func WaitForKyvernoToReady(k8sClient *kubernetes.Clientset) error
- func WaitForPolicy() error
- type KindCluster
- type TestClient
- func (client *TestClient) CreateClusterRole(clusterRoleName string, policy []v1.PolicyRule) (*v1.ClusterRole, error)
- func (client *TestClient) CreateClusterRoleBinding(clusterRoleBindingName string, clusterRole *v1.ClusterRole) (*v1.ClusterRoleBinding, error)
- func (self *TestClient) CreatePolicy(resourcePath string) error
- func (client *TestClient) CreateRole(roleName string, policy []v1.PolicyRule) (*v1.Role, error)
- func (client *TestClient) CreateRoleBinding(roleBindingName string, role *v1.Role) (*v1.RoleBinding, error)
- func (client *TestClient) DeleteClusterRole() error
- func (self *TestClient) DeletePolicy() error
- func (client *TestClient) DeleteRole() error
Constants ¶
View Source
const DisallowAddCapabilities = `` /* 466-byte string literal not displayed */
View Source
const DisallowBindMounts = `` /* 377-byte string literal not displayed */
View Source
const DisallowHostIPC = `` /* 349-byte string literal not displayed */
View Source
const DisallowHostPID = `` /* 349-byte string literal not displayed */
View Source
const DisallowNetworkPorts = `` /* 634-byte string literal not displayed */
View Source
const DisallowNodePortServices = `` /* 422-byte string literal not displayed */
View Source
const DisallowPrivilegedContainers = `` /* 627-byte string literal not displayed */
View Source
const DisallowPrivilegedEscalation = `` /* 604-byte string literal not displayed */
View Source
const DisallowRootUser = `` /* 573-byte string literal not displayed */
Variables ¶
View Source
var ServiceAccounts []*corev1.ServiceAccount
View Source
var Tenantnamespaces []*tenancyv1alpha1.TenantNamespace
View Source
var Tenants []*tenancyv1alpha1.Tenant
In future if we want to add more tenants and tenantnamespaces
Functions ¶
func CheckNamespaceExist ¶
func CheckNamespaceExist(namespace string, k8sClient *kubernetes.Clientset) bool
CheckNamespaceExist namespace exists or not
func NamespaceObj ¶
func ServiceAccountObj ¶
func ServiceAccountObj(name string, namespace string) *corev1.ServiceAccount
ServiceAccountObj returns the pointer to a service account object
func WaitForKyvernoToReady ¶
func WaitForKyvernoToReady(k8sClient *kubernetes.Clientset) error
func WaitForPolicy ¶
func WaitForPolicy() error
Types ¶
type KindCluster ¶
type KindCluster struct { Name string Nodes int KubeConfig string KubeConfigFile string Provider *cluster.Provider }
KindCluster configures the Kind Cluster
type TestClient ¶
type TestClient struct { Kubernetes kubernetes.Interface APIExtensions apiextensionspkg.Interface REST restpkg.Interface Config *restpkg.Config RoleName string RoleBindingName string ResourcePath string ClusterRoleBindingName string ClusterRoleName string DynamicResource dynamic.ResourceInterface PolicyName string TenantClient *kubernetes.Clientset K8sClient *kubernetes.Clientset Namespace string ServiceAccount *corev1.ServiceAccount Context contextpkg.Context Log *logging.Logger }
TestClient contains fields required to run unittests
func TestNewClient ¶
func TestNewClient(loggerName string, k8sClient *kubernetes.Clientset, apiExtensions apiextensionspkg.Interface, rest restpkg.Interface, config *restpkg.Config) *TestClient
func (*TestClient) CreateClusterRole ¶
func (client *TestClient) CreateClusterRole(clusterRoleName string, policy []v1.PolicyRule) (*v1.ClusterRole, error)
func (*TestClient) CreateClusterRoleBinding ¶
func (client *TestClient) CreateClusterRoleBinding(clusterRoleBindingName string, clusterRole *v1.ClusterRole) (*v1.ClusterRoleBinding, error)
func (*TestClient) CreatePolicy ¶
func (self *TestClient) CreatePolicy(resourcePath string) error
func (*TestClient) CreateRole ¶
func (client *TestClient) CreateRole(roleName string, policy []v1.PolicyRule) (*v1.Role, error)
func (*TestClient) CreateRoleBinding ¶
func (client *TestClient) CreateRoleBinding(roleBindingName string, role *v1.Role) (*v1.RoleBinding, error)
func (*TestClient) DeleteClusterRole ¶
func (client *TestClient) DeleteClusterRole() error
func (*TestClient) DeletePolicy ¶
func (self *TestClient) DeletePolicy() error
func (*TestClient) DeleteRole ¶
func (client *TestClient) DeleteRole() error
Click to show internal directories.
Click to hide internal directories.