Add encapic ENC client #1
Reference in New Issue
Block a user
Delete Branch "benvin/initial"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The puppet-on-k8s compilers use a uv/python ENC script whose first-invocation dependency resolution fails on fresh compiler pods (observed exits 135/2), causing puppet agent catalog failures. This adds
encapic, a stdlib-only Go replacement with no runtime dependency resolution, so a fresh compiler pod can classify nodes immediately.Changes
encapic <certname>CLI: fetches the cobbler-wire ENC document from${ENCAPI_URL}/cblr/svc/op/puppet/hostname/<certname>(env override; in-cluster defaulthttp://encapi.encapi.svc.cluster.localcompiled in), reshapes it, and prints the ENC YAML.enc_role/enc_envparameters, top-levelenvironmentdropped when it equalstesting, alphabetically sorted keys.node_terminusfails safe..gitignore,.pre-commit-config.yaml, and Woodpecker pipelines (build/test/pre-commit on pull_request; release onv*tags buildingencapic_linux_amd64+ sha256).Verified live against
encapi.k8s.syd1.au.unkin.net: output matches the python script byte-for-byte forausyd1nxvm2000,ausyd1nxvm2120,prodnxsr0009, and a nonexistent node exits non-zero.