Documentation
¶
Index ¶
- func CreateOperatorService(client *kclient.Client, group, version, resource string, ...) error
- func CreateService(client *occlient.Client, serviceName string, serviceType string, ...) error
- func DeleteOperatorService(client *kclient.Client, serviceName string) error
- func DeleteServiceAndUnlinkComponents(client *occlient.Client, serviceName string, applicationName string) error
- func GetAlmExample(csv olm.ClusterServiceVersion, cr, serviceType string) (almExample map[string]interface{}, err error)
- func GetCRInstances(client *kclient.Client, customResource *olm.CRDDescription) (*unstructured.UnstructuredList, error)
- func GetCSV(client *kclient.Client, crd map[string]interface{}) (string, olm.ClusterServiceVersion, error)
- func GetGVKFromCR(cr *olm.CRDDescription) (group, version, kind string, err error)
- func GetGVKRFromCR(cr olm.CRDDescription) (group, version, kind, resource string, err error)
- func GetGVRFromCR(cr *olm.CRDDescription) (group, version, resource string, err error)
- func GetGVRFromOperator(csv olm.ClusterServiceVersion, cr string) (group, version, resource string, err error)
- func GetInstancesOfCustomResources(client *kclient.Client, customResources *[]olm.CRDDescription) ([]unstructured.Unstructured, error)
- func GetServiceClassAndPlans(client *occlient.Client, serviceName string) (ServiceClass, []ServicePlan, error)
- func IsOperatorServiceNameValid(name string) (string, string, error)
- func ListOperatorServices(client *kclient.Client) ([]unstructured.Unstructured, error)
- func OperatorSvcExists(client *kclient.Client, serviceName string) (bool, error)
- func SplitServiceKindName(serviceName string) (string, string, error)
- func SvcExists(client *occlient.Client, serviceName, applicationName string) (bool, error)
- type InstanceCreateParameterSchema
- type Service
- type ServiceClass
- type ServiceList
- type ServicePlan
- type ServicePlanParameter
- type ServiceSpec
- type ServiceStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOperatorService ¶ added in v1.1.3
func CreateOperatorService(client *kclient.Client, group, version, resource string, CustomResourceDefinition map[string]interface{}) error
CreateOperatorService creates new service (actually a Deployment) from OperatorHub
func CreateService ¶
func CreateService(client *occlient.Client, serviceName string, serviceType string, servicePlan string, parameters map[string]string, applicationName string) error
CreateService creates new service from serviceCatalog
func DeleteOperatorService ¶ added in v1.2.4
DeleteOperatorService deletes an Operator backed service TODO: make it unlink the service from component as a part of https://github.com/openshift/odo/issues/3563
func DeleteServiceAndUnlinkComponents ¶ added in v0.0.18
func DeleteServiceAndUnlinkComponents(client *occlient.Client, serviceName string, applicationName string) error
DeleteServiceAndUnlinkComponents will delete the service with the provided `name` it also removes links to that service in components of the application
func GetAlmExample ¶ added in v1.2.5
func GetAlmExample(csv olm.ClusterServiceVersion, cr, serviceType string) (almExample map[string]interface{}, err error)
GetAlmExample fetches the ALM example from an Operator's definition. This example contains the example yaml to be used to spin up a service for a given CR in an Operator
func GetCRInstances ¶ added in v1.2.4
func GetCRInstances(client *kclient.Client, customResource *olm.CRDDescription) (*unstructured.UnstructuredList, error)
func GetCSV ¶ added in v1.2.5
func GetCSV(client *kclient.Client, crd map[string]interface{}) (string, olm.ClusterServiceVersion, error)
GetCSV checks if the CR provided by the user in the YAML file exists in the namesapce It returns a CR (string representation) and CSV (Operator) upon successfully able to find them, an error otherwise.
func GetGVKFromCR ¶ added in v1.2.5
func GetGVKFromCR(cr *olm.CRDDescription) (group, version, kind string, err error)
func GetGVKRFromCR ¶ added in v1.2.5
func GetGVKRFromCR(cr olm.CRDDescription) (group, version, kind, resource string, err error)
GetGVKRFromCR returns values for group, version, kind and resource for a given Custom Resource (CR)
func GetGVRFromCR ¶ added in v1.2.5
func GetGVRFromCR(cr *olm.CRDDescription) (group, version, resource string, err error)
GetGVRFromCR parses and returns the values for group, version and resource for a given Custom Resource (CR).
func GetGVRFromOperator ¶ added in v1.2.5
func GetGVRFromOperator(csv olm.ClusterServiceVersion, cr string) (group, version, resource string, err error)
func GetInstancesOfCustomResources ¶ added in v1.2.4
func GetInstancesOfCustomResources(client *kclient.Client, customResources *[]olm.CRDDescription) ([]unstructured.Unstructured, error)
GetInstancesOfCustomResources returns active instances of given Custom Resource (service in odo lingo) in the active namespace of the cluster
func GetServiceClassAndPlans ¶ added in v0.0.15
func GetServiceClassAndPlans(client *occlient.Client, serviceName string) (ServiceClass, []ServicePlan, error)
GetServiceClassAndPlans returns the service class details with the associated plans serviceName is the name of the service class the first parameter returned is the ServiceClass object the second parameter returned is the array of ServicePlan associated with the service class
func IsOperatorServiceNameValid ¶ added in v1.2.5
IsValidOperatorServiceName checks if the provided name follows <service-type>/<service-name> format. For example: "EtcdCluster/example" is a valid servicename but "EtcdCluster/", "EtcdCluster", "example" aren't.
func ListOperatorServices ¶ added in v1.2.1
func ListOperatorServices(client *kclient.Client) ([]unstructured.Unstructured, error)
ListOperatorServices lists all operator backed services
func OperatorSvcExists ¶ added in v1.2.4
OperatorSvcExists checks whether an Operator backed service with given name exists or not. It takes 'serviceName' of the format '<service-kind>/<service-name>'. For example: EtcdCluster/example. It doesn't bother about application since https://github.com/openshift/odo/issues/2801 is blocked
func SplitServiceKindName ¶ added in v1.2.5
SplitServiceKindName splits the service name provided for deletion by the user. It has to be of the format <service-kind>/<service-name>. Example: EtcdCluster/myetcd
func SvcExists ¶
SvcExists Checks whether a service with the given name exists in the current application or not serviceName is the service name to perform check for The first returned parameter is a bool indicating if a service with the given name already exists or not The second returned parameter is the error that might occurs while execution
Types ¶
type InstanceCreateParameterSchema ¶ added in v1.1.1
type InstanceCreateParameterSchema struct { Required []string Properties map[string]ServicePlanParameter }
type Service ¶ added in v1.0.0
type Service struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec ServiceSpec `json:"spec,omitempty"` Status ServiceStatus `json:"status,omitempty"` }
ServiceInfo holds all important information about one service
type ServiceClass ¶ added in v0.0.15
type ServiceClass struct { Name string Bindable bool ShortDescription string LongDescription string Tags []string VersionsAvailable []string ServiceBrokerName string }
ServiceClass holds the information regarding a service catalog service class
type ServiceList ¶ added in v1.0.0
type ServiceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Service `json:"items"` }
func List ¶
func List(client *occlient.Client, applicationName string) (ServiceList, error)
List lists all the deployed services
func ListWithDetailedStatus ¶ added in v0.0.15
func ListWithDetailedStatus(client *occlient.Client, applicationName string) (ServiceList, error)
ListWithDetailedStatus lists all the deployed services and additionally provides a "smart" status for each one of them The smart status takes into account how Services are used in odo. So when a secret has been created as a result of the created ServiceBinding, we set the appropriate status Same for when the secret has been "linked" into the deploymentconfig
type ServicePlan ¶ added in v0.0.18
type ServicePlan struct { Name string DisplayName string Description string Parameters servicePlanParameters }
ServicePlan holds the information about service catalog plans associated to service classes
func NewServicePlan ¶ added in v0.0.18
func NewServicePlan(result scv1beta1.ClusterServicePlan) (plan ServicePlan, err error)
NewServicePlan creates a new ServicePlan based on the specified ClusterServicePlan
type ServicePlanParameter ¶ added in v0.0.15
type ServicePlanParameter struct { Name string `json:"name"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Default string `json:"default,omitempty"` validation.Validatable `json:",inline,omitempty"` }
ServicePlanParameter holds the information regarding a service catalog plan parameter
func NewServicePlanParameter ¶ added in v0.0.19
func NewServicePlanParameter(name, typeName, defaultValue string, required bool) ServicePlanParameter
NewServicePlanParameter creates a new ServicePlanParameter instance with the specified state
func (*ServicePlanParameter) UnmarshalJSON ¶ added in v1.1.0
func (sp *ServicePlanParameter) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the JSON for ServicePlanParameter instead of using the built in json.Unmarshal
type ServiceSpec ¶ added in v1.0.0
ServiceSpec ...
type ServiceStatus ¶ added in v1.0.0
type ServiceStatus struct {
Status string `json:"status,omitempty"`
}
ServiceStatus ...