Documentation ¶
Index ¶
- Constants
- Variables
- func CRDDescriptionMock() olmv1alpha1.CRDDescription
- func CRDDescriptionVolumeMountMock() olmv1alpha1.CRDDescription
- func ClusterServiceVersionListMock(ns, name string) *olmv1alpha1.ClusterServiceVersionList
- func ClusterServiceVersionListVolumeMountMock(ns, name string) *olmv1alpha1.ClusterServiceVersionList
- func ClusterServiceVersionMock(ns, name string) olmv1alpha1.ClusterServiceVersion
- func ClusterServiceVersionVolumeMountMock(ns, name string) olmv1alpha1.ClusterServiceVersion
- func ConfigMapMock(ns, name string) *corev1.ConfigMap
- func DatabaseCRDMock(ns string) apiextensionv1beta1.CustomResourceDefinition
- func DeploymentMock(ns, name string, matchLabels map[string]string) appsv1.Deployment
- func RouteCRMock(ns, name string) *unstructured.Unstructured
- func SecretMock(ns, name string, data map[string][]byte) *corev1.Secret
- func SecretMockRV(ns, name string) *corev1.Secret
- func ServiceBindingMock(ns string, name string, backingServiceNamespace *string, ...) *v1alpha1.ServiceBinding
- func UnstructuredClusterServiceVersionMock(ns, name string) (*unstructured.Unstructured, error)
- func UnstructuredClusterServiceVersionVolumeMountMock(ns string, name string) (*unstructured.Unstructured, error)
- func UnstructuredDatabaseCRDMock(ns string) (*unstructured.Unstructured, error)
- func UnstructuredDatabaseCRMock(ns, name string) *ustrv1.Unstructured
- func UnstructuredDatabaseConfigMapMock(ns, name, configMapName string) (*unstructured.Unstructured, error)
- func UnstructuredDeploymentConfigMock(ns, name string) *ustrv1.Unstructured
- func UnstructuredDeploymentMock(ns, name string, matchLabels map[string]string) (*unstructured.Unstructured, error)
- func UnstructuredKnativeServiceMock(ns, name string, matchLabels map[string]string) *ustrv1.Unstructured
- func UnstructuredNestedDatabaseCRMock(ns, name string) (*unstructured.Unstructured, error)
- func UnstructuredPostgresDatabaseCRMock(ns, name string) (*unstructured.Unstructured, error)
- func UnstructuredSecretMock(ns, name string) (*unstructured.Unstructured, error)
- func UnstructuredSecretMockRV(ns, name string) (*unstructured.Unstructured, error)
- func UnstructuredServiceBindingMock(ns string, name string, backingServiceResourceRef string, ...) (*unstructured.Unstructured, error)
- type ConfigMapDatabase
- type ConfigMapDatabaseSpec
- type Fake
- func (f *Fake) AddMockResource(resource runtime.Object)
- func (f *Fake) AddMockedCSVList(name string)
- func (f *Fake) AddMockedCSVWithVolumeMountList(name string)
- func (f *Fake) AddMockedDatabaseCR(ref string, namespace string) runtime.Object
- func (f *Fake) AddMockedServiceBinding(name string, backingServiceNamespace *string, backingServiceResourceRef string, ...) *v1alpha1.ServiceBinding
- func (f *Fake) AddMockedServiceBindingWithUnannotated(name string, backingServiceResourceRef string, applicationResourceRef string, ...) *v1alpha1.ServiceBinding
- func (f *Fake) AddMockedUnstructuredCSV(name string)
- func (f *Fake) AddMockedUnstructuredCSVWithVolumeMount(name string)
- func (f *Fake) AddMockedUnstructuredConfigMap(name string)
- func (f *Fake) AddMockedUnstructuredDatabaseCR(ref string)
- func (f *Fake) AddMockedUnstructuredDatabaseCRD() *unstructured.Unstructured
- func (f *Fake) AddMockedUnstructuredDeployment(name string, matchLabels map[string]string) *unstructured.Unstructured
- func (f *Fake) AddMockedUnstructuredDeploymentConfig(name string, matchLabels map[string]string)
- func (f *Fake) AddMockedUnstructuredKnativeService(name string, matchLabels map[string]string)
- func (f *Fake) AddMockedUnstructuredPostgresDatabaseCR(ref string) *unstructured.Unstructured
- func (f *Fake) AddMockedUnstructuredSecret(name string) *unstructured.Unstructured
- func (f *Fake) AddMockedUnstructuredSecretRV(name string) *unstructured.Unstructured
- func (f *Fake) AddMockedUnstructuredServiceBinding(name string, backingServiceResourceRef string, applicationResourceRef string, ...) *unstructured.Unstructured
- func (f *Fake) AddMockedUnstructuredServiceBindingWithoutApplication(name string, backingServiceResourceRef string) *unstructured.Unstructured
- func (f *Fake) AddMockedUnstructuredServiceBindingWithoutService(name string, applicationResourceRef string, ...) *unstructured.Unstructured
- func (f *Fake) AddNamespacedMockedSecret(name string, namespace string, data map[string][]byte)
- func (f *Fake) FakeDynClient() *fakedynamic.FakeDynamicClient
- type NestedDatabase
- type NestedDatabaseSpec
- type NestedImage
- type PostgresDatabase
- type PostgresDatabaseSpec
- type ThirdLevel
Constants ¶
const ( // Fixme(Akash): This values are tightly coupled with postgresql operator. // Need to make it more dynamic. CRDName = "postgresql.baiju.dev" CRDVersion = "v1alpha1" CRDKind = "Database" )
resource details employed in mocks
Variables ¶
var ( // DBNameSpecDesc default spec descriptor to inform the database name. DBNameSpecDesc = olmv1alpha1.SpecDescriptor{ DisplayName: "Database Name", Description: "Database Name", Path: "dbName", XDescriptors: []string{"binding:env:attribute"}, } ImageSpecDesc = olmv1alpha1.SpecDescriptor{ Path: "image", DisplayName: "Image", Description: "Image Name", XDescriptors: nil, } // DBNameSpecDesc default spec descriptor to inform the database name. DBNameSpecIp = olmv1alpha1.SpecDescriptor{ DisplayName: "Database IP", Description: "Database IP", Path: "dbConnectionIp", XDescriptors: []string{"binding:env:attribute"}, } // DBConfigMapSpecDesc spec descriptor to describe a operator that export username and password // via config-map, instead of a usual secret. DBConfigMapSpecDesc = olmv1alpha1.SpecDescriptor{ DisplayName: "DB ConfigMap", Description: "Database ConfigMap", Path: "dbConfigMap", XDescriptors: []string{ "urn:alm:descriptor:io.kubernetes:ConfigMap", "binding:env:object:configmap:username", "binding:env:object:configmap:password", }, } // DBPasswordCredentialsOnEnvStatusDesc status descriptor to describe a database operator that // publishes username and password over a secret. Default approach. DBPasswordCredentialsOnEnvStatusDesc = olmv1alpha1.StatusDescriptor{ DisplayName: "DB Password Credentials", Description: "Database credentials secret", Path: "dbCredentials", XDescriptors: []string{ "urn:alm:descriptor:io.kubernetes:Secret", "binding:env:object:secret:username", "binding:env:object:secret:password", }, } // DBPasswordCredentialsOnVolumeMountStatusDesc status descriptor to describe a operator that // informs credentials via a volume. DBPasswordCredentialsOnVolumeMountStatusDesc = olmv1alpha1.StatusDescriptor{ DisplayName: "DB Password Credentials", Description: "Database credentials secret", Path: "dbCredentials", XDescriptors: []string{ "urn:alm:descriptor:io.kubernetes:Secret", "binding:volumemount:secret:username", "binding:volumemount:secret:password", }, } )
Functions ¶
func CRDDescriptionMock ¶
func CRDDescriptionMock() olmv1alpha1.CRDDescription
CRDDescriptionMock based on PostgreSQL operator, returning a mock using default third party operator setup.
func CRDDescriptionVolumeMountMock ¶
func CRDDescriptionVolumeMountMock() olmv1alpha1.CRDDescription
CRDDescriptionVolumeMountMock based on PostgreSQL operator, returns a mock having credentials in a volume.
func ClusterServiceVersionListMock ¶
func ClusterServiceVersionListMock(ns, name string) *olmv1alpha1.ClusterServiceVersionList
ClusterServiceVersionListMock returns a list with a single CSV object inside, reusing mock.
func ClusterServiceVersionListVolumeMountMock ¶
func ClusterServiceVersionListVolumeMountMock(ns, name string) *olmv1alpha1.ClusterServiceVersionList
ClusterServiceVersionListVolumeMountMock returns a list with a single CSV object inside, reusing mock.
func ClusterServiceVersionMock ¶
func ClusterServiceVersionMock(ns, name string) olmv1alpha1.ClusterServiceVersion
ClusterServiceVersionMock based on PostgreSQL operator having what's expected as defaults.
func ClusterServiceVersionVolumeMountMock ¶
func ClusterServiceVersionVolumeMountMock(ns, name string) olmv1alpha1.ClusterServiceVersion
ClusterServiceVersionVolumeMountMock based on PostgreSQL operator.
func ConfigMapMock ¶
ConfigMapMock returns a dummy config-map object.
func DatabaseCRDMock ¶ added in v0.1.1
func DatabaseCRDMock(ns string) apiextensionv1beta1.CustomResourceDefinition
func DeploymentMock ¶
func DeploymentMock(ns, name string, matchLabels map[string]string) appsv1.Deployment
DeploymentMock creates a mocked Deployment object of busybox.
func RouteCRMock ¶ added in v0.0.21
func RouteCRMock(ns, name string) *unstructured.Unstructured
func SecretMock ¶
SecretMock returns a Secret based on PostgreSQL operator usage.
func SecretMockRV ¶ added in v0.3.0
SecretMockRV returns a Secret with a resourceVersion.
func ServiceBindingMock ¶ added in v0.3.0
func ServiceBindingMock( ns string, name string, backingServiceNamespace *string, backingServiceResourceRef string, applicationResourceRef string, applicationGVR schema.GroupVersionResource, matchLabels map[string]string, ) *v1alpha1.ServiceBinding
ServiceBindingMock return a binding-request mock of informed name and match labels.
func UnstructuredClusterServiceVersionMock ¶
func UnstructuredClusterServiceVersionMock(ns, name string) (*unstructured.Unstructured, error)
UnstructuredClusterServiceVersionMock unstructured object based on ClusterServiceVersionMock.
func UnstructuredClusterServiceVersionVolumeMountMock ¶
func UnstructuredClusterServiceVersionVolumeMountMock( ns string, name string, ) (*unstructured.Unstructured, error)
UnstructuredClusterServiceVersionVolumeMountMock returns ClusterServiceVersionVolumeMountMock as unstructured object
func UnstructuredDatabaseCRDMock ¶ added in v0.1.1
func UnstructuredDatabaseCRDMock(ns string) (*unstructured.Unstructured, error)
func UnstructuredDatabaseCRMock ¶ added in v0.0.19
func UnstructuredDatabaseCRMock(ns, name string) *ustrv1.Unstructured
UnstructuredDatabaseCRMock returns a unstructured version of DatabaseCRMock.
func UnstructuredDatabaseConfigMapMock ¶ added in v0.0.19
func UnstructuredDatabaseConfigMapMock(ns, name, configMapName string) (*unstructured.Unstructured, error)
UnstructuredDatabaseConfigMapMock returns a unstructured version of DatabaseConfigMapMock.
func UnstructuredDeploymentConfigMock ¶ added in v0.1.1
func UnstructuredDeploymentConfigMock(ns, name string) *ustrv1.Unstructured
UnstructuredDeploymentConfigMock converts the DeploymentMock to unstructured.
func UnstructuredDeploymentMock ¶
func UnstructuredDeploymentMock( ns, name string, matchLabels map[string]string, ) (*unstructured.Unstructured, error)
UnstructuredDeploymentMock converts the DeploymentMock to unstructured.
func UnstructuredKnativeServiceMock ¶ added in v0.1.1
func UnstructuredKnativeServiceMock( ns, name string, matchLabels map[string]string, ) *ustrv1.Unstructured
UnstructuredKnativeServiceMock converts the KnativeServiceMock to unstructured.
func UnstructuredNestedDatabaseCRMock ¶ added in v0.0.19
func UnstructuredNestedDatabaseCRMock(ns, name string) (*unstructured.Unstructured, error)
UnstructuredNestedDatabaseCRMock returns a unstructured object from NestedDatabaseCRMock.
func UnstructuredPostgresDatabaseCRMock ¶ added in v0.1.1
func UnstructuredPostgresDatabaseCRMock(ns, name string) (*unstructured.Unstructured, error)
func UnstructuredSecretMock ¶ added in v0.1.1
func UnstructuredSecretMock(ns, name string) (*unstructured.Unstructured, error)
func UnstructuredSecretMockRV ¶ added in v0.3.0
func UnstructuredSecretMockRV(ns, name string) (*unstructured.Unstructured, error)
func UnstructuredServiceBindingMock ¶ added in v0.3.0
func UnstructuredServiceBindingMock( ns string, name string, backingServiceResourceRef string, applicationResourceRef string, applicationGVR schema.GroupVersionResource, matchLabels map[string]string, ) (*unstructured.Unstructured, error)
UnstructuredServiceBindingMock returns a unstructured version of SBR.
Types ¶
type ConfigMapDatabase ¶
type ConfigMapDatabase struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec ConfigMapDatabaseSpec `json:"spec,omitempty"` }
ConfigMapDatabase ...
func DatabaseConfigMapMock ¶
func DatabaseConfigMapMock(ns, name, configMapName string) *ConfigMapDatabase
DatabaseConfigMapMock returns a local ConfigMapDatabase object.
type ConfigMapDatabaseSpec ¶
type ConfigMapDatabaseSpec struct { DBConfigMap string `json:"dbConfigMap"` ImageName string Image string }
ConfigMapDatabaseSpec ...
type Fake ¶
type Fake struct { S *runtime.Scheme // runtime client scheme // contains filtered or unexported fields }
Fake defines all the elements to fake a kubernetes api client.
func (*Fake) AddMockResource ¶ added in v0.0.21
func (*Fake) AddMockedCSVList ¶
AddMockedCSVList add mocked object from ClusterServiceVersionListMock.
func (*Fake) AddMockedCSVWithVolumeMountList ¶
AddMockedCSVWithVolumeMountList add mocked object from ClusterServiceVersionListVolumeMountMock.
func (*Fake) AddMockedDatabaseCR ¶ added in v0.0.19
AddMockedDatabaseCR add mocked object from DatabaseCRMock.
func (*Fake) AddMockedServiceBinding ¶ added in v0.3.0
func (f *Fake) AddMockedServiceBinding( name string, backingServiceNamespace *string, backingServiceResourceRef string, applicationResourceRef string, applicationGVR schema.GroupVersionResource, matchLabels map[string]string, ) *v1alpha1.ServiceBinding
AddMockedServiceBinding add mocked object from ServiceBindingMock.
func (*Fake) AddMockedServiceBindingWithUnannotated ¶ added in v0.3.0
func (f *Fake) AddMockedServiceBindingWithUnannotated( name string, backingServiceResourceRef string, applicationResourceRef string, applicationGVR schema.GroupVersionResource, matchLabels map[string]string, ) *v1alpha1.ServiceBinding
AddMockedServiceBindingWithUnannotated add mocked object from ServiceBindingMock with DetectBindingResources.
func (*Fake) AddMockedUnstructuredCSV ¶
AddMockedUnstructuredCSV add mocked unstructured CSV.
func (*Fake) AddMockedUnstructuredCSVWithVolumeMount ¶
AddMockedUnstructuredCSVWithVolumeMount same than AddMockedCSVWithVolumeMountList but using unstructured object.
func (*Fake) AddMockedUnstructuredConfigMap ¶ added in v0.1.1
AddMockedUnstructuredConfigMap add mocked object from ConfigMapMock.
func (*Fake) AddMockedUnstructuredDatabaseCR ¶ added in v0.0.19
func (*Fake) AddMockedUnstructuredDatabaseCRD ¶ added in v0.1.1
func (f *Fake) AddMockedUnstructuredDatabaseCRD() *unstructured.Unstructured
func (*Fake) AddMockedUnstructuredDeployment ¶
func (f *Fake) AddMockedUnstructuredDeployment(name string, matchLabels map[string]string) *unstructured.Unstructured
AddMockedUnstructuredDeployment add mocked object from UnstructuredDeploymentMock.
func (*Fake) AddMockedUnstructuredDeploymentConfig ¶ added in v0.1.1
AddMockedUnstructuredDeploymentConfig adds mocked object from UnstructuredDeploymentConfigMock.
func (*Fake) AddMockedUnstructuredKnativeService ¶ added in v0.1.1
AddMockedUnstructuredKnativeService add mocked object from UnstructuredKnativeService.
func (*Fake) AddMockedUnstructuredPostgresDatabaseCR ¶ added in v0.1.1
func (f *Fake) AddMockedUnstructuredPostgresDatabaseCR(ref string) *unstructured.Unstructured
func (*Fake) AddMockedUnstructuredSecret ¶ added in v0.1.1
func (f *Fake) AddMockedUnstructuredSecret(name string) *unstructured.Unstructured
AddMockedUnstructuredSecret add mocked object from SecretMock.
func (*Fake) AddMockedUnstructuredSecretRV ¶ added in v0.3.0
func (f *Fake) AddMockedUnstructuredSecretRV(name string) *unstructured.Unstructured
AddMockedUnstructuredSecret add mocked object from SecretMock. This secret is created with a resourceVersion
func (*Fake) AddMockedUnstructuredServiceBinding ¶ added in v0.3.0
func (f *Fake) AddMockedUnstructuredServiceBinding( name string, backingServiceResourceRef string, applicationResourceRef string, applicationGVR schema.GroupVersionResource, matchLabels map[string]string, ) *unstructured.Unstructured
AddMockedUnstructuredServiceBinding creates a mock ServiceBinding object
func (*Fake) AddMockedUnstructuredServiceBindingWithoutApplication ¶ added in v0.3.0
func (f *Fake) AddMockedUnstructuredServiceBindingWithoutApplication( name string, backingServiceResourceRef string, ) *unstructured.Unstructured
AddMockedUnstructuredServiceBindingWithoutApplication creates a mock ServiceBinding object
func (*Fake) AddMockedUnstructuredServiceBindingWithoutService ¶ added in v0.4.0
func (f *Fake) AddMockedUnstructuredServiceBindingWithoutService( name string, applicationResourceRef string, applicationGVR schema.GroupVersionResource, ) *unstructured.Unstructured
AddMockedUnstructuredServiceBindingWithoutApplication creates a mock ServiceBinding object
func (*Fake) AddNamespacedMockedSecret ¶ added in v0.1.1
AddNamespacedMockedSecret add mocked object from SecretMock in a namespace which isn't necessarily same as that of the ServiceBinding namespace.
func (*Fake) FakeDynClient ¶
func (f *Fake) FakeDynClient() *fakedynamic.FakeDynamicClient
FakeDynClient returns fake dynamic api client.
type NestedDatabase ¶
type NestedDatabase struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec NestedDatabaseSpec `json:"spec,omitempty"` }
NestedDatabase ...
func NestedDatabaseCRMock ¶
func NestedDatabaseCRMock(ns, name string) NestedDatabase
NestedDatabaseCRMock based on PostgreSQL operator, returning a instantiated object.
type NestedDatabaseSpec ¶
type NestedDatabaseSpec struct {
Image NestedImage `json:"image"`
}
NestedDatabaseSpec ...
type NestedImage ¶
type NestedImage struct { Name string `json:"name"` ThirdLevel ThirdLevel `json:"third"` }
NestedImage ...
type PostgresDatabase ¶ added in v0.1.1
type PostgresDatabase struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec PostgresDatabaseSpec `json:"spec,omitempty"` }
func PostgresDatabaseCRMock ¶ added in v0.1.1
func PostgresDatabaseCRMock(ns, name string) PostgresDatabase
type PostgresDatabaseSpec ¶ added in v0.1.1
type PostgresDatabaseSpec struct {
Username string `json:"username"`
}