Documentation ¶
Index ¶
- Constants
- Variables
- func CRDDescriptionConfigMapMock() olmv1alpha1.CRDDescription
- 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 DatabaseCRListMock(ns, name string) *pgv1alpha1.DatabaseList
- func DatabaseCRMock(ns, name string) pgv1alpha1.Database
- func DeploymentListMock(ns, name string, matchLabels map[string]string) appsv1.DeploymentList
- func DeploymentMock(ns, name string, matchLabels map[string]string) appsv1.Deployment
- func SecretMock(ns, name string) *corev1.Secret
- func ServiceBindingRequestMock(ns, name, resourceRef string, matchLabels map[string]string) *v1alpha1.ServiceBindingRequest
- func UnstructuredClusterServiceVersionMock(ns, name string) (*ustrv1.Unstructured, error)
- func UnstructuredClusterServiceVersionVolumeMountMock(ns string, name string) (*ustrv1.Unstructured, error)
- func UnstructuredDeploymentMock(ns, name string, matchLabels map[string]string) (*ustrv1.Unstructured, error)
- type ConfigMapDatabase
- type ConfigMapDatabaseSpec
- type Fake
- func (f *Fake) AddMockedCSVList(name string)
- func (f *Fake) AddMockedCSVWithVolumeMountList(name string)
- func (f *Fake) AddMockedDatabaseCRList(ref string)
- func (f *Fake) AddMockedSecret(name string)
- func (f *Fake) AddMockedServiceBindingRequest(name, ref string, matchLabels map[string]string) *v1alpha1.ServiceBindingRequest
- func (f *Fake) AddMockedUnstructuredCSV(name string)
- func (f *Fake) AddMockedUnstructuredCSVWithVolumeMount(name string)
- func (f *Fake) AddMockedUnstructuredDeployment(name string, matchLabels map[string]string)
- func (f *Fake) FakeClient() client.Client
- func (f *Fake) FakeDynClient() dynamic.Interface
- type NestedDatabase
- type NestedDatabaseSpec
- type NestedImage
- type ThirdLevel
Constants ¶
const ( CRDName = "postgresql.baiju.dev" CRDVersion = "v1alpha1" CRDKind = "Database" OperatorKind = "ServiceBindingRequest" OperatorAPIVersion = "apps.openshift.io/v1alpha1" )
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{"urn:alm:descriptor:servicebindingrequest: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", "urn:alm:descriptor:servicebindingrequest:env:object:configmap:user", "urn:alm:descriptor:servicebindingrequest: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", "urn:alm:descriptor:servicebindingrequest:env:object:secret:user", "urn:alm:descriptor:servicebindingrequest: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", "urn:alm:descriptor:servicebindingrequest:volumemount:secret:user", "urn:alm:descriptor:servicebindingrequest:volumemount:secret:password", }, } )
Functions ¶
func CRDDescriptionConfigMapMock ¶
func CRDDescriptionConfigMapMock() olmv1alpha1.CRDDescription
CRDDescriptionConfigMapMock based on PostgreSQL operator, returns a mock using configmap based spec-descriptor
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 DatabaseCRListMock ¶
func DatabaseCRListMock(ns, name string) *pgv1alpha1.DatabaseList
DatabaseCRListMock returns a list with a single database CR inside, reusing existing mock.
func DatabaseCRMock ¶
func DatabaseCRMock(ns, name string) pgv1alpha1.Database
DatabaseCRMock based on PostgreSQL operator, returning a instantiated object.
func DeploymentListMock ¶
func DeploymentListMock(ns, name string, matchLabels map[string]string) appsv1.DeploymentList
DeploymentListMock returns a list of DeploymentMock.
func DeploymentMock ¶
func DeploymentMock(ns, name string, matchLabels map[string]string) appsv1.Deployment
DeploymentMock creates a mocked Deployment object of busybox.
func SecretMock ¶
SecretMock returns a Secret based on PostgreSQL operator usage.
func ServiceBindingRequestMock ¶
func ServiceBindingRequestMock( ns, name, resourceRef string, matchLabels map[string]string, ) *v1alpha1.ServiceBindingRequest
ServiceBindingRequestMock return a binding-request mock of informed name and match labels.
func UnstructuredClusterServiceVersionMock ¶
func UnstructuredClusterServiceVersionMock(ns, name string) (*ustrv1.Unstructured, error)
UnstructuredClusterServiceVersionMock unstructured object based on ClusterServiceVersionMock.
func UnstructuredClusterServiceVersionVolumeMountMock ¶
func UnstructuredClusterServiceVersionVolumeMountMock( ns string, name string, ) (*ustrv1.Unstructured, error)
UnstructuredClusterServiceVersionVolumeMountMock returns ClusterServiceVersionVolumeMountMock as unstructured object
func UnstructuredDeploymentMock ¶
func UnstructuredDeploymentMock( ns, name string, matchLabels map[string]string, ) (*ustrv1.Unstructured, error)
UnstructuredDeploymentMock converts the DeploymentMock to unstructured.
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 string) *ConfigMapDatabase
DatabaseConfigMapMock ...
type ConfigMapDatabaseSpec ¶
type ConfigMapDatabaseSpec struct {
DBConfigMap string `json:"dbConfigMap"`
}
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) AddMockedCSVList ¶
AddMockedCSVList add mocked object from ClusterServiceVersionListMock.
func (*Fake) AddMockedCSVWithVolumeMountList ¶
AddMockedCSVWithVolumeMountList add mocked object from ClusterServiceVersionListVolumeMountMock.
func (*Fake) AddMockedDatabaseCRList ¶
AddMockedDatabaseCRList add mocked object from DatabaseCRListMock.
func (*Fake) AddMockedSecret ¶
AddMockedSecret add mocked object from SecretMock.
func (*Fake) AddMockedServiceBindingRequest ¶
func (f *Fake) AddMockedServiceBindingRequest(name, ref string, matchLabels map[string]string) *v1alpha1.ServiceBindingRequest
AddMockedServiceBindingRequest add mocked object from ServiceBindingRequestMock.
func (*Fake) AddMockedUnstructuredCSV ¶
AddMockedUnstructuredCSV add mocked unstructured CSV.
func (*Fake) AddMockedUnstructuredCSVWithVolumeMount ¶
AddMockedUnstructuredCSVWithVolumeMount same than AddMockedCSVWithVolumeMountList but using unstructured object.
func (*Fake) AddMockedUnstructuredDeployment ¶
AddMockedUnstructuredDeployment add mocked object from UnstructuredDeploymentMock.
func (*Fake) FakeClient ¶
FakeClient returns fake structured api client.
func (*Fake) FakeDynClient ¶
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 ...