All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.kubernetes.resource.v1beta1.kotlin.outputs.ResourceClaimStatusPatch.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 4.18.2.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.kubernetes.resource.v1beta1.kotlin.outputs

import kotlin.Suppress
import kotlin.collections.List

/**
 * ResourceClaimStatus tracks whether the resource has been allocated and what the result of that was.
 * @property allocation Allocation is set once the claim has been allocated successfully.
 * @property devices Devices contains the status of each device allocated for this claim, as reported by the driver. This can include driver-specific information. Entries are owned by their respective drivers.
 * @property reservedFor ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated.
 * In a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled.
 * Both schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again.
 * There can be at most 32 such reservations. This may get increased in the future, but not reduced.
 */
public data class ResourceClaimStatusPatch(
    public val allocation: AllocationResultPatch? = null,
    public val devices: List? = null,
    public val reservedFor: List? = null,
) {
    public companion object {
        public fun toKotlin(javaType: com.pulumi.kubernetes.resource.v1beta1.outputs.ResourceClaimStatusPatch): ResourceClaimStatusPatch = ResourceClaimStatusPatch(
            allocation = javaType.allocation().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.kubernetes.resource.v1beta1.kotlin.outputs.AllocationResultPatch.Companion.toKotlin(args0)
                })
            }).orElse(null),
            devices = javaType.devices().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.kubernetes.resource.v1beta1.kotlin.outputs.AllocatedDeviceStatusPatch.Companion.toKotlin(args0)
                })
            }),
            reservedFor = javaType.reservedFor().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.kubernetes.resource.v1beta1.kotlin.outputs.ResourceClaimConsumerReferencePatch.Companion.toKotlin(args0)
                })
            }),
        )
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy