Documentation ¶
Overview ¶
SPDX-License-Identifier: Apache-2.0
Copyright Contributors to the Submariner project.
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.
SPDX-License-Identifier: Apache-2.0
Copyright Contributors to the Submariner project.
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.
SPDX-License-Identifier: Apache-2.0
Copyright Contributors to the Submariner project.
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.
Index ¶
- Constants
- func BuildRestMapper(restConfig *rest.Config) (meta.RESTMapper, error)
- func ConditionsFromUnstructured(from *unstructured.Unstructured, fields ...string) []metav1.Condition
- func ConditionsToUnstructured(conditions []metav1.Condition, to *unstructured.Unstructured, fields ...string)
- func CreateAnew(ctx context.Context, client resource.Interface, obj runtime.Object, ...) error
- func FindGroupVersionResource(from *unstructured.Unstructured, restMapper meta.RESTMapper) (*schema.GroupVersionResource, error)
- func GetMetadata(from *unstructured.Unstructured) map[string]interface{}
- func GetNestedField(obj *unstructured.Unstructured, fields ...string) interface{}
- func GetSpec(obj *unstructured.Unstructured) interface{}
- func SetBackoff(b wait.Backoff) wait.Backoff
- func ToUnstructuredResource(from runtime.Object, restMapper meta.RESTMapper) (*unstructured.Unstructured, *schema.GroupVersionResource, error)
- func TryAppendCondition(conditions []metav1.Condition, newCondition metav1.Condition) []metav1.Condition
- func Update(ctx context.Context, client resource.Interface, obj runtime.Object, ...) error
- type MutateFn
- type OperationResult
Constants ¶
const ( MetadataField = "metadata" LabelsField = "labels" )
Variables ¶
This section is empty.
Functions ¶
func BuildRestMapper ¶
func BuildRestMapper(restConfig *rest.Config) (meta.RESTMapper, error)
func ConditionsFromUnstructured ¶ added in v0.10.1
func ConditionsFromUnstructured(from *unstructured.Unstructured, fields ...string) []metav1.Condition
func ConditionsToUnstructured ¶ added in v0.10.1
func ConditionsToUnstructured(conditions []metav1.Condition, to *unstructured.Unstructured, fields ...string)
func CreateAnew ¶ added in v0.9.0
func CreateAnew(ctx context.Context, client resource.Interface, obj runtime.Object, createOptions metav1.CreateOptions, deleteOptions metav1.DeleteOptions) error
CreateAnew creates a resource, first deleting an existing instance if one exists. If the delete options specify that deletion should be propagated in the foreground, this will wait for the deletion to be complete before creating the new object: with foreground propagation, Get will continue to return the object being deleted and Create will fail with “already exists” until deletion is complete.
func FindGroupVersionResource ¶
func FindGroupVersionResource(from *unstructured.Unstructured, restMapper meta.RESTMapper) (*schema.GroupVersionResource, error)
func GetMetadata ¶
func GetMetadata(from *unstructured.Unstructured) map[string]interface{}
func GetNestedField ¶ added in v0.6.0
func GetNestedField(obj *unstructured.Unstructured, fields ...string) interface{}
func GetSpec ¶ added in v0.6.0
func GetSpec(obj *unstructured.Unstructured) interface{}
func ToUnstructuredResource ¶
func ToUnstructuredResource(from runtime.Object, restMapper meta.RESTMapper) (*unstructured.Unstructured, *schema.GroupVersionResource, error)
Types ¶
type OperationResult ¶
type OperationResult string
const ( OperationResultNone OperationResult = "unchanged" OperationResultCreated OperationResult = "created" OperationResultUpdated OperationResult = "updated" )