105 lines
3.8 KiB
Go
105 lines
3.8 KiB
Go
/*
|
|
Copyright 2019 The Crossplane Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
package v1
|
|
|
|
// A ManagementPolicy determines how should Crossplane controllers manage an
|
|
// external resource.
|
|
// +kubebuilder:validation:Enum=FullControl;ObserveOnly;OrphanOnDelete
|
|
type ManagementPolicy string
|
|
|
|
const (
|
|
// ManagementFullControl means the external resource is fully controlled
|
|
// by Crossplane controllers, including its deletion.
|
|
ManagementFullControl ManagementPolicy = "FullControl"
|
|
|
|
// ManagementObserveOnly means the external resource will only be observed
|
|
// by Crossplane controllers, but not modified or deleted.
|
|
ManagementObserveOnly ManagementPolicy = "ObserveOnly"
|
|
|
|
// ManagementOrphanOnDelete means the external resource will be orphaned
|
|
// when its managed resource is deleted.
|
|
ManagementOrphanOnDelete ManagementPolicy = "OrphanOnDelete"
|
|
)
|
|
|
|
// A DeletionPolicy determines what should happen to the underlying external
|
|
// resource when a managed resource is deleted.
|
|
// +kubebuilder:validation:Enum=Orphan;Delete
|
|
type DeletionPolicy string
|
|
|
|
const (
|
|
// DeletionOrphan means the external resource will be orphaned when its
|
|
// managed resource is deleted.
|
|
DeletionOrphan DeletionPolicy = "Orphan"
|
|
|
|
// DeletionDelete means both the external resource will be deleted when its
|
|
// managed resource is deleted.
|
|
DeletionDelete DeletionPolicy = "Delete"
|
|
)
|
|
|
|
// A CompositeDeletePolicy determines how the composite resource should be deleted
|
|
// when the corresponding claim is deleted.
|
|
// +kubebuilder:validation:Enum=Background;Foreground
|
|
type CompositeDeletePolicy string
|
|
|
|
const (
|
|
// CompositeDeleteBackground means the composite resource will be deleted using
|
|
// the Background Propagation Policy when the claim is deleted.
|
|
CompositeDeleteBackground CompositeDeletePolicy = "Background"
|
|
|
|
// CompositeDeleteForeground means the composite resource will be deleted using
|
|
// the Foreground Propagation Policy when the claim is deleted.
|
|
CompositeDeleteForeground CompositeDeletePolicy = "Foreground"
|
|
)
|
|
|
|
// An UpdatePolicy determines how something should be updated - either
|
|
// automatically (without human intervention) or manually.
|
|
// +kubebuilder:validation:Enum=Automatic;Manual
|
|
type UpdatePolicy string
|
|
|
|
const (
|
|
// UpdateAutomatic means the resource should be updated automatically,
|
|
// without any human intervention.
|
|
UpdateAutomatic UpdatePolicy = "Automatic"
|
|
|
|
// UpdateManual means the resource requires human intervention to
|
|
// update.
|
|
UpdateManual UpdatePolicy = "Manual"
|
|
)
|
|
|
|
// ResolvePolicy is a type for resolve policy.
|
|
type ResolvePolicy string
|
|
|
|
// ResolutionPolicy is a type for resolution policy.
|
|
type ResolutionPolicy string
|
|
|
|
const (
|
|
// ResolvePolicyAlways is a resolve option.
|
|
// When the ResolvePolicy is set to ResolvePolicyAlways the reference will
|
|
// be tried to resolve for every reconcile loop.
|
|
ResolvePolicyAlways ResolvePolicy = "Always"
|
|
|
|
// ResolutionPolicyRequired is a resolution option.
|
|
// When the ResolutionPolicy is set to ResolutionPolicyRequired the execution
|
|
// could not continue even if the reference cannot be resolved.
|
|
ResolutionPolicyRequired ResolutionPolicy = "Required"
|
|
|
|
// ResolutionPolicyOptional is a resolution option.
|
|
// When the ReferenceResolutionPolicy is set to ReferencePolicyOptional the
|
|
// execution could continue even if the reference cannot be resolved.
|
|
ResolutionPolicyOptional ResolutionPolicy = "Optional"
|
|
)
|