Documentation ¶
Index ¶
- Constants
- func CloudTypes() map[string]CloudType
- func CreateControllerRef(controller metav1.Object, groupVersionWithKind schema.GroupVersionKind) *metav1.OwnerReference
- func FilteredConditions(conditions []cloudv1alpha1.OperatorCondition, ...) []cloudv1alpha1.OperatorCondition
- func GetAvailabilityDomains(c clientset.Interface, namespace string, compartmentRef string) ([]string, error)
- func GetCondition(status *cloudv1alpha1.OperatorStatus, ...) *cloudv1alpha1.OperatorCondition
- func GetControllerOf(controllee metav1.Object) *metav1.OwnerReference
- func GetImage(c clientset.Interface, osType string, osVersion string, namespace string) (string, error)
- func GetImageSpecific(c clientset.Interface, namespace string, img string) (string, error)
- func GetShape(c clientset.Interface, cpuCores int, ramGbytes int, isVirtual bool, ...) (string, error)
- func GetShapeByResourceRequirements(c clientset.Interface, namespace string, requirements *v1.ResourceRequirements) (string, error)
- func GetShapeSpecific(c clientset.Interface, namespace string, shape string) (string, error)
- func GetSubnetOffset(c clientset.Interface, namespace string, networkName string, key string) (int, error)
- func RegisterCloudType(plural, kind, groupName string, ...)
- func RemoveCondition(status *cloudv1alpha1.OperatorStatus, ...)
- func SetCondition(status *cloudv1alpha1.OperatorStatus, ...)
- type AdapterFactory
- type CloudType
- type CloudTypeAdapter
Constants ¶
const ( ADAnnotationName string = "oci.oracle.com.ad" SubnetAnnotationName string = "oci.oracle.com.subnet" )
Variables ¶
This section is empty.
Functions ¶
func CloudTypes ¶
CloudTypes returns a mapping of kind (e.g. "network") to the type information required to configure its resource.
func CreateControllerRef ¶
func CreateControllerRef(controller metav1.Object, groupVersionWithKind schema.GroupVersionKind) *metav1.OwnerReference
Create OwnerReference
func FilteredConditions ¶
func FilteredConditions(conditions []cloudv1alpha1.OperatorCondition, conditionType cloudv1alpha1.OperatorConditionType) []cloudv1alpha1.OperatorCondition
FilteredConditions returns a new slice of operator conditions without conditions with the provided type.
func GetAvailabilityDomains ¶
func GetAvailabilityDomains(c clientset.Interface, namespace string, compartmentRef string) ([]string, error)
Get list of oci availability domains
func GetCondition ¶
func GetCondition(status *cloudv1alpha1.OperatorStatus, conditionType cloudv1alpha1.OperatorConditionType) *cloudv1alpha1.OperatorCondition
Get condition (status) from object by the type
func GetControllerOf ¶
func GetControllerOf(controllee metav1.Object) *metav1.OwnerReference
Retrieves OwnerReference from the object
func GetImage ¶
func GetImage(c clientset.Interface, osType string, osVersion string, namespace string) (string, error)
Get OCI instance image
func GetImageSpecific ¶
Get specific OCI image
func GetShape ¶
func GetShape(c clientset.Interface, cpuCores int, ramGbytes int, isVirtual bool, namespace string) (string, error)
Get OCI instance shape
func GetShapeByResourceRequirements ¶
func GetShapeByResourceRequirements(c clientset.Interface, namespace string, requirements *v1.ResourceRequirements) (string, error)
Get OCI instance shape
func GetShapeSpecific ¶
Get specific OCI shape
func GetSubnetOffset ¶
func GetSubnetOffset(c clientset.Interface, namespace string, networkName string, key string) (int, error)
get subnet offset - used by compute and loadbalancer (key)
func RegisterCloudType ¶
func RegisterCloudType(plural, kind, groupName string, validation *apiextv1beta1.CustomResourceValidation, factory AdapterFactory)
Register cloud type adpater factory
func RemoveCondition ¶
func RemoveCondition(status *cloudv1alpha1.OperatorStatus, conditionType cloudv1alpha1.OperatorConditionType)
RemoveCondition removes the condition with the provided type from the operator status.
func SetCondition ¶
func SetCondition(status *cloudv1alpha1.OperatorStatus, conditionType cloudv1alpha1.OperatorConditionType, reason string)
Set the condition (status) on the object by the type
Types ¶
type AdapterFactory ¶
type AdapterFactory func(clientset versioned.Interface, kubeclient kubernetes.Interface) CloudTypeAdapter
AdapterFactory defines the function signature for factory methods that create instances of CloudTypeAdapter. Such methods should be registered with RegisterAdapterFactory to ensure the type adapter is discoverable.
type CloudType ¶
type CloudType struct { GroupName string Kind string ResourcePlural string Validation *apiextv1beta1.CustomResourceValidation AdapterFactory AdapterFactory }
CloudType configures kubernetes for a cloud workload type
type CloudTypeAdapter ¶
type CloudTypeAdapter interface { Kind() string Resource() string Equivalent(obj1, obj2 runtime.Object) bool GroupVersionWithResource() schema.GroupVersionResource Subscriptions() []schema.GroupVersionResource CallbackForResource(schema.GroupVersionResource) cache.ResourceEventHandlerFuncs SetLister(lister cache.GenericLister) SetQueue(queue workqueue.RateLimitingInterface) ObjectMeta(obj runtime.Object) *metav1.ObjectMeta Delete(obj runtime.Object) (runtime.Object, error) Update(obj runtime.Object) (runtime.Object, error) Reconcile(obj runtime.Object) (runtime.Object, error) }
ResourceTypeAdapter defines operations for interacting with a cloud workload type. Code written to this interface can then target any type for which an implementation of this interface exists.