mocks

package
v0.0.0-...-8149b9c Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertKeyValueSliceToMap

func ConvertKeyValueSliceToMap(keyValueSlice []types.KeyValue) map[string]string

func CreateTestCNAMERecord

func CreateTestCNAMERecord(dynClient runtimeClient.WithWatch, name, cappName, cappNSName, hostname string, readyStatus, syncedStatus corev1.ConditionStatus)

CreateTestCNAMERecord creates a test CNAME record

func CreateTestCNAMERecordWithoutConditions

func CreateTestCNAMERecordWithoutConditions(dynClient runtimeClient.WithWatch, name, cappName, cappNSName, hostname string)

CreateTestCNAMERecordWithoutConditions creates a test CNAME record without conditions

func CreateTestCapp

func CreateTestCapp(dynClient runtimeClient.WithWatch, name, namespace, domain, site string, labels, annotations map[string]string)

CreateTestCapp creates a test Capp object.

func CreateTestCappRevision

func CreateTestCappRevision(dynClient runtimeClient.WithWatch, name, namespace, site string, labels, annotations map[string]string)

CreateTestCappRevision creates a test CappRevision object.

func CreateTestCappWithHostname

func CreateTestCappWithHostname(dynClient runtimeClient.WithWatch, name, namespace, hostname, domain string, labels, annotations map[string]string)

CreateTestCappWithHostname creates a test Capp object with hostname.

func CreateTestCappWithState

func CreateTestCappWithState(dynClient runtimeClient.WithWatch, name, namespace, state, site string, labels, annotations map[string]string)

CreateTestCappWithState creates a test Capp object with given state.

func CreateTestConfigMap

func CreateTestConfigMap(fakeClient *fake.Clientset, name, namespace string)

CreateTestConfigMap creates a test ConfigMap object.

func CreateTestNamespace

func CreateTestNamespace(fakeClient *fake.Clientset, name string)

CreateTestNamespace creates a test Namespace object.

func CreateTestPlacement

func CreateTestPlacement(dynClient runtimeClient.WithWatch, name, namespace string, labels map[string]string)

CreateTestPlacement creates a test Placement object.

func CreateTestPod

func CreateTestPod(fakeClient *fake.Clientset, namespace, name, cappName string, isMultipleContainers bool)

CreateTestPod creates a test Pod object.

func CreateTestRoleBinding

func CreateTestRoleBinding(fakeClient *fake.Clientset, name, namespace, role string)

CreateTestRoleBinding creates a test RoleBinding object.

func CreateTestSecret

func CreateTestSecret(fakeClient *fake.Clientset, name, namespace string)

CreateTestSecret creates a test Secret object.

func CreateTestServiceAccount

func CreateTestServiceAccount(fakeClient *fake.Clientset, namespace, name string, dockerCfgSecretName string)

CreateTestServiceAccount creates a test service account

func CreateTestServiceAccountWithToken

func CreateTestServiceAccountWithToken(fakeClient *fake.Clientset, namespace, serviceAccountName, tokenSecretName, tokenValue, dockerCfgSecretName string)

CreateTestServiceAccountWithToken creates a test service account

func GinContext

func GinContext() *gin.Context

GinContext creates a new *gin.Context for testing purposes

func PrepareCapp

func PrepareCapp(name, namespace, domain, site string, labels, annotations map[string]string) cappv1alpha1.Capp

PrepareCapp returns a mock Capp object.

func PrepareCappMetadata

func PrepareCappMetadata(name, namespace string) types.Metadata

PrepareCappMetadata returns a CappMetadata object.

func PrepareCappRevision

func PrepareCappRevision(name, namespace, site string, labels, annotations map[string]string) cappv1alpha1.CappRevision

PrepareCappRevision returns a mock CappRevision object.

func PrepareCappRevisionSpec

func PrepareCappRevisionSpec(site string, labels, annotations map[string]string) cappv1alpha1.CappRevisionSpec

PrepareCappRevisionSpec returns a mock CappRevision Spec object.

func PrepareCappRevisionStatus

func PrepareCappRevisionStatus() cappv1alpha1.CappRevisionStatus

PrepareCappRevisionStatus returns a mock CappRevision Status object.

func PrepareCappSpec

func PrepareCappSpec(site string) cappv1alpha1.CappSpec

PrepareCappSpec returns a mock Capp spec.

func PrepareCappSpecWithHostname

func PrepareCappSpecWithHostname(hostname, domain string) cappv1alpha1.CappSpec

PrepareCappSpecWithHostname returns a mock Capp spec with Hostname set.

func PrepareCappSpecWithState

func PrepareCappSpecWithState(state, site string) cappv1alpha1.CappSpec

PrepareCappSpecWithState returns a mock Capp spec witg given state.

func PrepareCappStatus

func PrepareCappStatus(name, namespace, domain string) cappv1alpha1.CappStatus

PrepareCappStatus returns a mock Capp status.

func PrepareCappStatusWithHostname

func PrepareCappStatusWithHostname(name, namespace, hostname, domain string) cappv1alpha1.CappStatus

PrepareCappStatusWithHostname returns a mock Capp status with Hostname set.

