test

package
v2.17.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2021 License: Apache-2.0 Imports: 60 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AuthorizationCode represents a shared secret used by IssuerVerifier
	// TODO: consider injecting it into IssuerVerifier
	AuthorizationCode = "fakeCode"
	// IDToken represents a shared fake token
	IDToken       = "fakeTokenId"
	IDViewerToken = "fakeViewerTokenId"

	// IssuerURL holds test issuer URL
	IssuerURL = "url://dex"
	// IssuerClientID holds test issuer client ID
	IssuerClientID = "kubermatic"
	// IssuerClientSecret holds test issuer client secret
	IssuerClientSecret = "secret"
)
View Source
const (
	NoExistingFakeProject      = "NoExistingFakeProject"
	NoExistingFakeProjectID    = "NoExistingFakeProject-ID"
	ForbiddenFakeProject       = "ForbiddenFakeProject"
	ForbiddenFakeProjectID     = "ForbiddenFakeProject-ID"
	ExistingFakeProject        = "ExistingFakeProject"
	ExistingFakeProjectID      = "ExistingFakeProject-ID"
	ImpersonatedClientErrorMsg = "forbidden"
)
View Source
const (
	// UserID holds a test user ID
	UserID = "1233"
	// UserID2 holds a test user ID
	UserID2 = "1523"
	// UserName holds a test user name
	UserName = "user1"
	// UserName2 holds a test user name
	UserName2 = "user2"
	// UserEmail holds a test user email
	UserEmail = "john@acme.com"
	// UserEmail2 holds a test user email
	UserEmail2 = "bob@example.com"
	// ClusterID holds the test cluster ID
	ClusterID = "AbcClusterID"
	// DefaultClusterID holds the test default cluster ID
	DefaultClusterID = "defClusterID"
	// DefaultClusterName holds the test default cluster name
	DefaultClusterName = "defClusterName"
	// ProjectName holds the test project ID
	ProjectName = "my-first-project-ID"
	// TestDatacenter holds datacenter name
	TestSeedDatacenter = "us-central1"
	// TestServiceAccountHashKey authenticates the service account's token value using HMAC
	TestServiceAccountHashKey = "eyJhbGciOiJIUzI1NeyJhbGciOiJIUzI1N"
	// TestFakeToken signed JWT token with fake data
	TestFakeToken = "" /* 193-byte string literal not displayed */
	// TestOSdomain OpenStack domain
	TestOSdomain = "OSdomain"
	// TestOSuserPass OpenStack user password
	TestOSuserPass = "OSpass"
	// TestOSuserName OpenStack user name
	TestOSuserName = "OSuser"
	// TestFakeCredential Fake provider credential name
	TestFakeCredential = "fake"
	// RequiredEmailDomain required domain for predefined credentials
	RequiredEmailDomain = "acme.com"
	// DefaultKubernetesVersion kubernetes version
	DefaultKubernetesVersion = "1.17.9"
)

Variables

View Source
var SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

SchemeGroupVersion is group version used to register these objects

Functions

func APIUserToKubermaticUser

func APIUserToKubermaticUser(user apiv1.User) *kubermaticv1.User

APIUserToKubermaticUser simply converts apiv1.User to kubermaticv1.User type

func CheckStatusCode

func CheckStatusCode(wantStatusCode int, recorder *httptest.ResponseRecorder, t *testing.T)

func CompareVersions

func CompareVersions(t *testing.T, versions, expected []*apiv1.MasterVersion)

func CompareWithResult

func CompareWithResult(t *testing.T, res *httptest.ResponseRecorder, response string)

CompareWithResult a convenience function for comparing http.Body content with response

func CreateRawVariables added in v2.16.3

func CreateRawVariables(t *testing.T, in map[string]interface{}) *runtime.RawExtension

func CreateTestEndpoint

func CreateTestEndpoint(user apiv1.User, kubeObjects, kubermaticObjects []ctrlruntimeclient.Object, versions []*version.Version, updates []*version.Update, routingFunc newRoutingFunc) (http.Handler, error)

CreateTestEndpoint does exactly the same as CreateTestEndpointAndGetClients except it omits ClientsSets when returning

func CreateTestSeedsGetter added in v2.17.0

func CreateTestSeedsGetter(ctx context.Context, client ctrlruntimeclient.Client) provider.SeedsGetter

