Documentation ¶
Index ¶
- Variables
- func IsTypeObjectProblemInCRDSchemas(err error) bool
- func PatchUpV1beta1CRDs(crd *apiextensionsv1beta1.CustomResourceDefinition)
- func PreserveUnknownFields(crd *apiextensionsv1.CustomResourceDefinition)
- func RemoveTypeObjectFieldsFromCRDSchema(ctx context.Context, crd *apiextensionsv1beta1.CustomResourceDefinition) error
- func SkipReconciliationUntilCacheSynced(ctx context.Context, namespacedName types.NamespacedName)
- func WrapContext(ctx context.Context, ...) context.Context
- type ContextKey
Constants ¶
This section is empty.
Variables ¶
var CacheSyncWaitDuration = 2 * time.Second
CacheSyncWaitDuration is the how long the reconciler will skip reconciliation of a resource whose status was just updated to allow the event that was generated by the update to be received by the operator and update the cache.
Functions ¶
func IsTypeObjectProblemInCRDSchemas ¶
IsTypeObjectProblemInCRDSchemas returns true if the error provided is the error usually returned by the API server when it doesn't like "type:object" fields in the CRD's OpenAPI Schema.
func PatchUpV1beta1CRDs ¶
func PatchUpV1beta1CRDs(crd *apiextensionsv1beta1.CustomResourceDefinition)
PatchUpV1beta1CRDs ensures required fields/settings are present, so v1 conversion results in a valid CRD
func PreserveUnknownFields ¶
func PreserveUnknownFields(crd *apiextensionsv1.CustomResourceDefinition)
PreserveUnknownFields sets PreserveUnknownFields to false and adds x-kubernetes-preserve-unknown-fields to any object type definitions that have no properties or additionalProperties. We do not check PreserveUnknownFields as older CRDs may not have it set. We need to make sure all fields without a schema are marked with x-kubernetes-preserve-unknown-fields.
func RemoveTypeObjectFieldsFromCRDSchema ¶
func RemoveTypeObjectFieldsFromCRDSchema(ctx context.Context, crd *apiextensionsv1beta1.CustomResourceDefinition) error
RemoveTypeObjectFieldsFromCRDSchema works around the problem where OpenShift 3.11 doesn't like "type: object" in CRD OpenAPI schemas. This function removes all occurrences from the schema.
func SkipReconciliationUntilCacheSynced ¶
func SkipReconciliationUntilCacheSynced(ctx context.Context, namespacedName types.NamespacedName)
SkipReconciliationUntilCacheSynced prevents the object from being reconciled in the next 2 seconds. Call this function after you post an update to a resource if you want to reduce the likelihood of the reconcile() function being called again before the update comes back into the operator (until it does, any invocation of reconcile() will skip reconciliation and enqueue the object for reconciliation after the initial 2 second delay expires). This allows the watch event more time to come back and update the cache. While this 2s delay doesn't ensure that the cache is actually synced, it should improve 90% of cases. For the complete explanation, see https://issues.jboss.org/projects/MAISTRA/issues/MAISTRA-830 and https://issues.redhat.com/browse/MAISTRA-2047
func WrapContext ¶
Types ¶
type ContextKey ¶
type ContextKey string