Documentation ¶
Index ¶
- Constants
- func AdoptOldAutonameIfUnnamed(newObj, oldObj *unstructured.Unstructured)
- func AssignNameIfAutonamable(obj *unstructured.Unstructured, base tokens.QName)
- func GetAnnotationValue(obj *unstructured.Unstructured, key string) string
- func GetLabel(obj *unstructured.Unstructured, key string) interface{}
- func HasManagedByLabel(obj *unstructured.Unstructured) bool
- func IsAnnotationTrue(obj *unstructured.Unstructured, key string) bool
- func IsAutonamed(obj *unstructured.Unstructured) bool
- func IsInternalAnnotation(key string) bool
- func SetAnnotation(obj *unstructured.Unstructured, key, value string)
- func SetAnnotationTrue(obj *unstructured.Unstructured, key string)
- func SkipAwaitLogic(obj *unstructured.Unstructured) bool
- func TimeoutDuration(resourceTimeoutSeconds float64, obj *unstructured.Unstructured, ...) time.Duration
- func TrySetLabel(obj *unstructured.Unstructured, key, value string) (succeeded bool, err error)
- func TrySetManagedByLabel(obj *unstructured.Unstructured) (bool, error)
Constants ¶
const ( AnnotationTrue = "true" AnnotationFalse = "false" AnnotationPrefix = "pulumi.com/" AnnotationAutonamed = AnnotationPrefix + "autonamed" AnnotationSkipAwait = AnnotationPrefix + "skipAwait" AnnotationTimeoutSeconds = AnnotationPrefix + "timeoutSeconds" AnnotationInitialAPIVersion = AnnotationPrefix + "initialApiVersion" )
Variables ¶
This section is empty.
Functions ¶
func AdoptOldAutonameIfUnnamed ¶ added in v0.25.1
func AdoptOldAutonameIfUnnamed(newObj, oldObj *unstructured.Unstructured)
AdoptOldAutonameIfUnnamed checks if `newObj` has a name, and if not, "adopts" the name of `oldObj` instead. If `oldObj` was autonamed, then we mark `newObj` as autonamed, too.
func AssignNameIfAutonamable ¶
func AssignNameIfAutonamable(obj *unstructured.Unstructured, base tokens.QName)
AssignNameIfAutonamable generates a name for an object. Uses DNS-1123-compliant characters. All auto-named resources get the annotation `pulumi.com/autonamed` for tooling purposes.
func GetAnnotationValue ¶ added in v0.20.4
func GetAnnotationValue(obj *unstructured.Unstructured, key string) string
GetAnnotationValue returns the value of the specified annotation on the provided Unstructured object.
func GetLabel ¶ added in v0.25.2
func GetLabel(obj *unstructured.Unstructured, key string) interface{}
GetLabel gets the value of the specified label from the given object.
func HasManagedByLabel ¶ added in v0.25.2
func HasManagedByLabel(obj *unstructured.Unstructured) bool
HasManagedByLabel returns true if the object has the `app.kubernetes.io/managed-by` label set to `pulumi`, or is a computed value.
func IsAnnotationTrue ¶
func IsAnnotationTrue(obj *unstructured.Unstructured, key string) bool
IsAnnotationTrue returns true if the specified annotation has the value "true", false otherwise.
func IsAutonamed ¶
func IsAutonamed(obj *unstructured.Unstructured) bool
func IsInternalAnnotation ¶
IsInternalAnnotation returns true if the specified annotation has the `pulumi.com/` prefix, false otherwise.
func SetAnnotation ¶
func SetAnnotation(obj *unstructured.Unstructured, key, value string)
SetAnnotation sets the specified key, value annotation on the provided Unstructured object. TODO(levi): This won't work for Pulumi-computed values. https://github.com/pulumi/pulumi-kubernetes/issues/826
func SetAnnotationTrue ¶
func SetAnnotationTrue(obj *unstructured.Unstructured, key string)
SetAnnotationTrue sets the specified annotation key to "true" on the provided Unstructured object.
func SkipAwaitLogic ¶
func SkipAwaitLogic(obj *unstructured.Unstructured) bool
SkipAwaitLogic returns true if the `pulumi.com/skipAwait` annotation is "true", false otherwise.
func TimeoutDuration ¶ added in v1.0.0
func TimeoutDuration(resourceTimeoutSeconds float64, obj *unstructured.Unstructured, defaultSeconds int) time.Duration
TimeoutDuration returns the resource timeout duration. There are a number of things it can do here in this order 1. Return the timeout as specified in the customResource options 2. Return the timeout as specified in `pulumi.com/timeoutSeconds` annotation, 3. Return a defaultSeconds value if the annotation is unset/invalid.
func TrySetLabel ¶ added in v0.25.3
func TrySetLabel(obj *unstructured.Unstructured, key, value string) (succeeded bool, err error)
TrySetLabel attempts to set the specified key/value pair as a label on the provided Unstructured object, reporting whether the write was successful, and an error if (e.g.) the underlying object is mistyped. In particular, TrySetLabel will fail if the underlying object has a Pulumi computed value.
func TrySetManagedByLabel ¶ added in v0.25.3
func TrySetManagedByLabel(obj *unstructured.Unstructured) (bool, error)
TrySetManagedByLabel attempts to set the `app.kubernetes.io/managed-by` label to the `pulumi` key on the provided Unstructured object, reporting whether the write was successful, and an error if (e.g.) the underlying object is mistyped. In particular, TrySetLabel will fail if the underlying object has a Pulumi computed value.
Types ¶
This section is empty.