CreateTestSeedsGetter creates a SeedsGetter only useful for generic tests, as it does not follow the CE/EE conventions and always returns all Seeds.

func DefaultCreationTimestamp

func DefaultCreationTimestamp() time.Time

DefaultCreationTimestamp returns default test timestamp

func GenAPIUser

func GenAPIUser(name, email string) *apiv1.User

GenAPIUser generates a API user

func GenAdminUser added in v2.16.3

func GenAdminUser(name, email string, isAdmin bool) *kubermaticv1.User

func GenBinding

func GenBinding(projectID, email, group string) *kubermaticv1.UserProjectBinding

GenBinding generates a binding

func GenBlacklistTokenSecret

func GenBlacklistTokenSecret(name string, tokens []byte) *corev1.Secret

func GenCluster

func GenCluster(id string, name string, projectID string, creationTime time.Time, modifiers ...func(*kubermaticv1.Cluster)) *kubermaticv1.Cluster

func GenClusterWithOpenstack

func GenClusterWithOpenstack(cluster *kubermaticv1.Cluster) *kubermaticv1.Cluster

func GenConstraint added in v2.16.3

func GenConstraint(name, namespace, kind string) *kubermaticv1.Constraint

func GenConstraintTemplate added in v2.16.3

func GenConstraintTemplate(name string) *kubermaticv1.ConstraintTemplate

func GenDefaultAPIConstraint added in v2.16.3

func GenDefaultAPIConstraint(name, kind string) apiv2.Constraint

func GenDefaultAPIUser

func GenDefaultAPIUser() *apiv1.User

GenDefaultAPIUser generates a default API user

func GenDefaultAdminAPIUser

func GenDefaultAdminAPIUser() *apiv1.User

GenDefaultAdminAPIUser generates a default admin API user

func GenDefaultCluster

func GenDefaultCluster() *kubermaticv1.Cluster

func GenDefaultClusterRole added in v2.16.3

func GenDefaultClusterRole(name string) *rbacv1.ClusterRole

func GenDefaultClusterRoleBinding added in v2.16.3

func GenDefaultClusterRoleBinding(name, roleID, userEmail string) *rbacv1.ClusterRoleBinding

func GenDefaultConstraintTemplate added in v2.16.3

func GenDefaultConstraintTemplate(name string) apiv2.ConstraintTemplate

func GenDefaultExpiry

func GenDefaultExpiry() (apiv1.Time, error)

func GenDefaultExternalClusterNode

func GenDefaultExternalClusterNode() (*corev1.Node, error)

func GenDefaultExternalClusterNodes

func GenDefaultExternalClusterNodes() ([]ctrlruntimeclient.Object, error)

func GenDefaultGlobalSettings

func GenDefaultGlobalSettings() *kubermaticv1.KubermaticSetting

func GenDefaultGroupClusterRoleBinding added in v2.16.3

func GenDefaultGroupClusterRoleBinding(name, roleID, group string) *rbacv1.ClusterRoleBinding

func GenDefaultGroupRoleBinding added in v2.16.3

func GenDefaultGroupRoleBinding(name, namespace, roleID, group string) *rbacv1.RoleBinding

func GenDefaultKubermaticObjects

func GenDefaultKubermaticObjects(objs ...ctrlruntimeclient.Object) []ctrlruntimeclient.Object

GenDefaultKubermaticObjects generates default kubermatic object

func GenDefaultOwnerBinding

func GenDefaultOwnerBinding() *kubermaticv1.UserProjectBinding

GenDefaultOwnerBinding generates default owner binding

func GenDefaultPreset

func GenDefaultPreset() *kubermaticv1.Preset

func GenDefaultProject

func GenDefaultProject() *kubermaticv1.Project

GenDefaultProject generates a default project

func GenDefaultRole added in v2.16.3

func GenDefaultRole(name, namespace string) *rbacv1.Role

func GenDefaultRoleBinding added in v2.16.3

func GenDefaultRoleBinding(name, namespace, roleID, userEmail string) *rbacv1.RoleBinding

func GenDefaultSaToken

func GenDefaultSaToken(projectID, saID, name, id string) *corev1.Secret

func GenDefaultSettings

func GenDefaultSettings() *kubermaticv1.KubermaticSetting

func GenDefaultUser

