Generated apply configurations

Kubernetes-commit: e5a98bba6144935279509ec4defbb120d387e3fb
This commit is contained in:
Joe Betz
2021-03-07 14:49:10 -08:00
committed by Kubernetes Publisher
parent 9e347785cf
commit 476d5f996a
98 changed files with 13428 additions and 0 deletions

View File

@@ -19,8 +19,11 @@ limitations under the License.
package v1beta1
import (
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
internal "k8s.io/client-go/applyconfigurations/internal"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
@@ -44,6 +47,31 @@ func Ingress(name, namespace string) *IngressApplyConfiguration {
return b
}
// ExtractIngress extracts the applied configuration owned by fieldManager from
// ingress. If no managedFields are found in ingress for fieldManager, a
// IngressApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. Is is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ingress must be a unmodified Ingress API object that was retrieved from the Kubernetes API.
// ExtractIngress provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractIngress(ingress *extensionsv1beta1.Ingress, fieldManager string) (*IngressApplyConfiguration, error) {
b := &IngressApplyConfiguration{}
err := managedfields.ExtractInto(ingress, internal.Parser().Type("io.k8s.api.extensions.v1beta1.Ingress"), fieldManager, b)
if err != nil {
return nil, err
}
b.WithName(ingress.Name)
b.WithNamespace(ingress.Namespace)
b.WithKind("Ingress")
b.WithAPIVersion("extensions/v1beta1")
return b, nil
}
// WithKind sets the Kind field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Kind field is set to the value of the last call.