Documentation ¶
Index ¶
- func ApplyYAML(ctx context.Context, c client.Client, data []byte) error
- func ApplyYAMLWithNamespace(ctx context.Context, c client.Client, data []byte, namespace string) error
- func DeleteYAML(ctx context.Context, c client.Client, data []byte) error
- func DeleteYAMLWithNamespace(ctx context.Context, c client.Client, data []byte, namespace string) error
- func DoesNotExistYAML(ctx context.Context, c client.Client, data []byte) (bool, error)
- func DoesNotExistYAMLWithNamespace(ctx context.Context, c client.Client, data []byte, namespace string) (bool, error)
- func ExistsYAML(ctx context.Context, c client.Client, data []byte) error
- func ExistsYAMLWithNamespace(ctx context.Context, c client.Client, data []byte, namespace string) error
- func ForEachObjectInYAML(ctx context.Context, c client.Client, data []byte, namespace string, ...) error
- type ForEachObjectInYAMLActionFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyYAMLWithNamespace ¶
func ApplyYAMLWithNamespace(ctx context.Context, c client.Client, data []byte, namespace string) error
ApplyYAMLWithNamespace applies the provided YAML as unstructured data with the given client. The data may be a single YAML document or multidoc YAML This function is idempotent. When a non-empty namespace is provided then all objects are assigned the the namespace prior to being created.
func DeleteYAML ¶
DeleteYAML calls DeleteYAMLWithNamespace with an empty namespace.
func DeleteYAMLWithNamespace ¶
func DeleteYAMLWithNamespace(ctx context.Context, c client.Client, data []byte, namespace string) error
DeleteYAMLWithNamespace deletes the provided YAML as unstructured data with the given client. The data may be a single YAML document or multidoc YAML. When a non-empty namespace is provided then all objects are assigned the the namespace prior to any other actions being performed with or to the object.
func DoesNotExistYAML ¶
DoesNotExistYAML calls DoesNotExistYAMLWithNamespace with an empty namespace.
func DoesNotExistYAMLWithNamespace ¶
func DoesNotExistYAMLWithNamespace(ctx context.Context, c client.Client, data []byte, namespace string) (bool, error)
DoesNotExistYAMLWithNamespace verifies each object in the provided YAML no longer exists on the API server. The data may be a single YAML document or multidoc YAML. When a non-empty namespace is provided then all objects are assigned the the namespace prior to any other actions being performed with or to the object. A boolean true is returned if none of the objects exist. An error is returned if the Get call returns an error other than 404 NotFound.
func ExistsYAML ¶
ExistsYAML calls ExistsYAMLWithNamespace with an empty namespace.
func ExistsYAMLWithNamespace ¶
func ExistsYAMLWithNamespace(ctx context.Context, c client.Client, data []byte, namespace string) error
ExistsYAMLWithNamespace verifies each object in the provided YAML exists on the API server. The data may be a single YAML document or multidoc YAML. When a non-empty namespace is provided then all objects are assigned the the namespace prior to any other actions being performed with or to the object. A nil error is returned if all objects exist.
func ForEachObjectInYAML ¶
func ForEachObjectInYAML( ctx context.Context, c client.Client, data []byte, namespace string, actionFn ForEachObjectInYAMLActionFunc) error
ForEachObjectInYAML excutes actionFn for each object in the provided YAML. If an error is returned then no further objects are processed. The data may be a single YAML document or multidoc YAML. When a non-empty namespace is provided then all objects are assigned the the namespace prior to any other actions being performed with or to the object.
Types ¶
type ForEachObjectInYAMLActionFunc ¶
type ForEachObjectInYAMLActionFunc func(context.Context, client.Client, *unstructured.Unstructured) error
ForEachObjectInYAMLActionFunc is a function that is executed against each object found in a YAML document. When a non-empty namespace is provided then the object is assigned the namespace prior to any other actions being performed with or to the object.