func GenDefaultUser() *kubermaticv1.User

GenDefaultUser generates a default user

func GenDefaultVersions

func GenDefaultVersions() []*version.Version

func GenInactiveProjectServiceAccount added in v2.17.0

func GenInactiveProjectServiceAccount(id, name, group, projectName string) *kubermaticv1.User

GenInactiveProjectServiceAccount generates a Service Account resource

func GenMainServiceAccount added in v2.17.0

func GenMainServiceAccount(id, name, group, ownerEmail string) *kubermaticv1.User

func GenProject

func GenProject(name, phase string, creationTime time.Time, oRef ...metav1.OwnerReference) *kubermaticv1.Project

GenProject generates new empty project

func GenProjectServiceAccount added in v2.17.0

func GenProjectServiceAccount(id, name, group, projectName string) *kubermaticv1.User

func GenTestAddon

func GenTestAddon(name string, variables *runtime.RawExtension, cluster *kubermaticv1.Cluster, creationTime time.Time) *kubermaticv1.Addon

func GenTestEvent

func GenTestEvent(eventName, eventType, eventReason, eventMessage, kind, uid string) *corev1.Event

func GenTestMachine

func GenTestMachine(name, rawProviderSpec string, labels map[string]string, ownerRef []metav1.OwnerReference) *clusterv1alpha1.Machine

func GenTestMachineDeployment

func GenTestMachineDeployment(name, rawProviderSpec string, selector map[string]string, dynamicConfig bool) *clusterv1alpha1.MachineDeployment

func GenTestSeed

func GenTestSeed() *kubermaticv1.Seed

func GenUser

func GenUser(id, name, email string) *kubermaticv1.User

GenUser generates a User resource note if the id is empty then it will be auto generated

func GenerateTestKubeconfig

func GenerateTestKubeconfig(clusterID, token string) string

GenerateTestKubeconfig returns test kubeconfig yaml structure

func GetUser

func GetUser(email, id, name string) apiv1.User

GetUser is a convenience function for generating apiv1.User

func RegisterScheme added in v2.16.3

func RegisterScheme(builder runtime.SchemeBuilder) error

Types

type ClientsSets

type ClientsSets struct {
	FakeKubermaticClient *kubermaticfakeclientset.Clientset
	FakeClient           ctrlruntimeclient.Client
	// this client is used for unprivileged methods where impersonated client is used
	FakeKubernetesCoreClient kubernetesclientset.Interface

	TokenAuthenticator serviceaccount.TokenAuthenticator
	TokenGenerator     serviceaccount.TokenGenerator
}

ClientsSets a simple wrapper that holds fake client sets

func CreateTestEndpointAndGetClients

func CreateTestEndpointAndGetClients(user apiv1.User, seedsGetter provider.SeedsGetter, kubeObjects, machineObjects, kubermaticObjects []ctrlruntimeclient.Object, versions []*version.Version, updates []*version.Update, routingFunc newRoutingFunc) (http.Handler, *ClientsSets, error)

CreateTestEndpointAndGetClients is a convenience function that instantiates fake providers and sets up routes for the tests

type ConstraintSpec added in v2.16.3

type ConstraintSpec struct {
	Match      v1.Match          `json:"match,omitempty"`
	Parameters map[string]string `json:"parameters,omitempty"`
}

func (*ConstraintSpec) DeepCopy added in v2.16.3

func (in *ConstraintSpec) DeepCopy() *ConstraintSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequiredLabelSpec.

func (*ConstraintSpec) DeepCopyInto added in v2.16.3

