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

package v1

import (
	machineconfigurationv1 "github.com/openshift/api/machineconfiguration/v1"
	resource "k8s.io/apimachinery/pkg/api/resource"
)

// ContainerRuntimeConfigurationApplyConfiguration represents a declarative configuration of the ContainerRuntimeConfiguration type for use
// with apply.
//
// ContainerRuntimeConfiguration defines the tuneables of the container runtime
type ContainerRuntimeConfigurationApplyConfiguration struct {
	// pidsLimit specifies the maximum number of processes allowed in a container
	PidsLimit *int64 `json:"pidsLimit,omitempty"`
	// logLevel specifies the verbosity of the logs based on the level it is set to.
	// Options are fatal, panic, error, warn, info, and debug.
	LogLevel *string `json:"logLevel,omitempty"`
	// logSizeMax specifies the Maximum size allowed for the container log file.
	// Negative numbers indicate that no size limit is imposed.
	// If it is positive, it must be >= 8192 to match/exceed conmon's read buffer.
	LogSizeMax *resource.Quantity `json:"logSizeMax,omitempty"`
	// overlaySize specifies the maximum size of a container image.
	// This flag can be used to set quota on the size of container images. (default: 10GB)
	OverlaySize *resource.Quantity `json:"overlaySize,omitempty"`
	// defaultRuntime is the name of the OCI runtime to be used as the default for containers.
	// Allowed values are `runc` and `crun`.
	// When set to `runc`, OpenShift will use runc to execute the container
	// When set to `crun`, OpenShift will use crun to execute the container
	// When omitted, this means no opinion and the platform is left to choose a reasonable default,
	// which is subject to change over time. Currently, the default is `crun`.
	DefaultRuntime *machineconfigurationv1.ContainerRuntimeDefaultRuntime `json:"defaultRuntime,omitempty"`
	// additionalLayerStores configures additional read-only container image layer store locations for Open Container Initiative (OCI) images.
	//
	// Layers are checked in order: additional stores first, then the default location.
	// Stores are read-only.
	// Maximum of 5 stores allowed.
	// Each path must be unique.
	//
	// When omitted, only the default layer location is used.
	// When specified, at least one store must be provided.
	AdditionalLayerStores []AdditionalLayerStoreApplyConfiguration `json:"additionalLayerStores,omitempty"`
	// additionalImageStores configures additional read-only container image store locations for Open Container Initiative (OCI) images.
	//
	// Images are checked in order: additional stores first, then the default location.
	// Stores are read-only.
	// Maximum of 10 stores allowed.
	// Each path must be unique.
	//
	// When omitted, only the default image location is used.
	// When specified, at least one store must be provided.
	AdditionalImageStores []AdditionalImageStoreApplyConfiguration `json:"additionalImageStores,omitempty"`
	// additionalArtifactStores configures additional read-only artifact storage locations for Open Container Initiative (OCI) artifacts.
	//
	// Artifacts are checked in order: additional stores first, then the default location (/var/lib/containers/storage/artifacts).
	// Stores are read-only.
	// Maximum of 10 stores allowed.
	// Each path must be unique.
	//
	// When omitted, only the default artifact location is used.
	// When specified, at least one store must be provided.
	AdditionalArtifactStores []AdditionalArtifactStoreApplyConfiguration `json:"additionalArtifactStores,omitempty"`
}

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

// WithPidsLimit sets the PidsLimit 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 PidsLimit field is set to the value of the last call.
func (b *ContainerRuntimeConfigurationApplyConfiguration) WithPidsLimit(value int64) *ContainerRuntimeConfigurationApplyConfiguration {
	b.PidsLimit = &value
	return b
}

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

// WithLogSizeMax sets the LogSizeMax 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 LogSizeMax field is set to the value of the last call.
func (b *ContainerRuntimeConfigurationApplyConfiguration) WithLogSizeMax(value resource.Quantity) *ContainerRuntimeConfigurationApplyConfiguration {
	b.LogSizeMax = &value
	return b
}

// WithOverlaySize sets the OverlaySize 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 OverlaySize field is set to the value of the last call.
func (b *ContainerRuntimeConfigurationApplyConfiguration) WithOverlaySize(value resource.Quantity) *ContainerRuntimeConfigurationApplyConfiguration {
	b.OverlaySize = &value
	return b
}

// WithDefaultRuntime sets the DefaultRuntime 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 DefaultRuntime field is set to the value of the last call.
func (b *ContainerRuntimeConfigurationApplyConfiguration) WithDefaultRuntime(value machineconfigurationv1.ContainerRuntimeDefaultRuntime) *ContainerRuntimeConfigurationApplyConfiguration {
	b.DefaultRuntime = &value
	return b
}

// WithAdditionalLayerStores adds the given value to the AdditionalLayerStores field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the AdditionalLayerStores field.
func (b *ContainerRuntimeConfigurationApplyConfiguration) WithAdditionalLayerStores(values ...*AdditionalLayerStoreApplyConfiguration) *ContainerRuntimeConfigurationApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithAdditionalLayerStores")
		}
		b.AdditionalLayerStores = append(b.AdditionalLayerStores, *values[i])
	}
	return b
}

// WithAdditionalImageStores adds the given value to the AdditionalImageStores field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the AdditionalImageStores field.
func (b *ContainerRuntimeConfigurationApplyConfiguration) WithAdditionalImageStores(values ...*AdditionalImageStoreApplyConfiguration) *ContainerRuntimeConfigurationApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithAdditionalImageStores")
		}
		b.AdditionalImageStores = append(b.AdditionalImageStores, *values[i])
	}
	return b
}

// WithAdditionalArtifactStores adds the given value to the AdditionalArtifactStores field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the AdditionalArtifactStores field.
func (b *ContainerRuntimeConfigurationApplyConfiguration) WithAdditionalArtifactStores(values ...*AdditionalArtifactStoreApplyConfiguration) *ContainerRuntimeConfigurationApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithAdditionalArtifactStores")
		}
		b.AdditionalArtifactStores = append(b.AdditionalArtifactStores, *values[i])
	}
	return b
}
