Description
When set-namespace:latest is invoked without a namespace value (empty data.namespace in ConfigMap), the function exits with code 0 and reports [PASS], but simultaneously emits an error-severity result:
[RUNNING] "ghcr.io/kptdev/krm-functions-catalog/set-namespace:latest"
[PASS] "ghcr.io/kptdev/krm-functions-catalog/set-namespace:latest" in 0s
[Results]: [error] v1/ConfigMap/function-input: `data.namespace` should not be empty
Previous behaviour (v0.2.0):
[FAIL] "ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0"
error: failed to configure function: input namespace cannot be empty
Exit code: 1
Steps to reproduce
cd $(mktemp -d)
cat > resources.yaml <<EOF
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
EOF
kpt fn eval -i ghcr.io/kptdev/krm-functions-catalog/set-namespace:latest
echo "Exit code: $?"
# Outputs: Exit code: 0
Expected behaviour
The function should exit with code 1 and report [FAIL] when configuration is invalid. Config validation errors should be fatal, not informational.
Description
When
set-namespace:latestis invoked without a namespace value (emptydata.namespacein ConfigMap), the function exits with code 0 and reports [PASS], but simultaneously emits an error-severity result:Previous behaviour (v0.2.0):
[FAIL] "ghcr.io/kptdev/krm-functions-catalog/set-namespace:v0.2.0" error: failed to configure function: input namespace cannot be empty Exit code: 1Steps to reproduce
Expected behaviour
The function should exit with code 1 and report [FAIL] when configuration is invalid. Config validation errors should be fatal, not informational.