Repository navigation
Closed
Labels
bugSomething isn't working
Description
Hi, really nice project! Reporting a small issue I found when trying to add annotations/labels to a service.
Bug Report
When creating a Server object, I'm unable to add annotations or labels to the associated k8 service.
1. Minimal reproduce step (Required)
import manifests
import konfig.models.kube.frontend
import konfig.models.kube.frontend.container
import konfig.models.kube.frontend.service
import konfig.models.kube.frontend
import konfig.models.kube.frontend.container
import konfig.models.kube.frontend.service
temporalCodecServer: frontend.Server {
name = "test"
namespace = "test"
needNamespace = False
image = "TEST"
mainContainer = container.Main {
env.GET_HOSTS_FROM: {
value = "dns"
}
ports = [
{
containerPort = 8080
}
]
}
services = [
service.Service {
name = "serviceToAnnotate"
annotations = {
"key" = "value"
}
}
]
}
2. What did you expect to see? (Required)
something like this:
apiVersion: v1
kind: Service
metadata:
name: TEST
namespace: test
annotations:
key: "value
spec:
ports:
- port: 8080
selector:
app.kubernetes.io/name: sampleapp
3. What did you see instead (Required)
Above service without annotations
4. What is your KCL components version? (Required)
My kcl.mod file looks like this:
[package]
name = "test"
version = "0.0.1"
[dependencies]
konfig = { git = "https://github.com/kcl-lang/konfig" }
[profile]
entries = [
"main.k",
"${konfig:KCL_MOD}/models/kube/render/render.k"
]
I am using the latest version (0.10.0)
Above example is for annotations, I see the same behavior for labels.
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
Peefy commentedon Aug 30, 2026
Closing — this was fixed by #36 (commit 29910fc —
fix(render, backend, mixins): align imports and work around kcl 0.12.x evaluator quirk). The root cause was a kcl 0.12.x evaluator quirk where reads ofconfig.Xinside a dict literal that also invokedMetadataBuilder(config) | {...}resolved to Undefined, silently droppingannotationsandlabels.I just reproduced your exact example (frontend.Server with
annotations = { "key" = "value" }on a nested service.Service) against the merged main and the rendered YAML correctly includes:Thank you for the clear reproducer — it was essential for diagnosing this one. Closing in favor of the already-landed #36.