// Copyright (c) 2026 Tigera, Inc. All rights reserved.

// Code generated by applyconfiguration-gen. DO NOT EDIT.

package v3

import (
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// NodeControllerConfigApplyConfiguration represents a declarative configuration of the NodeControllerConfig type for use
// with apply.
//
// NodeControllerConfig configures the node controller, which automatically cleans up configuration
// for nodes that no longer exist. Optionally, it can create host endpoints for all Kubernetes nodes.
type NodeControllerConfigApplyConfiguration struct {
	// ReconcilerPeriod is the period to perform reconciliation with the Calico datastore. [Default: 5m]
	ReconcilerPeriod *v1.Duration `json:"reconcilerPeriod,omitempty"`
	// SyncLabels controls whether to copy Kubernetes node labels to Calico nodes. [Default: Enabled]
	// Valid values are: "Enabled", "Disabled".
	SyncLabels *string `json:"syncLabels,omitempty"`
	// HostEndpoint controls syncing nodes to host endpoints. Disabled by default, set to nil to disable.
	HostEndpoint *AutoHostEndpointConfigApplyConfiguration `json:"hostEndpoint,omitempty"`
	// LeakGracePeriod is the period used by the controller to determine if an IP address has been leaked.
	// Set to 0 to disable IP garbage collection. [Default: 15m]
	LeakGracePeriod *v1.Duration `json:"leakGracePeriod,omitempty"`
}

// NodeControllerConfigApplyConfiguration constructs a declarative configuration of the NodeControllerConfig type for use with
// apply.
func NodeControllerConfig() *NodeControllerConfigApplyConfiguration {
	return &NodeControllerConfigApplyConfiguration{}
}

// WithReconcilerPeriod sets the ReconcilerPeriod 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 ReconcilerPeriod field is set to the value of the last call.
func (b *NodeControllerConfigApplyConfiguration) WithReconcilerPeriod(value v1.Duration) *NodeControllerConfigApplyConfiguration {
	b.ReconcilerPeriod = &value
	return b
}

// WithSyncLabels sets the SyncLabels 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 SyncLabels field is set to the value of the last call.
func (b *NodeControllerConfigApplyConfiguration) WithSyncLabels(value string) *NodeControllerConfigApplyConfiguration {
	b.SyncLabels = &value
	return b
}

// WithHostEndpoint sets the HostEndpoint 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 HostEndpoint field is set to the value of the last call.
func (b *NodeControllerConfigApplyConfiguration) WithHostEndpoint(value *AutoHostEndpointConfigApplyConfiguration) *NodeControllerConfigApplyConfiguration {
	b.HostEndpoint = value
	return b
}

// WithLeakGracePeriod sets the LeakGracePeriod 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 LeakGracePeriod field is set to the value of the last call.
func (b *NodeControllerConfigApplyConfiguration) WithLeakGracePeriod(value v1.Duration) *NodeControllerConfigApplyConfiguration {
	b.LeakGracePeriod = &value
	return b
}