func (in *ConstraintSpec) DeepCopyInto(out *ConstraintSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConstraintStatus added in v2.16.3

type ConstraintStatus struct {
	Enforcement    string      `json:"enforcement,omitempty"`
	AuditTimestamp string      `json:"auditTimestamp,omitempty"`
	Violations     []Violation `json:"violations,omitempty"`
}

func (*ConstraintStatus) DeepCopy added in v2.16.3

func (in *ConstraintStatus) DeepCopy() *ConstraintStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConstraintStatus.

func (*ConstraintStatus) DeepCopyInto added in v2.16.3

func (in *ConstraintStatus) DeepCopyInto(out *ConstraintStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FakeConstraintProvider added in v2.16.3

type FakeConstraintProvider struct {
	Provider   *kubernetes.ConstraintProvider
	FakeClient ctrlruntimeclient.Client
}

func (*FakeConstraintProvider) Create added in v2.16.3

func (*FakeConstraintProvider) Delete added in v2.16.3

func (p *FakeConstraintProvider) Delete(cluster *kubermaticapiv1.Cluster, userInfo *provider.UserInfo, name string) error

func (*FakeConstraintProvider) Get added in v2.16.3

func (*FakeConstraintProvider) List added in v2.16.3

func (*FakeConstraintProvider) Update added in v2.16.3

type FakeConstraintTemplateProvider added in v2.16.3

type FakeConstraintTemplateProvider struct {
	Provider   *kubernetes.ConstraintTemplateProvider
	FakeClient ctrlruntimeclient.Client
}

func (*FakeConstraintTemplateProvider) Create added in v2.16.3

func (*FakeConstraintTemplateProvider) Delete added in v2.16.3

func (*FakeConstraintTemplateProvider) Get added in v2.16.3

func (*FakeConstraintTemplateProvider) List added in v2.16.3

func (*FakeConstraintTemplateProvider) Update added in v2.16.3

type FakeExternalClusterProvider

type FakeExternalClusterProvider struct {
	Provider   *kubernetes.ExternalClusterProvider
	FakeClient ctrlruntimeclient.Client
}

func (*FakeExternalClusterProvider) CreateOrUpdateKubeconfigSecretForCluster

func (p *FakeExternalClusterProvider) CreateOrUpdateKubeconfigSecretForCluster(ctx context.Context, cluster *kubermaticapiv1.ExternalCluster, kubeconfig string) error

func (*FakeExternalClusterProvider) Delete

func (*FakeExternalClusterProvider) GenerateClient

func (*FakeExternalClusterProvider) Get

func (*FakeExternalClusterProvider) GetClient

func (*FakeExternalClusterProvider) GetNode

func (*FakeExternalClusterProvider) GetVersion

func (*FakeExternalClusterProvider) IsMetricServerAvailable

func (p *FakeExternalClusterProvider) IsMetricServerAvailable(cluster *kubermaticapiv1.ExternalCluster) (bool, error)

func (*FakeExternalClusterProvider) List

func (*FakeExternalClusterProvider) ListNodes

func (*FakeExternalClusterProvider) New

func (*FakeExternalClusterProvider) Update

type FakePrivilegedProjectProvider

type FakePrivilegedProjectProvider struct {
}

func NewFakePrivilegedProjectProvider

func NewFakePrivilegedProjectProvider() *FakePrivilegedProjectProvider

func (*FakePrivilegedProjectProvider) DeleteUnsecured

func (f *FakePrivilegedProjectProvider) DeleteUnsecured(projectInternalName string) error

DeleteUnsecured deletes any given project This function is unsafe in a sense that it uses privileged account to delete project with the given name

func (*FakePrivilegedProjectProvider) GetUnsecured

func (f *FakePrivilegedProjectProvider) GetUnsecured(projectInternalName string, options *provider.ProjectGetOptions) (*kubermaticapiv1.Project, error)

GetUnsecured returns the project with the given name This function is unsafe in a sense that it uses privileged account to get project with the given name

func (*FakePrivilegedProjectProvider) UpdateUnsecured

UpdateUnsecured update an existing project and returns it This function is unsafe in a sense that it uses privileged account to update project

type FakeProjectProvider

type FakeProjectProvider struct {
}

func NewFakeProjectProvider

func NewFakeProjectProvider() *FakeProjectProvider

func (*FakeProjectProvider) Delete

func (f *FakeProjectProvider) Delete(userInfo *provider.UserInfo, projectInternalName string) error

Delete deletes the given project as the given user

Note: Before deletion project's status.phase is set to ProjectTerminating

func (*FakeProjectProvider) Get

func (f *FakeProjectProvider) Get(userInfo *provider.UserInfo, projectInternalName string, options *provider.ProjectGetOptions) (*kubermaticapiv1.Project, error)

Get returns the project with the given name

func (*FakeProjectProvider) List

List gets a list of projects, by default it returns all resources. If you want to filter the result please set ProjectListOptions

Note that the list is taken from the cache

func (*FakeProjectProvider) New

func (*FakeProjectProvider) Update

Update update an existing project and returns it

type IssuerVerifier

type IssuerVerifier struct {
	// contains filtered or unexported fields
}

IssuerVerifier is a test stub that mocks OIDC responses

func NewFakeOIDCClient

func NewFakeOIDCClient(user apiv1.User) *IssuerVerifier

NewFakeOIDCClient returns fake OIDC issuer and verifier

func (*IssuerVerifier) AuthCodeURL

func (o *IssuerVerifier) AuthCodeURL(state string, offlineAsScope bool, scopes ...string) string

AuthCodeURL returns a URL to OpenID provider's consent page

func (*IssuerVerifier) Exchange

func (o *IssuerVerifier) Exchange(ctx context.Context, code string) (auth.OIDCToken, error)

Exchange converts an authorization code into a token.

func (*IssuerVerifier) Extract

func (o *IssuerVerifier) Extract(_ *http.Request) (string, error)

Extractor knows how to extract the ID token from the request

func (*IssuerVerifier) Verify

func (o *IssuerVerifier) Verify(ctx context.Context, token string) (auth.TokenClaims, error)

Verify parses a raw ID Token, verifies it's been signed by the provider, performs any additional checks depending on the Config, and returns the payload as TokenClaims.

type NewAddonSliceWrapper

type NewAddonSliceWrapper []apiv1.Addon

NewAddonSliceWrapper wraps []apiv1.Addon to provide convenient methods for tests

func (*NewAddonSliceWrapper) DecodeOrDie

DecodeOrDie reads and decodes json data from the reader

func (NewAddonSliceWrapper) EqualOrDie

func (k NewAddonSliceWrapper) EqualOrDie(expected NewAddonSliceWrapper, t *testing.T)

EqualOrDie compares whether expected collection is equal to the actual one

func (NewAddonSliceWrapper) Sort

func (k NewAddonSliceWrapper) Sort()

Sort sorts the collection by CreationTimestamp

type NewClusterV1SliceWrapper

type NewClusterV1SliceWrapper []apiv1.Cluster

NewClusterV1SliceWrapper wraps []apiv1.Cluster to provide convenient methods for tests

func (*NewClusterV1SliceWrapper) DecodeOrDie

DecodeOrDie reads and decodes json data from the reader

func (NewClusterV1SliceWrapper) EqualOrDie

func (k NewClusterV1SliceWrapper) EqualOrDie(expected NewClusterV1SliceWrapper, t *testing.T)

EqualOrDie compares whether expected collection is equal to the actual one

func (NewClusterV1SliceWrapper) Sort

func (k NewClusterV1SliceWrapper) Sort()

Sort sorts the collection by CreationTimestamp

type NewConstraintTemplateV1SliceWrapper added in v2.16.3

type NewConstraintTemplateV1SliceWrapper []apiv2.ConstraintTemplate

NewConstraintTemplateV1SliceWrapper wraps []apiv1.ConstraintTemplate to provide convenient methods for tests

func (*NewConstraintTemplateV1SliceWrapper) DecodeOrDie added in v2.16.3

DecodeOrDie reads and decodes json data from the reader

func (NewConstraintTemplateV1SliceWrapper) EqualOrDie added in v2.16.3

EqualOrDie compares whether expected collection is equal to the actual one

func (NewConstraintTemplateV1SliceWrapper) Sort added in v2.16.3

Sort sorts the collection by Name

type NewConstraintsSliceWrapper added in v2.16.3

type NewConstraintsSliceWrapper []apiv2.Constraint

NewConstraintsSliceWrapper wraps []apiv2.Constraints to provide convenient methods for tests

func (*NewConstraintsSliceWrapper) DecodeOrDie added in v2.16.3

DecodeOrDie reads and decodes json data from the reader

func (NewConstraintsSliceWrapper) EqualOrDie added in v2.16.3

EqualOrDie compares whether expected collection is equal to the actual one

func (NewConstraintsSliceWrapper) Sort added in v2.16.3

func (k NewConstraintsSliceWrapper) Sort()

Sort sorts the collection by Name

type NewRoleNameSliceWrapper

type NewRoleNameSliceWrapper []apiv1.RoleName

NewRoleNameSliceWrapper wraps []apiv1.RoleName to provide convenient methods for tests

func (*NewRoleNameSliceWrapper) DecodeOrDie

DecodeOrDie reads and decodes json data from the reader

func (NewRoleNameSliceWrapper) EqualOrDie

func (k NewRoleNameSliceWrapper) EqualOrDie(expected NewRoleNameSliceWrapper, t *testing.T)

EqualOrDie compares whether expected collection is equal to the actual one

func (NewRoleNameSliceWrapper) Sort

func (k NewRoleNameSliceWrapper) Sort()

Sort sorts the collection by CreationTimestamp

type NewSSHKeyV1SliceWrapper

type NewSSHKeyV1SliceWrapper []apiv1.SSHKey

NewSSHKeyV1SliceWrapper wraps []apiv1.SSHKey to provide convenient methods for tests

func (*NewSSHKeyV1SliceWrapper) DecodeOrDie

DecodeOrDie reads and decodes json data from the reader

func (NewSSHKeyV1SliceWrapper) EqualOrDie

func (k NewSSHKeyV1SliceWrapper) EqualOrDie(expected NewSSHKeyV1SliceWrapper, t *testing.T)

EqualOrDie compares whether expected collection is equal to the actual one

func (NewSSHKeyV1SliceWrapper) Sort

func (k NewSSHKeyV1SliceWrapper) Sort()

Sort sorts the collection by CreationTimestamp

type NewServiceAccountTokenV1SliceWrapper

type NewServiceAccountTokenV1SliceWrapper []apiv1.PublicServiceAccountToken

NewServiceAccountTokenV1SliceWrapper wraps []apiv1.ServiceAccountToken to provide convenient methods for tests

func (*NewServiceAccountTokenV1SliceWrapper) DecodeOrDie

DecodeOrDie reads and decodes json data from the reader

func (NewServiceAccountTokenV1SliceWrapper) EqualOrDie

EqualOrDie compares whether expected collection is equal to the actual one

func (NewServiceAccountTokenV1SliceWrapper) Sort

Sort sorts the collection by name

type NewServiceAccountV1SliceWrapper

type NewServiceAccountV1SliceWrapper []apiv1.ServiceAccount

NewServiceAccountV1SliceWrapper wraps []apiv1.ServiceAccount to provide convenient methods for tests

func (*NewServiceAccountV1SliceWrapper) DecodeOrDie

DecodeOrDie reads and decodes json data from the reader

func (NewServiceAccountV1SliceWrapper) EqualOrDie

EqualOrDie compares whether expected collection is equal to the actual one

func (NewServiceAccountV1SliceWrapper) Sort

Sort sorts the collection by name

type NewUserV1SliceWrapper

type NewUserV1SliceWrapper []apiv1.User

NewUserV1SliceWrapper wraps []apiv1.User to provide convenient methods for tests

func (*NewUserV1SliceWrapper) DecodeOrDie

DecodeOrDie reads and decodes json data from the reader

func (NewUserV1SliceWrapper) EqualOrDie

func (k NewUserV1SliceWrapper) EqualOrDie(expected NewUserV1SliceWrapper, t *testing.T)

EqualOrDie compares whether expected collection is equal to the actual one

func (NewUserV1SliceWrapper) Sort

func (k NewUserV1SliceWrapper) Sort()

Sort sorts the collection by CreationTimestamp

type NodeDeploymentSliceWrapper added in v2.16.3

type NodeDeploymentSliceWrapper []apiv1.NodeDeployment

NodeDeploymentSliceWrapper wraps []apiv1.NodeDeployment to provide convenient methods for tests

func (*NodeDeploymentSliceWrapper) DecodeOrDie added in v2.16.3

DecodeOrDie reads and decodes json data from the reader

func (NodeDeploymentSliceWrapper) EqualOrDie added in v2.16.3

EqualOrDie compares whether expected collection is equal to the actual one

func (NodeDeploymentSliceWrapper) Sort added in v2.16.3

func (k NodeDeploymentSliceWrapper) Sort()

Sort sorts the collection by CreationTimestamp

type NodeV1SliceWrapper

type NodeV1SliceWrapper []apiv1.Node

NodeV1SliceWrapper wraps []apiv1.Node to provide convenient methods for tests

func (*NodeV1SliceWrapper) DecodeOrDie

func (k *NodeV1SliceWrapper) DecodeOrDie(r io.Reader, t *testing.T) *NodeV1SliceWrapper

DecodeOrDie reads and decodes json data from the reader

func (NodeV1SliceWrapper) EqualOrDie

func (k NodeV1SliceWrapper) EqualOrDie(expected NodeV1SliceWrapper, t *testing.T)

EqualOrDie compares whether expected collection is equal to the actual one

func (NodeV1SliceWrapper) Sort

func (k NodeV1SliceWrapper) Sort()

Sort sorts the collection by CreationTimestamp

type OicdProvider

type OicdProvider struct {
	// contains filtered or unexported fields
}

OicdProvider is a test stub that mocks *oidc.Provider

func (*OicdProvider) Endpoint

func (p *OicdProvider) Endpoint() oauth2.Endpoint

Endpoint returns the OAuth2 auth and token endpoints for the given provider.

type ProjectV1SliceWrapper

type ProjectV1SliceWrapper []apiv1.Project

ProjectV1SliceWrapper wraps []apiv1.Project to provide convenient methods for tests

func (*ProjectV1SliceWrapper) DecodeOrDie

DecodeOrDie reads and decodes json data from the reader

func (ProjectV1SliceWrapper) EqualOrDie

func (k ProjectV1SliceWrapper) EqualOrDie(expected ProjectV1SliceWrapper, t *testing.T)

EqualOrDie compares whether expected collection is equal to the actual one

func (ProjectV1SliceWrapper) Sort

func (k ProjectV1SliceWrapper) Sort()

Sort sorts the collection by CreationTimestamp

type RequiredLabel added in v2.16.3

type RequiredLabel struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ConstraintSpec   `json:"spec,omitempty"`
	Status ConstraintStatus `json:"status,omitempty"`
}

func (*RequiredLabel) DeepCopy added in v2.16.3

func (in *RequiredLabel) DeepCopy() *RequiredLabel

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequiredLabel.

func (*RequiredLabel) DeepCopyInto added in v2.16.3

func (in *RequiredLabel) DeepCopyInto(out *RequiredLabel)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RequiredLabel) DeepCopyObject added in v2.16.3

