carvel-dev / carvel-dev/kapp

kapp does not validate resources before sending to k8s api (e.g. extra unknown keys)

Open
#98 5 comments 1 reaction 0 assignees View on GitHub
discussion
Dominant language
Go
Stars
1.1k
Forks
134
PR merge metrics
No merged PRs in 30d

Description

# Problem
When deploying with kapp, additional json keys that are not part of a K8s object's spec are automatically removed without errors or warnings.
This is a problem because erroneously specified k8s objects are not detected.
Example:
```yaml
apiVersion: v1
kind: ConfigMap
annotations: # should be inside 'metadata'-block
wrong: "ignored"
metadata:
name: "test-config"
data:
key: "value"
```

This is an actual problem that is continuously occurring with cf-for-k8s, e.g.
https://github.com/cloudfoundry/cf-for-k8s/issues/102
and
https://github.com/cloudfoundry/metric-proxy/pull/2.

# Expected behaviour

Kapp should not silently remove keys from an object's spec. Kapp should return an error from the k8s API server instead.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue's ConfigMap YAML example and tracing kapp's resource submission path to the Kubernetes API. Done means an unknown top-level key is rejected with an error instead of being silently removed, with coverage for the reported behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
cli, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.