Documentation ¶
Index ¶
- func GetAppLabels(appName, category string) map[string]string
- func GetClusterAdminRoleRef() rbacv1.RoleRef
- func GetClusterRoleRef(name string) rbacv1.RoleRef
- func GetCoreRule() rbacv1.PolicyRule
- func GetCrdRule() rbacv1.PolicyRule
- func GetDefaultServiceAccountSubject(namespace string) rbacv1.Subject
- func GetIstioRule() rbacv1.PolicyRule
- func GetPodNamespaceEnvVar() v1.EnvVar
- func GetServiceAccountSubject(namespace, name string) rbacv1.Subject
- func MustCanonicalizeYaml(input string) string
- type ApiGroupPermissions
- type ContainerSpec
- type NamespacePermissions
- type PortSpec
- type ResourceBuilder
- func (b *ResourceBuilder) GetClusterRole() *rbacv1.ClusterRole
- func (b *ResourceBuilder) GetClusterRoleBinding() *rbacv1.ClusterRoleBinding
- func (b *ResourceBuilder) GetClusterRoleRef() rbacv1.RoleRef
- func (b *ResourceBuilder) GetConfigMap() *v1.ConfigMap
- func (b *ResourceBuilder) GetDeployment() *v1beta1.Deployment
- func (b *ResourceBuilder) GetDeploymentAppsv1() *appsv1.Deployment
- func (b *ResourceBuilder) GetNamespace() *v1.Namespace
- func (b *ResourceBuilder) GetRole() *rbacv1.Role
- func (b *ResourceBuilder) GetRoleBinding() *rbacv1.RoleBinding
- func (b *ResourceBuilder) GetSecret() *v1.Secret
- func (b *ResourceBuilder) GetService() *v1.Service
- func (b *ResourceBuilder) GetServiceAccount() *v1.ServiceAccount
- func (b *ResourceBuilder) GetServiceAccountSubject() rbacv1.Subject
- type ResourcePermissions
- type ServiceAccountPermissions
- type ServiceSpec
- type TestManifest
- type Verbs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAppLabels ¶
func GetClusterAdminRoleRef ¶
func GetClusterRoleRef ¶
func GetCoreRule ¶
func GetCoreRule() rbacv1.PolicyRule
func GetCrdRule ¶
func GetCrdRule() rbacv1.PolicyRule
func GetIstioRule ¶
func GetIstioRule() rbacv1.PolicyRule
func GetPodNamespaceEnvVar ¶
func MustCanonicalizeYaml ¶
Types ¶
type ApiGroupPermissions ¶
type ApiGroupPermissions struct {
ApiGroup map[string]*ResourcePermissions
}
type ContainerSpec ¶
type ContainerSpec struct { Image string PullPolicy v1.PullPolicy Name string Args []string EnvVars []v1.EnvVar }
func GetContainerSpec ¶
func GetContainerSpec(registry, name, tag string, envVars ...v1.EnvVar) ContainerSpec
func GetQuayContainerSpec ¶
func GetQuayContainerSpec(image, tag string, envVars ...v1.EnvVar) ContainerSpec
type NamespacePermissions ¶
type NamespacePermissions struct {
Namespace map[string]*ApiGroupPermissions
}
type ResourceBuilder ¶
type ResourceBuilder struct { Namespace string Name string Args []string Labels map[string]string Annotations map[string]string Rules []rbacv1.PolicyRule Data map[string]string Subjects []rbacv1.Subject RoleRef rbacv1.RoleRef Containers []ContainerSpec Service ServiceSpec SecretType v1.SecretType ServiceAccountName string }
func (*ResourceBuilder) GetClusterRole ¶
func (b *ResourceBuilder) GetClusterRole() *rbacv1.ClusterRole
func (*ResourceBuilder) GetClusterRoleBinding ¶
func (b *ResourceBuilder) GetClusterRoleBinding() *rbacv1.ClusterRoleBinding
func (*ResourceBuilder) GetClusterRoleRef ¶
func (b *ResourceBuilder) GetClusterRoleRef() rbacv1.RoleRef
func (*ResourceBuilder) GetConfigMap ¶
func (b *ResourceBuilder) GetConfigMap() *v1.ConfigMap
func (*ResourceBuilder) GetDeployment ¶
func (b *ResourceBuilder) GetDeployment() *v1beta1.Deployment
Deprecated
func (*ResourceBuilder) GetDeploymentAppsv1 ¶
func (b *ResourceBuilder) GetDeploymentAppsv1() *appsv1.Deployment
func (*ResourceBuilder) GetNamespace ¶
func (b *ResourceBuilder) GetNamespace() *v1.Namespace
func (*ResourceBuilder) GetRole ¶
func (b *ResourceBuilder) GetRole() *rbacv1.Role
func (*ResourceBuilder) GetRoleBinding ¶
func (b *ResourceBuilder) GetRoleBinding() *rbacv1.RoleBinding
func (*ResourceBuilder) GetSecret ¶
func (b *ResourceBuilder) GetSecret() *v1.Secret
func (*ResourceBuilder) GetService ¶
func (b *ResourceBuilder) GetService() *v1.Service
func (*ResourceBuilder) GetServiceAccount ¶
func (b *ResourceBuilder) GetServiceAccount() *v1.ServiceAccount
func (*ResourceBuilder) GetServiceAccountSubject ¶
func (b *ResourceBuilder) GetServiceAccountSubject() rbacv1.Subject
type ResourcePermissions ¶
type ServiceAccountPermissions ¶
type ServiceAccountPermissions struct {
ServiceAccount map[string]*NamespacePermissions
}
func (*ServiceAccountPermissions) AddExpectedPermission ¶
func (p *ServiceAccountPermissions) AddExpectedPermission(serviceAccount, namespace string, apiGroups, resources, verbs []string)
type ServiceSpec ¶
type ServiceSpec struct {
Ports []PortSpec
}
type TestManifest ¶
type TestManifest interface { // Deprecated ExpectDeployment(deployment *v1beta1.Deployment) *v1beta1.Deployment ExpectDeploymentAppsV1(deployment *appsv1.Deployment) ExpectServiceAccount(serviceAccount *corev1.ServiceAccount) ExpectClusterRole(clusterRole *rbacv1.ClusterRole) ExpectClusterRoleBinding(clusterRoleBinding *rbacv1.ClusterRoleBinding) ExpectRole(role *rbacv1.Role) ExpectRoleBinding(roleBinding *rbacv1.RoleBinding) ExpectConfigMap(configMap *corev1.ConfigMap) ExpectConfigMapWithYamlData(configMap *corev1.ConfigMap) ExpectSecret(secret *corev1.Secret) ExpectService(service *corev1.Service) ExpectNamespace(namespace *corev1.Namespace) ExpectCrd(crd *extv1beta1.CustomResourceDefinition) ExpectCustomResource(gvk, namespace, name string) *unstructured.Unstructured NumResources() int Expect(kind, namespace, name string) Assertion ExpectUnstructured(kind, namespace, name string) Assertion ExpectPermissions(permissions *ServiceAccountPermissions) // run this callback on all the resources contained in this TestManifest ExpectAll(callback func(*unstructured.Unstructured)) // construct a new set of resources to make assertions against by collecting // all the resources for which `selector` returns true SelectResources(selector func(*unstructured.Unstructured) bool) TestManifest }
func NewTestManifest ¶
func NewTestManifest(relativePathToManifest string) TestManifest
func NewTestManifestWithResources ¶
func NewTestManifestWithResources(resources kuberesource.UnstructuredResources) TestManifest
Click to show internal directories.
Click to hide internal directories.