func PrepareCappStatusWithKnativeObject

func PrepareCappStatusWithKnativeObject(name string, state string) cappv1alpha1.CappStatus

PrepareCappStatusWithKnativeObject returns a mock Capp status with KnativeObject set.

func PrepareCappSummary

func PrepareCappSummary(name string, namespace string) types.CappSummary

PrepareCappSummary returns a CappSummary object.

func PrepareCappWithHostname

func PrepareCappWithHostname(name, namespace, hostname, domain string, labels, annotations map[string]string) cappv1alpha1.Capp

PrepareCappWithHostname returns a mock Capp object with Hostname set in the spec.

func PrepareCappWithKnativeObject

func PrepareCappWithKnativeObject(name, namespace, state, site string, labels, annotations map[string]string) cappv1alpha1.Capp

PrepareCappWithKnativeObject returns a mock Capp object with knative object status.

func PrepareCappWithState

func PrepareCappWithState(name, namespace, state, site string, labels, annotations map[string]string) cappv1alpha1.Capp

PrepareCappWithState returns a mock Capp object with given state.

func PrepareClusterRoleBinding

func PrepareClusterRoleBinding(username, clusterRoleName string) rbacv1.ClusterRoleBinding

func PrepareConfigMap

func PrepareConfigMap(name, namespace string, data map[string]string) corev1.ConfigMap

PrepareConfigMap returns a mock ConfigMap object.

func PrepareCreateCappType

func PrepareCreateCappType(name, site string, labels, annotations []types.KeyValue) types.CreateCapp

PrepareCreateCappType returns a CreateCapp object.

func PrepareCreateSecretRequestType

func PrepareCreateSecretRequestType(name, secretType, cert, key string, data []types.KeyValue) types.CreateSecretRequest

PrepareCreateSecretRequestType returns a Secret Request type object.

func PrepareDockerConfigSecret

func PrepareDockerConfigSecret(name, namespace, serviceAccountTokenSecretName string) corev1.Secret

PrepareDockerConfigSecret returns a mock docker config secret object.

func PrepareHTPasswdIdentityProvider

func PrepareHTPasswdIdentityProvider(providerName string, providerType configv1.IdentityProviderType, htpasswdProvider configv1.HTPasswdIdentityProvider) configv1.IdentityProvider

PrepareHTPasswdIdentityProvider returns a mock HTPasswordIde

func PrepareHTPasswdProvider

func PrepareHTPasswdProvider(secretName string) configv1.HTPasswdIdentityProvider

PrepareHTPasswdProvider returns a mock HTPasswordIdentityProvider object.

func PrepareIdentity

func PrepareIdentity(providerName, username string) userv1.Identity

PrepareIdentity returns a mock Identity object.

func PrepareNamespace

func PrepareNamespace(name string, labels map[string]string) corev1.Namespace

PrepareNamespace returns a mock Namespace object.

func PrepareNamespaceType

func PrepareNamespaceType(name string) types.Namespace

PrepareNamespaceType returns a mock Namespace type object.

func PreparePlacement

func PreparePlacement(name, namespace string, labels map[string]string) clusterv1beta1.Placement

PreparePlacement returns a mock Placement object.

func PreparePod

func PreparePod(namespace, podName, cappName string, isMultipleContainers bool) *corev1.Pod

PreparePod simulates creating a pod and adding some log lines.

func PrepareRoleBinding

func PrepareRoleBinding(name, namespace, role string) rbacv1.RoleBinding

PrepareRoleBinding returns a mock RoleBinding object.

func PrepareSecret

func PrepareSecret(name, namespace, dataKey, dataValue string) corev1.Secret

PrepareSecret returns a mock CappRevision object.

func PrepareSecretRequestType

func PrepareSecretRequestType(data []types.KeyValue) types.UpdateSecretRequest

PrepareSecretRequestType returns a Secret Request type object.

func PrepareServiceAccount

func PrepareServiceAccount(name, namespace string, dockerCfgSecretName string) *corev1.ServiceAccount

PrepareServiceAccount returns a mock ServiceAccount object.

func PrepareTokenSecret

func PrepareTokenSecret(name, namespace, tokenValue, serviceAccountName string) corev1.Secret

PrepareTokenSecret returns a mock token secret object.

func PrepareUpdateCappStateType

func PrepareUpdateCappStateType(state string) types.CappState

PrepareUpdateCappStateType returns a CappState object.

func PrepareUpdateCappType

func PrepareUpdateCappType(site string, labels, annotations []types.KeyValue) types.UpdateCapp

PrepareUpdateCappType returns an UpdateCappType object.

func PrepareUpdateUserDataType

func PrepareUpdateUserDataType(role string) types.UpdateUserData

PrepareUpdateUserDataType returns a mock User type object.

func PrepareUser

func PrepareUser(username string) userv1.User

PrepareUser returns a mock User object.

func PrepareUserType

func PrepareUserType(name, role string) types.User

PrepareUserType returns a mock User type object.

func SetPaginationValues

func SetPaginationValues(c *gin.Context, limit, page int)

Types

This section is empty.

Jump to

Keyboard shortcuts

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