No description
- Go 100%
The dashboard ConfigMap was registered through apix.NewCustomResource with
apiVersion "v1". The provider derives the resource type token from that
apiVersion, so it registered as kubernetes:v1:ConfigMap, and the provider's
unstructured handler rejected the core-group apiVersion before anything was
created:
kubernetes:v1:ConfigMap (traefik-grafana-dashboard):
error: apiVersion does not have both a group and a version: "v1"
Untyped/custom resources in pulumi-kubernetes are group-scoped — the
apiVersion must be "group/version" — so a core v1 ConfigMap cannot be
expressed through that path at all. Use the typed core.NewConfigMap.
The typed SDK's Data field is StringMapInput, so it cannot hold a
pulumi.Asset. The dashboard JSON is therefore read from disk at program run
time and passed as a string. The content value still lands in Pulumi state
(not merely a hash), so edits to dashboards/traefik-official-k8s.json still
surface as a diff on preview. Same approach as nix-cache/main.go, which
loads server.toml into a ConfigMap the same way.
No state churn: the previous registration never cleared provider check, so
no ConfigMap resource exists in the stack. This is a plain create.
|
||
|---|---|---|
| dashboards | ||
| .gitignore | ||
| dashboard-cert.yaml | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| Pulumi.yaml | ||
| traefik-config.yaml | ||