Automation for Kubernetes development and testing. Spin up production-like environments for development, testing, and CI on demand. Use the same configuration and workflows at every step of the process. Speed up your builds and test runs via shared result caching
Garden will fail on validation when a port name used in a Helm chart can't be a stringified number e.g. "5000".
Current Behavior
If port name is any stringified number, garden deploy will error:
web-service.yaml
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert -f compose-roachless.yml -f compose-roachless.override.yml -c
kompose.version: 1.27.0 (b0ed6a2c9)
creationTimestamp: null
labels:
io.kompose.service: web
name: web
spec:
ports:
- name: "5000"
port: 5000
targetPort: 5000
selector:
io.kompose.service: web
status:
loadBalancer: {}
Result of garden deploy
π Running in namespace default in environment default
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β providers β Getting status... β Cached
βΉ Run with --force-refresh to force a refresh of provider statuses.
β graph β Resolving 1 modules... β Done
β compose-roachless β Building version v-0c13045269... β Done (took 0 sec)
Failed getting status for service 'compose-roachless' (from module 'compose-roachless'). Here is the output:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Error validating getServiceStatus helm output from provider local-kubernetes: key .forwardablePorts[0][name]
with value "5000" fails to match the required pattern: /^(?![0-9]+$)(?!.*-$)(?!-)[a-z0-9-]{1,63}$/
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1 deploy action(s) failed!
Expected behavior
Garden should validate stringified numbers as correct and not error on deploy.
Bug
Garden will fail on validation when a port name used in a Helm chart can't be a stringified number e.g. "5000".
Current Behavior
If port name is any stringified number,
garden deploy
will error:web-service.yaml
Result of
garden deploy
Expected behavior
Garden should validate stringified numbers as correct and not error on deploy.
Reproducible example
Create a minimal project example then use the module and deployment/service manifests contained in this gist to deploy: https://gist.github.com/worldofgeese/be0f5b7d4907aef14aab53d8e41e65eb
Workaround
Rename port name to e.g. "http".
Suggested solution(s)
Loosen regex validation to allow for stringified numbers.
Your environment
garden version
0.12.47