func (in *RequiredLabel) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RequiredLabelList added in v2.16.3

type RequiredLabelList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []runtime.RawExtension `json:"items"`
}

func (*RequiredLabelList) DeepCopy added in v2.16.3

func (in *RequiredLabelList) DeepCopy() *RequiredLabelList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequiredLabelList.

func (*RequiredLabelList) DeepCopyInto added in v2.16.3

func (in *RequiredLabelList) DeepCopyInto(out *RequiredLabelList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RequiredLabelList) DeepCopyObject added in v2.16.3

func (in *RequiredLabelList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type UniqueLabel added in v2.16.3

type UniqueLabel struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ConstraintSpec   `json:"spec,omitempty"`
	Status ConstraintStatus `json:"status,omitempty"`
}

+genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*UniqueLabel) DeepCopy added in v2.16.3

func (in *UniqueLabel) DeepCopy() *UniqueLabel

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UniqueLabel.

func (*UniqueLabel) DeepCopyInto added in v2.16.3

func (in *UniqueLabel) DeepCopyInto(out *UniqueLabel)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*UniqueLabel) DeepCopyObject added in v2.16.3

func (in *UniqueLabel) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type UniqueLabelList added in v2.16.3

type UniqueLabelList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []runtime.RawExtension `json:"items"`
}

func (*UniqueLabelList) DeepCopy added in v2.16.3

func (in *UniqueLabelList) DeepCopy() *UniqueLabelList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UniqueLabelList.

func (*UniqueLabelList) DeepCopyInto added in v2.16.3

func (in *UniqueLabelList) DeepCopyInto(out *UniqueLabelList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*UniqueLabelList) DeepCopyObject added in v2.16.3

func (in *UniqueLabelList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type Violation added in v2.16.3

type Violation struct {
	EnforcementAction string `json:"enforcementAction,omitempty"`
	Kind              string `json:"kind,omitempty"`
	Message           string `json:"message,omitempty"`
	Name              string `json:"name,omitempty"`
	Namespace         string `json:"namespace,omitempty"`
}

func (*Violation) DeepCopy added in v2.16.3

func (in *Violation) DeepCopy() *Violation

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Violation.

func (*Violation) DeepCopyInto added in v2.16.3

func (in *Violation) DeepCopyInto(out *Violation)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL