Documentation ¶
Index ¶
- Variables
- func AddFinalizer(obj metav1.Object, finalizer string) bool
- func AddToRootCAs(localCertFile string) error
- func CheckForIdenticalSecretsCreds(secret *corev1.Secret, storeTypeStr string) *corev1.Secret
- func CombineErrors(errs ...error) error
- func ComposePredicates(predicates ...predicate.Predicate) predicate.Predicate
- func Contains(s string, arr []string) bool
- func Context() context.Context
- func CurrentNamespace() string
- func DeleteStorageClass(sc *storagev1.StorageClass) error
- func EnsureCommonMetaFields(object metav1.Object, finalizer string) bool
- func GetAWSRegion() (string, error)
- func GetAvailabeKubeCli() string
- func GetBackingStoreSecret(bs *nbv1.BackingStore) (*corev1.SecretReference, error)
- func GetBackingStoreSecretByType(bs *nbv1.BackingStore) (*corev1.SecretReference, error)
- func GetBackingStoreTargetBucket(bs *nbv1.BackingStore) (string, error)
- func GetCmDataHash(input map[string]string) string
- func GetContainerStatusLine(cont *corev1.ContainerStatus) string
- func GetEnvVariable(env *[]corev1.EnvVar, name string) *corev1.EnvVar
- func GetFlagIntOrPrompt(cmd *cobra.Command, flag string) int
- func GetFlagStringOrPrompt(cmd *cobra.Command, flag string) string
- func GetFlagStringOrPromptPassword(cmd *cobra.Command, flag string) string
- func GetIBMRegion() (string, error)
- func GetNamespaceStoreSecret(ns *nbv1.NamespaceStore) (*corev1.SecretReference, error)
- func GetNamespaceStoreSecretByType(ns *nbv1.NamespaceStore) (*corev1.SecretReference, error)
- func GetNamespaceStoreTargetBucket(ns *nbv1.NamespaceStore) (string, error)
- func GetPodLogs(pod corev1.Pod) (map[string]io.ReadCloser, error)
- func GetPodStatusLine(pod *corev1.Pod) string
- func GetSecretFromSecretReference(secretRef *corev1.SecretReference) (*corev1.Secret, error)
- func GetWatchNamespace() (string, error)
- func HumanizeDuration(duration time.Duration) string
- func IgnoreError(err error)
- func InitLogger()
- func IsAWSPlatform() bool
- func IsAzurePlatformNonGovernment() bool
- func IsGCPPlatform() bool
- func IsIBMPlatform() bool
- func IsOwnedByNoobaa(ownerReferences []metav1.OwnerReference) bool
- func IsPersistentError(err error) bool
- func IsSTSClusterBS(bs *nbv1.BackingStore) bool
- func IsSTSClusterNB(nb *nbv1.NooBaa) bool
- func IsStringArrayUnorderedEqual(stringsArrayA, stringsArrayB []string) bool
- func IsStringGraphicOrSpacesCharsOnly(s string) bool
- func IsValidS3BucketName(name string) bool
- func IsValidationError(err error) bool
- func KubeApply(obj client.Object) bool
- func KubeCheck(obj client.Object) bool
- func KubeCheckOptional(obj client.Object) bool
- func KubeCheckQuiet(obj client.Object) bool
- func KubeClient() client.Client
- func KubeConfig() *rest.Config
- func KubeCreateFailExisting(obj client.Object) bool
- func KubeCreateOptional(obj client.Object) bool
- func KubeCreateSkipExisting(obj client.Object) bool
- func KubeDelete(obj client.Object, opts ...client.DeleteOption) bool
- func KubeDeleteAllOf(obj client.Object, opts ...client.DeleteAllOfOption) bool
- func KubeDeleteNoPolling(obj client.Object, opts ...client.DeleteOption) bool
- func KubeGet(obj client.Object) (name string, kind string, err error)
- func KubeList(list client.ObjectList, options ...client.ListOption) bool
- func KubeObject(text string) runtime.Object
- func KubeUpdate(obj client.Object) bool
- func LoadBucketReplicationJSON(replicationJSONFilePath string) (string, error)
- func LogError(err error)
- func Logger() *logrus.Entry
- func MapperProvider(config *rest.Config) (meta.RESTMapper, error)
- func MergeEnvArrays(envA, envB *[]corev1.EnvVar)
- func MergeVolumeList(existing, template *[]corev1.Volume)
- func MergeVolumeMountList(existing, template *[]corev1.VolumeMount)
- func NewFastRESTMapper(dc discovery.DiscoveryInterface, filter APIGroupFilterFunc) meta.RESTMapper
- func NoGroupFilter(*metav1.APIGroup) bool
- func NooBaaCondStatus(noobaa *nbv1.NooBaa, s corev1.ConditionStatus) bool
- func NooBaaCondition(noobaa *nbv1.NooBaa, t conditionsv1.ConditionType, s corev1.ConditionStatus) bool
- func NoobaaStatus(nb *nbv1.NooBaa, t conditionsv1.ConditionType, status corev1.ConditionStatus) bool
- func ObjectKey(obj client.Object) client.ObjectKey
- func Panic(err error)
- func PrintThisNoteWhenFinishedApplyingAndStartWaitLoop()
- func RandomBase64(numBytes int) string
- func RandomHex(numBytes int) string
- func ReflectEnvVariable(env *[]corev1.EnvVar, name string)
- func RemoveFinalizer(obj metav1.Object, finalizer string) bool
- func SaveCRsToFile(crs runtime.Object, path string) error
- func SaveStreamToFile(body io.ReadCloser, path string) error
- func SecretResetStringDataFromData(obj runtime.Object)
- func SetAvailableCondition(conditions *[]conditionsv1.Condition, reason string, message string)
- func SetBackingStoreSecretRef(bs *nbv1.BackingStore, ref *corev1.SecretReference) error
- func SetErrorCondition(conditions *[]conditionsv1.Condition, reason string, message string)
- func SetNamespaceStoreSecretRef(ns *nbv1.NamespaceStore, ref *corev1.SecretReference) error
- func SetOwnerReference(owner, dependent metav1.Object, scheme *runtime.Scheme) error
- func SetProgressingCondition(conditions *[]conditionsv1.Condition, reason string, message string)
- func Tar(src string, writers ...io.Writer) error
- func ValidateQuotaConfig(name string, maxSize string, maxObjects string) error
- func VerifyCredsInSecret(secretName string, namespace string, mandatoryProperties []string)
- func WriteYamlFile(name string, obj runtime.Object, moreObjects ...runtime.Object) error
- type APIGroupFilterFunc
- type FastRESTMapper
- func (m *FastRESTMapper) Discover() error
- func (m *FastRESTMapper) DiscoverGroup(gr *restmapper.APIGroupResources) error
- func (m *FastRESTMapper) DiscoverOnError(err error) bool
- func (m *FastRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
- func (m *FastRESTMapper) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error)
- func (m *FastRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)
- func (m *FastRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error)
- func (m *FastRESTMapper) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error)
- func (m *FastRESTMapper) ResourceSingularizer(resource string) (string, error)
- func (m *FastRESTMapper) ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error)
- type FilterForOwner
- type FinalizersChangedPredicate
- type LabelsChangedPredicate
- type LogEventsPredicate
- type OAuth2Endpoints
- type PersistentError
- type PrintColumn
- type PrintTable
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
var ( // InsecureHTTPTransport is a global insecure http transport InsecureHTTPTransport = &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } // SecureHTTPTransport is a global secure http transport SecureHTTPTransport = &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: false}, } // MapStorTypeToMandatoryProperties holds a map of store type -> credentials mandatory properties // note that this map holds the mandatory properties for both backingstores and namespacestores MapStorTypeToMandatoryProperties = map[string][]string{ "aws-s3": {"AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"}, "s3-compatible": {"AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"}, "ibm-cos": {"IBM_COS_ACCESS_KEY_ID", "IBM_COS_SECRET_ACCESS_KEY"}, "google-cloud-storage": {"GoogleServiceAccountPrivateKeyJson"}, "azure-blob": {"AccountName", "AccountKey"}, "pv-pool": {}, "nsfs": {}, } )
Functions ¶
func AddFinalizer ¶
AddFinalizer adds the finalizer to the object if it doesn't contains it already
func AddToRootCAs ¶
AddToRootCAs adds a local cert file to Our SecureHttpTransport
func CheckForIdenticalSecretsCreds ¶ added in v5.11.0
CheckForIdenticalSecretsCreds search and returns a secret name with identical credentials in the provided secret the credentials to compare stored in mandatoryProp
func CombineErrors ¶
CombineErrors takes a list of errors and combines them to one. Generally it will return the first non-nil error, but if a persistent error is found it will be returned instead of non-persistent errors.
func ComposePredicates ¶
ComposePredicates will compose a variable number of predicte and return a predicate that will allow events that are allowed by any of the given predicates.
func CurrentNamespace ¶
func CurrentNamespace() string
CurrentNamespace reads the current namespace from the kube config
func DeleteStorageClass ¶
func DeleteStorageClass(sc *storagev1.StorageClass) error
DeleteStorageClass deletes storage class
func EnsureCommonMetaFields ¶
EnsureCommonMetaFields ensures that the resource has all mandatory meta fields
func GetAWSRegion ¶
GetAWSRegion parses the region from a node's name
func GetAvailabeKubeCli ¶ added in v5.10.1
func GetAvailabeKubeCli() string
GetAvailabeKubeCli will check which k8s cli command is availabe in the system: oc or kubectl returns one of: "oc" or "kubectl"
func GetBackingStoreSecret ¶ added in v5.11.0
func GetBackingStoreSecret(bs *nbv1.BackingStore) (*corev1.SecretReference, error)
GetBackingStoreSecret returns the secret and adding the namespace if it is missing
func GetBackingStoreSecretByType ¶ added in v5.11.0
func GetBackingStoreSecretByType(bs *nbv1.BackingStore) (*corev1.SecretReference, error)
GetBackingStoreSecretByType returns the secret reference of the backing store if it is relevant to the type
func GetBackingStoreTargetBucket ¶ added in v5.11.0
func GetBackingStoreTargetBucket(bs *nbv1.BackingStore) (string, error)
GetBackingStoreTargetBucket returns the target bucket of the backing store if it is relevant to the type
func GetCmDataHash ¶
GetCmDataHash calculates a Hash string representing an array of key value strings
func GetContainerStatusLine ¶
func GetContainerStatusLine(cont *corev1.ContainerStatus) string
GetContainerStatusLine returns a one liner status for a container
func GetEnvVariable ¶
GetEnvVariable is looking for env variable called name in env and return a pointer to the variable
func GetFlagIntOrPrompt ¶ added in v5.10.1
GetFlagIntOrPrompt returns flag value but if empty will prompt to read from stdin
func GetFlagStringOrPrompt ¶
GetFlagStringOrPrompt returns flag value but if empty will prompt to read from stdin
func GetFlagStringOrPromptPassword ¶
GetFlagStringOrPromptPassword is like GetFlagStringOrPrompt but does not show the input characters on the terminal to avoid leaking secret data in shell history
func GetIBMRegion ¶
GetIBMRegion returns the cluster's region in IBM Cloud
func GetNamespaceStoreSecret ¶ added in v5.11.0
func GetNamespaceStoreSecret(ns *nbv1.NamespaceStore) (*corev1.SecretReference, error)
GetNamespaceStoreSecret returns the secret and adding the namespace if it is missing
func GetNamespaceStoreSecretByType ¶ added in v5.11.0
func GetNamespaceStoreSecretByType(ns *nbv1.NamespaceStore) (*corev1.SecretReference, error)
GetNamespaceStoreSecretByType returns the secret reference of the namespace store if it is relevant to the type
func GetNamespaceStoreTargetBucket ¶ added in v5.11.0
func GetNamespaceStoreTargetBucket(ns *nbv1.NamespaceStore) (string, error)
GetNamespaceStoreTargetBucket returns the target bucket of the namespace store if it is relevant to the type
func GetPodStatusLine ¶
GetPodStatusLine returns a one liner status for a pod
func GetSecretFromSecretReference ¶ added in v5.11.0
func GetSecretFromSecretReference(secretRef *corev1.SecretReference) (*corev1.Secret, error)
GetSecretFromSecretReference search and retruns a secret obj from a provided secret reference
func GetWatchNamespace ¶
GetWatchNamespace returns the namespace the operator should be watching for changes this was implemented in operator-sdk v0.17 and removed. copied from here: https://github.com/operator-framework/operator-sdk/blob/53b00d125fb12515cd74fb169149913b401c8995/pkg/k8sutil/k8sutil.go#L45
func HumanizeDuration ¶
HumanizeDuration humanizes time.Duration output to a meaningful value - will show days/years
func IsAWSPlatform ¶
func IsAWSPlatform() bool
IsAWSPlatform returns true if this cluster is running on AWS
func IsAzurePlatformNonGovernment ¶ added in v5.10.1
func IsAzurePlatformNonGovernment() bool
IsAzurePlatformNonGovernment returns true if this cluster is running on Azure and also not on azure government\DOD cloud
func IsGCPPlatform ¶
func IsGCPPlatform() bool
IsGCPPlatform returns true if this cluster is running on GCP
func IsIBMPlatform ¶
func IsIBMPlatform() bool
IsIBMPlatform returns true if this cluster is running on IBM Cloud
func IsOwnedByNoobaa ¶ added in v5.11.0
func IsOwnedByNoobaa(ownerReferences []metav1.OwnerReference) bool
IsOwnedByNoobaa receives an array of owner references and returns true if one of them is of a noobaa resource
func IsPersistentError ¶
IsPersistentError checks if the provided error is persistent.
func IsSTSClusterBS ¶ added in v5.10.1
func IsSTSClusterBS(bs *nbv1.BackingStore) bool
IsSTSClusterBS returns true if it is running on an STS cluster
func IsSTSClusterNB ¶ added in v5.10.1
IsSTSClusterNB returns true if it is running on an STS cluster
func IsStringArrayUnorderedEqual ¶ added in v5.10.1
IsStringArrayUnorderedEqual checks if two string arrays has the same members
func IsStringGraphicOrSpacesCharsOnly ¶
IsStringGraphicOrSpacesCharsOnly returns true only if all the chars are graphic or spaces
func IsValidS3BucketName ¶
IsValidS3BucketName checks the name according to https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-s3-bucket-naming-requirements.html
func IsValidationError ¶ added in v5.10.1
IsValidationError check if err is of type ValidationError
func KubeApply ¶
KubeApply will check if the object exists and will create/update accordingly and report the object status.
func KubeCheckOptional ¶
KubeCheckOptional checks if the object exists and reports the object status. It detects the situation of a missing CRD and reports it as an optional feature.
func KubeCheckQuiet ¶
KubeCheckQuiet checks if the object exists fills the given object if found. returns true if the object was found. It does not print any status
func KubeClient ¶
KubeClient resturns a controller-runtime client We use a lazy mapper and a specialized implementation of fast mapper in order to avoid lags when running a CLI client to a far away cluster.
func KubeConfig ¶
KubeConfig loads kubernetes client config from default locations (flags, user dir, etc)
func KubeCreateFailExisting ¶
KubeCreateFailExisting will check if the object exists and will create/skip accordingly and report the object status.
func KubeCreateOptional ¶
KubeCreateOptional will check if the object exists and will create/skip accordingly It detects the situation of a missing CRD and reports it as an optional feature.
func KubeCreateSkipExisting ¶
KubeCreateSkipExisting will try to create an object returns true of the object exist or was created returns false otherwise
func KubeDelete ¶
func KubeDelete(obj client.Object, opts ...client.DeleteOption) bool
KubeDelete deletes an object and reports the object status.
func KubeDeleteAllOf ¶
func KubeDeleteAllOf(obj client.Object, opts ...client.DeleteAllOfOption) bool
KubeDeleteAllOf deletes an list of objects and reports the status.
func KubeDeleteNoPolling ¶
func KubeDeleteNoPolling(obj client.Object, opts ...client.DeleteOption) bool
KubeDeleteNoPolling deletes an object without waiting for acknowledgement the object got deleted
func KubeGet ¶
KubeGet gets a client.Object, fills the given object and returns the name and kind returns error on failure
func KubeList ¶
func KubeList(list client.ObjectList, options ...client.ListOption) bool
KubeList returns a list of objects.
func KubeObject ¶
KubeObject loads a text yaml/json to a kubernetes object.
func KubeUpdate ¶
KubeUpdate updates an object and reports the object status.
func LoadBucketReplicationJSON ¶
LoadBucketReplicationJSON loads the bucket replication from a json file
func MapperProvider ¶
func MapperProvider(config *rest.Config) (meta.RESTMapper, error)
MapperProvider creates RESTMapper
func MergeEnvArrays ¶
MergeEnvArrays takes two Env variables arrays and merge them into the first
func MergeVolumeList ¶
MergeVolumeList takes two Volume arrays and merge them into the first
func MergeVolumeMountList ¶
func MergeVolumeMountList(existing, template *[]corev1.VolumeMount)
MergeVolumeMountList takes two VolumeMount arrays and merge them into the first
func NewFastRESTMapper ¶
func NewFastRESTMapper(dc discovery.DiscoveryInterface, filter APIGroupFilterFunc) meta.RESTMapper
NewFastRESTMapper initializes a FastRESTMapper
func NoGroupFilter ¶
NoGroupFilter is a filtering function that includes all the server groups
func NooBaaCondStatus ¶ added in v5.10.1
func NooBaaCondStatus(noobaa *nbv1.NooBaa, s corev1.ConditionStatus) bool
NooBaaCondStatus waits for requested NooBaa CR KMS condition status returns false if timeout
func NooBaaCondition ¶ added in v5.10.1
func NooBaaCondition(noobaa *nbv1.NooBaa, t conditionsv1.ConditionType, s corev1.ConditionStatus) bool
NooBaaCondition waits for requested NooBaa CR KMS condition type & status returns false if timeout
func NoobaaStatus ¶ added in v5.10.1
func NoobaaStatus(nb *nbv1.NooBaa, t conditionsv1.ConditionType, status corev1.ConditionStatus) bool
NoobaaStatus returns true if NooBaa condition type and status matches returns false otherwise
func PrintThisNoteWhenFinishedApplyingAndStartWaitLoop ¶
func PrintThisNoteWhenFinishedApplyingAndStartWaitLoop()
PrintThisNoteWhenFinishedApplyingAndStartWaitLoop is a common log task
func RandomBase64 ¶
RandomBase64 creates a random buffer with numBytes and returns it encoded in base64 Returned string length is 4*math.Ceil(numBytes/3)
func RandomHex ¶
RandomHex creates a random buffer with numBytes and returns it encoded in hex Returned string length is 2*numBytes
func ReflectEnvVariable ¶
ReflectEnvVariable will add, update or remove an env variable base on the existence and value of an env variable with the same name on the container running this function.
func RemoveFinalizer ¶
RemoveFinalizer modifies the object and removes the finalizer
func SaveStreamToFile ¶
func SaveStreamToFile(body io.ReadCloser, path string) error
SaveStreamToFile info
func SecretResetStringDataFromData ¶
SecretResetStringDataFromData reads the secret data into string data to streamline the paths that use the secret values as strings.
func SetAvailableCondition ¶
func SetAvailableCondition(conditions *[]conditionsv1.Condition, reason string, message string)
SetAvailableCondition updates the status conditions to available state
func SetBackingStoreSecretRef ¶ added in v5.11.0
func SetBackingStoreSecretRef(bs *nbv1.BackingStore, ref *corev1.SecretReference) error
SetBackingStoreSecretRef setting a backingstore secret reference to the provided one
func SetErrorCondition ¶
func SetErrorCondition(conditions *[]conditionsv1.Condition, reason string, message string)
SetErrorCondition updates the status conditions to error state
func SetNamespaceStoreSecretRef ¶ added in v5.11.0
func SetNamespaceStoreSecretRef(ns *nbv1.NamespaceStore, ref *corev1.SecretReference) error
SetNamespaceStoreSecretRef setting a namespacestore secret reference to the provided one
func SetOwnerReference ¶ added in v5.11.0
SetOwnerReference setting a owner reference of owner to dependent metadata with the field of blockOwnerDeletion: true controllerutil.SetOwnerReference is doing the same thing but without blockOwnerDeletion: true If a reference to the same object already exists, it'll return an AlreadyOwnedError. see: https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/controller/controllerutil/controllerutil.go#L93
func SetProgressingCondition ¶
func SetProgressingCondition(conditions *[]conditionsv1.Condition, reason string, message string)
SetProgressingCondition updates the status conditions to in-progress state
func Tar ¶
Tar takes a source and variable writers and walks 'source' writing each file found to the tar writer; the purpose for accepting multiple writers is to allow for multiple outputs (for example a file, or md5 hash)
func ValidateQuotaConfig ¶ added in v5.10.1
ValidateQuotaConfig maxSize and maxObjects value of obc or bucketclass
func VerifyCredsInSecret ¶
VerifyCredsInSecret throws fatal error when a given secret doesn't contain the mandatory properties
Types ¶
type APIGroupFilterFunc ¶
APIGroupFilterFunc is a filtering function to limit the amount of server groups we load
type FastRESTMapper ¶
type FastRESTMapper struct { Discovery discovery.DiscoveryInterface Filter APIGroupFilterFunc Mapper meta.RESTMapper }
FastRESTMapper loads the mapper data from the server with filter and concurrency and rediscovers the mapping on meta.NoKindMatchError errors See https://github.com/kubernetes-sigs/controller-runtime/issues/537
func (*FastRESTMapper) Discover ¶
func (m *FastRESTMapper) Discover() error
Discover reads server groups and then reads each group to initialize the mapper groups.
func (*FastRESTMapper) DiscoverGroup ¶
func (m *FastRESTMapper) DiscoverGroup(gr *restmapper.APIGroupResources) error
DiscoverGroup reads the server group
func (*FastRESTMapper) DiscoverOnError ¶
func (m *FastRESTMapper) DiscoverOnError(err error) bool
DiscoverOnError check if the error is NoMatchError and calls discover
func (*FastRESTMapper) KindFor ¶
func (m *FastRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
KindFor implements Mapper.KindFor
func (*FastRESTMapper) KindsFor ¶
func (m *FastRESTMapper) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error)
KindsFor implements Mapper.KindsFor
func (*FastRESTMapper) RESTMapping ¶
func (m *FastRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)
RESTMapping implements Mapper.RESTMapping
func (*FastRESTMapper) RESTMappings ¶
func (m *FastRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error)
RESTMappings implements Mapper.RESTMappings
func (*FastRESTMapper) ResourceFor ¶
func (m *FastRESTMapper) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error)
ResourceFor implements Mapper.ResourceFor
func (*FastRESTMapper) ResourceSingularizer ¶
func (m *FastRESTMapper) ResourceSingularizer(resource string) (string, error)
ResourceSingularizer implements Mapper.ResourceSingularizer
func (*FastRESTMapper) ResourcesFor ¶
func (m *FastRESTMapper) ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error)
ResourcesFor implements Mapper.ResourcesFor
type FilterForOwner ¶
FilterForOwner will only allow events that owned by noobaa
func (FilterForOwner) Create ¶
func (p FilterForOwner) Create(e event.CreateEvent) bool
Create implements the create event trap for FilterForOwner
func (FilterForOwner) Delete ¶
func (p FilterForOwner) Delete(e event.DeleteEvent) bool
Delete implements the delete event trap for FilterForOwner
func (FilterForOwner) Generic ¶
func (p FilterForOwner) Generic(e event.GenericEvent) bool
Generic implements the generic event trap for FilterForOwner
func (FilterForOwner) Update ¶
func (p FilterForOwner) Update(e event.UpdateEvent) bool
Update implements the update event trap for FilterForOwner
type FinalizersChangedPredicate ¶
FinalizersChangedPredicate will only allow events that changed Metadata.Finalizers
func (FinalizersChangedPredicate) Update ¶
func (p FinalizersChangedPredicate) Update(e event.UpdateEvent) bool
Update implements the update event trap for FinalizersChangedPredicate
type LabelsChangedPredicate ¶
LabelsChangedPredicate will only allow events that changed Metadata.Labels
func (LabelsChangedPredicate) Update ¶
func (p LabelsChangedPredicate) Update(e event.UpdateEvent) bool
Update implements the update event trap for LabelsChangedPredicate
type LogEventsPredicate ¶
type LogEventsPredicate struct { }
LogEventsPredicate will passthrough events while loging a message for each
func (LogEventsPredicate) Create ¶
func (p LogEventsPredicate) Create(e event.CreateEvent) bool
Create implements the create event trap for LogEventsPredicate
func (LogEventsPredicate) Delete ¶
func (p LogEventsPredicate) Delete(e event.DeleteEvent) bool
Delete implements the delete event trap for LogEventsPredicate
func (LogEventsPredicate) Generic ¶
func (p LogEventsPredicate) Generic(e event.GenericEvent) bool
Generic implements the generic event trap for LogEventsPredicate
func (LogEventsPredicate) Update ¶
func (p LogEventsPredicate) Update(e event.UpdateEvent) bool
Update implements the update event trap for LogEventsPredicate
type OAuth2Endpoints ¶
type OAuth2Endpoints struct { AuthorizationEndpoint string `json:"authorization_endpoint"` TokenEndpoint string `json:"token_endpoint"` }
OAuth2Endpoints holds OAuth2 endpoints information.
func DiscoverOAuthEndpoints ¶
func DiscoverOAuthEndpoints() (*OAuth2Endpoints, error)
DiscoverOAuthEndpoints uses a well known url to get info on the cluster oauth2 endpoints
type PersistentError ¶
PersistentError is an error type that tells the reconcile to avoid requeueing.
func NewPersistentError ¶
func NewPersistentError(reason string, message string) *PersistentError
NewPersistentError returns a new persistent error.
func (*PersistentError) Error ¶
func (e *PersistentError) Error() string
Error function makes PersistentError implement error interface
type PrintColumn ¶
PrintColumn is a column in PrintTable
func (*PrintColumn) Pad ¶
func (c *PrintColumn) Pad(s string) string
Pad adds padding the provided string to make it print nicely as a table cell
func (*PrintColumn) RecalcWidth ¶
func (c *PrintColumn) RecalcWidth()
RecalcWidth can be called to recalculate the column width after manual updates are made
type PrintTable ¶
type PrintTable struct { Columns []PrintColumn NumRows int }
PrintTable is a table for printing with fixed column width and padding
func (*PrintTable) AddRow ¶
func (t *PrintTable) AddRow(items ...string) *PrintTable
AddRow adds a row of headers/values to the table
func (*PrintTable) RecalcWidth ¶
func (t *PrintTable) RecalcWidth() *PrintTable
RecalcWidth can be called to recalculate the columns width after manual updates are made
func (*PrintTable) String ¶
func (t *PrintTable) String() string
type ValidationError ¶ added in v5.10.1
type ValidationError struct {
Msg string
}
ValidationError is a custom error if the validation failed
func (ValidationError) Error ¶ added in v5.10.1
func (e ValidationError) Error() string
Error returns the ValidationError message