Documentation ¶
Index ¶
- Constants
- func AddToSDKScheme(addToScheme addToSchemeFunc)
- func GetNameAndNamespace(object runtime.Object) (string, string, error)
- func GetOperatorName() (string, error)
- func GetWatchNamespace() (string, error)
- func InitOperatorService() (*v1.Service, error)
- func ObjectInfo(kind, name, namespace string) string
- func RuntimeObjectFromUnstructured(u *unstructured.Unstructured) (runtime.Object, error)
- func RuntimeObjectIntoRuntimeObject(from runtime.Object, into runtime.Object) error
- func SetDecoderFunc(u UtilDecoderFunc)
- func UnstructuredFromRuntimeObject(ro runtime.Object) (*unstructured.Unstructured, error)
- func UnstructuredIntoRuntimeObject(u *unstructured.Unstructured, into runtime.Object) error
- type UtilDecoderFunc
Constants ¶
const ( // KubeConfigEnvVar defines the env variable KUBERNETES_CONFIG which // contains the kubeconfig file path. KubeConfigEnvVar = "KUBERNETES_CONFIG" // WatchNamespaceEnvVar is the constant for env variable WATCH_NAMESPACE // which is the namespace that the pod is currently running in. WatchNamespaceEnvVar = "WATCH_NAMESPACE" // OperatorNameEnvVar is the constant for env variable OPERATOR_NAME // wich is the name of the current operator OperatorNameEnvVar = "OPERATOR_NAME" // PrometheusMetricsPort defines the port which expose prometheus metrics PrometheusMetricsPort = 60000 // PrometheusMetricsPortName define the port name used in kubernetes deployment and service PrometheusMetricsPortName = "metrics" )
Variables ¶
This section is empty.
Functions ¶
func AddToSDKScheme ¶
func AddToSDKScheme(addToScheme addToSchemeFunc)
AddToSDKScheme allows CRDs to register their types with the sdk scheme
func GetNameAndNamespace ¶ added in v0.0.2
GetNameAndNamespace extracts the name and namespace from the given runtime.Object and returns a error if any of those is missing.
func GetOperatorName ¶ added in v0.0.6
GetOperatorName return the operator name
func GetWatchNamespace ¶ added in v0.0.6
GetWatchNamespace returns the namespace the operator should be watching for changes
func InitOperatorService ¶ added in v0.0.6
InitOperatorService return the static service which expose operator metrics
func ObjectInfo ¶ added in v0.0.2
func RuntimeObjectFromUnstructured ¶
func RuntimeObjectFromUnstructured(u *unstructured.Unstructured) (runtime.Object, error)
RuntimeObjectFromUnstructured converts an unstructured to a runtime object
func RuntimeObjectIntoRuntimeObject ¶ added in v0.0.2
RuntimeObjectIntoRuntimeObject unmarshalls an runtime.Object into a given runtime object
func SetDecoderFunc ¶ added in v0.0.6
func SetDecoderFunc(u UtilDecoderFunc)
SetDecoderFunc sets a non default decoder function This is used as a work around to add support for unstructured objects
func UnstructuredFromRuntimeObject ¶
func UnstructuredFromRuntimeObject(ro runtime.Object) (*unstructured.Unstructured, error)
UnstructuredFromRuntimeObject converts a runtime object to an unstructured
func UnstructuredIntoRuntimeObject ¶ added in v0.0.2
func UnstructuredIntoRuntimeObject(u *unstructured.Unstructured, into runtime.Object) error
UnstructuredIntoRuntimeObject unmarshalls an unstructured into a given runtime object TODO: https://github.com/operator-framework/operator-sdk/issues/127
Types ¶
type UtilDecoderFunc ¶ added in v0.0.6
type UtilDecoderFunc func(schema.GroupVersion, serializer.CodecFactory) runtime.Decoder
UtilDecoderFunc retrieve the correct decoder from a GroupVersion and the schemes codec factory.