metadata

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2020 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
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

func IsInternalAnnotation(key string) bool

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL