Use name as fallback merge-key (#21)

This change uses the attribute `name` if
`x-kubernetes-patch-merge-key` is not the full
`x-kubernetes-list-map-keys` to avoid data corruption.
This commit is contained in:
Herwig Stuetz 2023-05-25 07:09:03 +02:00 committed by GitHub
parent a90fdc0eae
commit dc1c99460f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 942 additions and 610 deletions

View file

@ -66,14 +66,24 @@ let
mkOptionDefault = mkOverride 1001;
# todo: can we use mkOrder
mergeValuesByKey = mergeKey: values:
mergeValuesByKey = attrMergeKey: listMergeKeys: values:
listToAttrs (imap0
(i: value: nameValuePair
(
if isAttrs value.${mergeKey}
then toString value.${mergeKey}.content
else (toString value.${mergeKey})
if hasAttr attrMergeKey value
then
if isAttrs value.${attrMergeKey}
then toString value.${attrMergeKey}.content
else (toString value.${attrMergeKey})
else
# generate merge key for list elements if it's not present
"__kubenix_list_merge_key_" + (concatStringsSep "" (map
(key:
if isAttrs value.${key}
then toString value.${key}.content
else (toString value.${key})
)
listMergeKeys))
)
(value // { _priority = i; }))
values);
@ -96,7 +106,12 @@ let
_priority = mkOption { type = types.nullOr types.int; default = null; };
};
config = definitions."${ref}".config // {
${mergeKey} = mkOverride 1002 (convertName name);
${mergeKey} = mkOverride 1002 (
# use name as mergeKey only if it is not coming from mergeValuesByKey
if (!hasPrefix "__kubenix_list_merge_key_" name)
then convertName name
else null
);
};
});
@ -119,10 +134,10 @@ let
];
});
coerceAttrsOfSubmodulesToListByKey = ref: mergeKey: (types.coercedTo
coerceAttrsOfSubmodulesToListByKey = ref: attrMergeKey: listMergeKeys: (types.coercedTo
(types.listOf (submoduleOf ref))
(mergeValuesByKey mergeKey)
(types.attrsOf (submoduleWithMergeOf ref mergeKey))
(mergeValuesByKey attrMergeKey listMergeKeys)
(types.attrsOf (submoduleWithMergeOf ref attrMergeKey))
);
definitions = {
@ -204,7 +219,7 @@ let
};
"webhooks" = mkOption {
description = "Webhooks is a list of webhooks and the affected resources and operations.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.admissionregistration.v1.MutatingWebhook" "name"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.admissionregistration.v1.MutatingWebhook" "name" [ ]));
apply = attrsToList;
};
};
@ -383,7 +398,7 @@ let
};
"webhooks" = mkOption {
description = "Webhooks is a list of webhooks and the affected resources and operations.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.admissionregistration.v1.ValidatingWebhook" "name"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.admissionregistration.v1.ValidatingWebhook" "name" [ ]));
apply = attrsToList;
};
};
@ -803,7 +818,7 @@ let
};
"conditions" = mkOption {
description = "Represents the latest available observations of a DaemonSet's current state.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.apps.v1.DaemonSetCondition" "type"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.apps.v1.DaemonSetCondition" "type" [ ]));
apply = attrsToList;
};
"currentNumberScheduled" = mkOption {
@ -1034,7 +1049,7 @@ let
};
"conditions" = mkOption {
description = "Represents the latest available observations of a deployment's current state.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.apps.v1.DeploymentCondition" "type"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.apps.v1.DeploymentCondition" "type" [ ]));
apply = attrsToList;
};
"observedGeneration" = mkOption {
@ -1227,7 +1242,7 @@ let
};
"conditions" = mkOption {
description = "Represents the latest available observations of a replica set's current state.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.apps.v1.ReplicaSetCondition" "type"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.apps.v1.ReplicaSetCondition" "type" [ ]));
apply = attrsToList;
};
"fullyLabeledReplicas" = mkOption {
@ -1500,7 +1515,7 @@ let
};
"conditions" = mkOption {
description = "Represents the latest available observations of a statefulset's current state.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.apps.v1.StatefulSetCondition" "type"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.apps.v1.StatefulSetCondition" "type" [ ]));
apply = attrsToList;
};
"currentReplicas" = mkOption {
@ -2683,7 +2698,7 @@ let
options = {
"conditions" = mkOption {
description = "conditions is the set of conditions required for this autoscaler to scale its target, and indicates whether or not those conditions are met.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.autoscaling.v2.HorizontalPodAutoscalerCondition" "type"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.autoscaling.v2.HorizontalPodAutoscalerCondition" "type" [ ]));
apply = attrsToList;
};
"currentMetrics" = mkOption {
@ -4218,7 +4233,8 @@ let
options = {
"active" = mkOption {
description = "A list of pointers to currently running jobs.";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.core.v1.ObjectReference")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ObjectReference" "name" [ ]));
apply = attrsToList;
};
"lastScheduleTime" = mkOption {
description = "Information when was the last time the job was successfully scheduled.";
@ -4416,7 +4432,7 @@ let
};
"conditions" = mkOption {
description = "The latest available observations of an object's current state. When a Job fails, one of the conditions will have type \"Failed\" and status true. When a Job is suspended, one of the conditions will have type \"Suspended\" and status true; when the Job is resumed, the status of this condition will become false. When a Job is completed, one of the conditions will have type \"Complete\" and status true. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.batch.v1.JobCondition" "type"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.batch.v1.JobCondition" "type" [ ]));
apply = attrsToList;
};
"failed" = mkOption {
@ -4607,7 +4623,8 @@ let
options = {
"active" = mkOption {
description = "A list of pointers to currently running jobs.";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.core.v1.ObjectReference")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ObjectReference" "name" [ ]));
apply = attrsToList;
};
"lastScheduleTime" = mkOption {
description = "Information when was the last time the job was successfully scheduled.";
@ -5394,7 +5411,7 @@ let
};
"conditions" = mkOption {
description = "List of component conditions observed";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ComponentCondition" "type"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ComponentCondition" "type" [ ]));
apply = attrsToList;
};
"kind" = mkOption {
@ -5658,7 +5675,7 @@ let
};
"env" = mkOption {
description = "List of environment variables to set in the container. Cannot be updated.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.EnvVar" "name"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.EnvVar" "name" [ ]));
apply = attrsToList;
};
"envFrom" = mkOption {
@ -5687,7 +5704,7 @@ let
};
"ports" = mkOption {
description = "List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ContainerPort" "containerPort"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ContainerPort" "name" [ "containerPort" "protocol" ]));
apply = attrsToList;
};
"readinessProbe" = mkOption {
@ -5728,12 +5745,12 @@ let
};
"volumeDevices" = mkOption {
description = "volumeDevices is the list of block devices to be used by the container.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.VolumeDevice" "devicePath"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.VolumeDevice" "devicePath" [ ]));
apply = attrsToList;
};
"volumeMounts" = mkOption {
description = "Pod volumes to mount into the container's filesystem. Cannot be updated.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.VolumeMount" "mountPath"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.VolumeMount" "mountPath" [ ]));
apply = attrsToList;
};
"workingDir" = mkOption {
@ -6144,7 +6161,8 @@ let
};
"ports" = mkOption {
description = "Port numbers available on the related IP addresses.";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.core.v1.EndpointPort")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.EndpointPort" "name" [ ]));
apply = attrsToList;
};
};
@ -6307,7 +6325,7 @@ let
};
"env" = mkOption {
description = "List of environment variables to set in the container. Cannot be updated.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.EnvVar" "name"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.EnvVar" "name" [ ]));
apply = attrsToList;
};
"envFrom" = mkOption {
@ -6336,7 +6354,7 @@ let
};
"ports" = mkOption {
description = "Ports are not allowed for ephemeral containers.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ContainerPort" "containerPort"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ContainerPort" "name" [ "containerPort" "protocol" ]));
apply = attrsToList;
};
"readinessProbe" = mkOption {
@ -6381,12 +6399,12 @@ let
};
"volumeDevices" = mkOption {
description = "volumeDevices is the list of block devices to be used by the container.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.VolumeDevice" "devicePath"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.VolumeDevice" "devicePath" [ ]));
apply = attrsToList;
};
"volumeMounts" = mkOption {
description = "Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers. Cannot be updated.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.VolumeMount" "mountPath"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.VolumeMount" "mountPath" [ ]));
apply = attrsToList;
};
"workingDir" = mkOption {
@ -6869,7 +6887,8 @@ let
};
"httpHeaders" = mkOption {
description = "Custom headers to set in the request. HTTP allows repeated headers.";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.core.v1.HTTPHeader")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.HTTPHeader" "name" [ ]));
apply = attrsToList;
};
"path" = mkOption {
description = "Path to access on the HTTP server.";
@ -7467,7 +7486,7 @@ let
options = {
"conditions" = mkOption {
description = "Represents the latest available observations of a namespace's current state.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.NamespaceCondition" "type"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.NamespaceCondition" "type" [ ]));
apply = attrsToList;
};
"phase" = mkOption {
@ -7788,7 +7807,7 @@ let
options = {
"addresses" = mkOption {
description = "List of addresses reachable to the node. Queried from cloud provider, if available. More info: https://kubernetes.io/docs/concepts/nodes/node/#addresses Note: This field is declared as mergeable, but the merge key is not sufficiently unique, which can cause data corruption when it is merged. Callers should instead use a full-replacement patch. See http://pr.k8s.io/79391 for an example.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.NodeAddress" "type"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.NodeAddress" "type" [ ]));
apply = attrsToList;
};
"allocatable" = mkOption {
@ -7801,7 +7820,7 @@ let
};
"conditions" = mkOption {
description = "Conditions is an array of current observed node conditions. More info: https://kubernetes.io/docs/concepts/nodes/node/#condition";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.NodeCondition" "type"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.NodeCondition" "type" [ ]));
apply = attrsToList;
};
"config" = mkOption {
@ -7826,7 +7845,8 @@ let
};
"volumesAttached" = mkOption {
description = "List of volumes that are attached to the node.";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.core.v1.AttachedVolume")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.AttachedVolume" "name" [ ]));
apply = attrsToList;
};
"volumesInUse" = mkOption {
description = "List of attachable volumes in use (mounted) by the node.";
@ -8167,7 +8187,7 @@ let
};
"conditions" = mkOption {
description = "Current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'ResizeStarted'.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.PersistentVolumeClaimCondition" "type"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.PersistentVolumeClaimCondition" "type" [ ]));
apply = attrsToList;
};
"phase" = mkOption {
@ -8613,7 +8633,8 @@ let
};
"options" = mkOption {
description = "A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.core.v1.PodDNSConfigOption")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.PodDNSConfigOption" "name" [ ]));
apply = attrsToList;
};
"searches" = mkOption {
description = "A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.";
@ -8756,7 +8777,8 @@ let
};
"sysctls" = mkOption {
description = "Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows.";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.core.v1.Sysctl")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.Sysctl" "name" [ ]));
apply = attrsToList;
};
"windowsOptions" = mkOption {
description = "The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux.";
@ -8796,7 +8818,7 @@ let
};
"containers" = mkOption {
description = "List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.";
type = (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.Container" "name");
type = (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.Container" "name" [ ]);
apply = attrsToList;
};
"dnsConfig" = mkOption {
@ -8813,12 +8835,12 @@ let
};
"ephemeralContainers" = mkOption {
description = "List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource. This field is beta-level and available on clusters that haven't disabled the EphemeralContainers feature gate.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.EphemeralContainer" "name"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.EphemeralContainer" "name" [ ]));
apply = attrsToList;
};
"hostAliases" = mkOption {
description = "HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.HostAlias" "ip"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.HostAlias" "ip" [ ]));
apply = attrsToList;
};
"hostIPC" = mkOption {
@ -8839,12 +8861,12 @@ let
};
"imagePullSecrets" = mkOption {
description = "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.LocalObjectReference" "name"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.LocalObjectReference" "name" [ ]));
apply = attrsToList;
};
"initContainers" = mkOption {
description = "List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.Container" "name"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.Container" "name" [ ]));
apply = attrsToList;
};
"nodeName" = mkOption {
@ -8925,12 +8947,11 @@ let
};
"topologySpreadConstraints" = mkOption {
description = "TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.TopologySpreadConstraint" "topologyKey"));
apply = attrsToList;
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.core.v1.TopologySpreadConstraint")));
};
"volumes" = mkOption {
description = "List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.Volume" "name"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.Volume" "name" [ ]));
apply = attrsToList;
};
};
@ -8980,16 +9001,18 @@ let
options = {
"conditions" = mkOption {
description = "Current service state of pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.PodCondition" "type"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.PodCondition" "type" [ ]));
apply = attrsToList;
};
"containerStatuses" = mkOption {
description = "The list has one entry per container in the manifest. Each entry is currently the output of `docker inspect`. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.core.v1.ContainerStatus")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ContainerStatus" "name" [ ]));
apply = attrsToList;
};
"ephemeralContainerStatuses" = mkOption {
description = "Status for any ephemeral containers that have run in this pod. This field is beta-level and available on clusters that haven't disabled the EphemeralContainers feature gate.";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.core.v1.ContainerStatus")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ContainerStatus" "name" [ ]));
apply = attrsToList;
};
"hostIP" = mkOption {
description = "IP address of the host to which the pod is assigned. Empty if not yet scheduled.";
@ -8997,7 +9020,8 @@ let
};
"initContainerStatuses" = mkOption {
description = "The list has one entry per init container in the manifest. The most recent successful init container will have ready = true, the most recently started container will have startTime set. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.core.v1.ContainerStatus")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ContainerStatus" "name" [ ]));
apply = attrsToList;
};
"message" = mkOption {
description = "A human readable message indicating details about why the pod is in this condition.";
@ -9017,7 +9041,7 @@ let
};
"podIPs" = mkOption {
description = "podIPs holds the IP addresses allocated to the pod. If this field is specified, the 0th entry must match the podIP field. Pods may be allocated at most 1 value for each of IPv4 and IPv6. This list is empty if no IPs have been allocated yet.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.PodIP" "ip"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.PodIP" "ip" [ ]));
apply = attrsToList;
};
"qosClass" = mkOption {
@ -9545,7 +9569,7 @@ let
};
"conditions" = mkOption {
description = "Represents the latest available observations of a replication controller's current state.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ReplicationControllerCondition" "type"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ReplicationControllerCondition" "type" [ ]));
apply = attrsToList;
};
"fullyLabeledReplicas" = mkOption {
@ -10236,7 +10260,8 @@ let
};
"imagePullSecrets" = mkOption {
description = "ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.core.v1.LocalObjectReference")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.LocalObjectReference" "name" [ ]));
apply = attrsToList;
};
"kind" = mkOption {
description = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds";
@ -10248,7 +10273,7 @@ let
};
"secrets" = mkOption {
description = "Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount. More info: https://kubernetes.io/docs/concepts/configuration/secret";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ObjectReference" "name"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ObjectReference" "name" [ ]));
apply = attrsToList;
};
};
@ -10442,7 +10467,7 @@ let
};
"ports" = mkOption {
description = "The list of ports that are exposed by this service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ServicePort" "port"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ServicePort" "name" [ "port" "protocol" ]));
apply = attrsToList;
};
"publishNotReadyAddresses" = mkOption {
@ -10496,7 +10521,7 @@ let
options = {
"conditions" = mkOption {
description = "Current service state";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.apimachinery.pkg.apis.meta.v1.Condition" "type"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.apimachinery.pkg.apis.meta.v1.Condition" "type" [ ]));
apply = attrsToList;
};
"loadBalancer" = mkOption {
@ -11192,7 +11217,8 @@ let
options = {
"forZones" = mkOption {
description = "forZones indicates the zone(s) this endpoint should be consumed by to enable topology aware routing.";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.discovery.v1.ForZone")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.discovery.v1.ForZone" "name" [ ]));
apply = attrsToList;
};
};
@ -11257,7 +11283,8 @@ let
};
"ports" = mkOption {
description = "ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates \"all ports\". Each slice may include a maximum of 100 ports.";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.discovery.v1.EndpointPort")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.discovery.v1.EndpointPort" "name" [ ]));
apply = attrsToList;
};
};
@ -11386,7 +11413,8 @@ let
options = {
"forZones" = mkOption {
description = "forZones indicates the zone(s) this endpoint should be consumed by to enable topology aware routing. May contain a maximum of 8 entries.";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.discovery.v1beta1.ForZone")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.discovery.v1beta1.ForZone" "name" [ ]));
apply = attrsToList;
};
};
@ -11451,7 +11479,8 @@ let
};
"ports" = mkOption {
description = "ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates \"all ports\". Each slice may include a maximum of 100 ports.";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.discovery.v1beta1.EndpointPort")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.discovery.v1beta1.EndpointPort" "name" [ ]));
apply = attrsToList;
};
};
@ -13808,7 +13837,7 @@ let
options = {
"conditions" = mkOption {
description = "Conditions contain conditions for PDB. The disruption controller sets the DisruptionAllowed condition. The following are known values for the reason field (additional reasons could be added in the future): - SyncFailed: The controller encountered an error and wasn't able to compute\n the number of allowed disruptions. Therefore no disruptions are\n allowed and the status of the condition will be False.\n- InsufficientPods: The number of pods are either at or below the number\n required by the PodDisruptionBudget. No disruptions are\n allowed and the status of the condition will be False.\n- SufficientPods: There are more pods than required by the PodDisruptionBudget.\n The condition will be True, and the number of allowed\n disruptions are provided by the disruptionsAllowed property.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.apimachinery.pkg.apis.meta.v1.Condition" "type"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.apimachinery.pkg.apis.meta.v1.Condition" "type" [ ]));
apply = attrsToList;
};
"currentHealthy" = mkOption {
@ -14039,7 +14068,7 @@ let
options = {
"conditions" = mkOption {
description = "Conditions contain conditions for PDB. The disruption controller sets the DisruptionAllowed condition. The following are known values for the reason field (additional reasons could be added in the future): - SyncFailed: The controller encountered an error and wasn't able to compute\n the number of allowed disruptions. Therefore no disruptions are\n allowed and the status of the condition will be False.\n- InsufficientPods: The number of pods are either at or below the number\n required by the PodDisruptionBudget. No disruptions are\n allowed and the status of the condition will be False.\n- SufficientPods: There are more pods than required by the PodDisruptionBudget.\n The condition will be True, and the number of allowed\n disruptions are provided by the disruptionsAllowed property.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.apimachinery.pkg.apis.meta.v1.Condition" "type"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.apimachinery.pkg.apis.meta.v1.Condition" "type" [ ]));
apply = attrsToList;
};
"currentHealthy" = mkOption {
@ -14144,7 +14173,8 @@ let
};
"allowedCSIDrivers" = mkOption {
description = "AllowedCSIDrivers is an allowlist of inline CSI drivers that must be explicitly set to be embedded within a pod spec. An empty value indicates that any CSI driver can be used for inline ephemeral volumes. This is a beta field, and is only honored if the API server enables the CSIInlineVolume feature gate.";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.policy.v1beta1.AllowedCSIDriver")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.policy.v1beta1.AllowedCSIDriver" "name" [ ]));
apply = attrsToList;
};
"allowedCapabilities" = mkOption {
description = "allowedCapabilities is a list of capabilities that can be requested to add to the container. Capabilities in this field may be added at the pod author's discretion. You must not list a capability in both allowedCapabilities and requiredDropCapabilities.";
@ -14428,7 +14458,8 @@ let
};
"subjects" = mkOption {
description = "Subjects holds references to the objects the role applies to.";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.rbac.v1.Subject")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.rbac.v1.Subject" "name" [ ]));
apply = attrsToList;
};
};
@ -14584,7 +14615,8 @@ let
};
"subjects" = mkOption {
description = "Subjects holds references to the objects the role applies to.";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.api.rbac.v1.Subject")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.rbac.v1.Subject" "name" [ ]));
apply = attrsToList;
};
};
@ -14971,7 +15003,7 @@ let
options = {
"drivers" = mkOption {
description = "drivers is a list of information of all CSI Drivers existing on a node. If all drivers in the list are uninstalled, this can become empty.";
type = (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.storage.v1.CSINodeDriver" "name");
type = (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.storage.v1.CSINodeDriver" "name" [ ]);
apply = attrsToList;
};
};
@ -15616,7 +15648,8 @@ let
};
"versions" = mkOption {
description = "versions is the list of all API versions of the defined custom resource. Version names are used to compute the order in which served versions are listed in API discovery. If the version string is \"kube-like\", it will sort above non \"kube-like\" version strings, which are ordered lexicographically. \"Kube-like\" versions start with a \"v\", then are followed by a number (the major version), then optionally the string \"alpha\" or \"beta\" and another number (the minor version). These are sorted first by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing major version, then minor version. An example sorted list of versions: v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.";
type = (types.listOf (submoduleOf "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionVersion"));
type = (coerceAttrsOfSubmodulesToListByKey "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionVersion" "name" [ ]);
apply = attrsToList;
};
};
@ -15657,7 +15690,8 @@ let
options = {
"additionalPrinterColumns" = mkOption {
description = "additionalPrinterColumns specifies additional columns returned in Table output. See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details. If no columns are specified, a single column displaying the age of the custom resource is used.";
type = (types.nullOr (types.listOf (submoduleOf "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceColumnDefinition")));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceColumnDefinition" "name" [ ]));
apply = attrsToList;
};
"deprecated" = mkOption {
description = "deprecated indicates this version of the custom resource API is deprecated. When set to true, API requests to this version receive a warning header in the server response. Defaults to false.";
@ -15956,7 +15990,7 @@ let
};
"x-kubernetes-validations" = mkOption {
description = "x-kubernetes-validations describes a list of validation rules written in the CEL expression language. This field is an alpha-level. Using this field requires the feature gate `CustomResourceValidationExpressions` to be enabled.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.ValidationRule" "rule"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.ValidationRule" "rule" [ ]));
apply = attrsToList;
};
};
@ -16152,7 +16186,8 @@ let
};
"groups" = mkOption {
description = "groups is a list of APIGroup.";
type = (types.listOf (submoduleOf "io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup"));
type = (coerceAttrsOfSubmodulesToListByKey "io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup" "name" [ ]);
apply = attrsToList;
};
"kind" = mkOption {
description = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds";
@ -16239,7 +16274,8 @@ let
};
"resources" = mkOption {
description = "resources contains the name of the resources and if they are namespaced.";
type = (types.listOf (submoduleOf "io.k8s.apimachinery.pkg.apis.meta.v1.APIResource"));
type = (coerceAttrsOfSubmodulesToListByKey "io.k8s.apimachinery.pkg.apis.meta.v1.APIResource" "name" [ ]);
apply = attrsToList;
};
};
@ -16548,7 +16584,7 @@ let
};
"ownerReferences" = mkOption {
description = "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference" "uid"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference" "uid" [ ]));
apply = attrsToList;
};
"resourceVersion" = mkOption {
@ -16985,7 +17021,7 @@ let
options = {
"conditions" = mkOption {
description = "Current service state of apiService.";
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.kube-aggregator.pkg.apis.apiregistration.v1.APIServiceCondition" "type"));
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.kube-aggregator.pkg.apis.apiregistration.v1.APIServiceCondition" "type" [ ]));
apply = attrsToList;
};
};