Line
|
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ContainerPort" "name" [ "containerPort" "protocol" ])); |
requires that
protocol key be present in all helm generated Pod specifications. For example the following kubenix resource definition
resources.pods.hello.spec = {
containers = [
{
name = "hello";
image = "hello";
ports = [
{containerPort = 1234;}
];
}
];
};
fails with the following error
error: attribute 'protocol' missing
at /nix/store/jznzhivlpsahv83fsvkp866bda50nd23-source/modules/generated/v1.27.nix:82:28:
81| (key:
82| if isAttrs value.${key}
| ^
83| then toString value.${key}.content
It should not fail when protocol is missing from the ports.
There are certainly other similar issues with e.g. EphemeralContainer which need to be addressed as well.
Workaround
Currently I have just deleted the "protocol" from
|
type = (types.nullOr (coerceAttrsOfSubmodulesToListByKey "io.k8s.api.core.v1.ContainerPort" "name" [ "containerPort" "protocol" ])); |
and everything is working smoothly.
Backstory
I ran into this issue while trying to deploy prometheus as a Helm chart. After a bit of debugging I noticed that the prometheus chart doesn't specify the port protocol: https://github.com/prometheus-community/helm-charts/blob/d628ebad62f119ef2985319a5f7a1dd5bee1863b/charts/prometheus/templates/deploy.yaml#L157
Line
kubenix/modules/generated/v1.27.nix
Line 5190 in e4d0365
protocolkey be present in all helm generated Pod specifications. For example the following kubenix resource definitionfails with the following error
It should not fail when
protocolis missing from the ports.There are certainly other similar issues with e.g.
EphemeralContainerwhich need to be addressed as well.Workaround
Currently I have just deleted the
"protocol"fromkubenix/modules/generated/v1.27.nix
Line 5190 in e4d0365
Backstory
I ran into this issue while trying to deploy prometheus as a Helm chart. After a bit of debugging I noticed that the prometheus chart doesn't specify the port protocol: https://github.com/prometheus-community/helm-charts/blob/d628ebad62f119ef2985319a5f7a1dd5bee1863b/charts/prometheus/templates/deploy.yaml#L157