carvel-dev / carvel-dev/kapp-controller

package and packagemetadata SMD and SSA are broken after k8s.io 0.36 module updates

Open
#1,855 0 comments 0 reactions 0 assignees View on GitHub
bug carvel-triage
Dominant language
Go
Stars
323
Forks
127
Avg merge
2d 16h
Merged PRs (30d)
4

Description

**What steps did you take:**

Server-side apply (`kubectl apply --server-side`) against a `Package` or `PackageMetadata` object.

```
kubectl apply --server-side --field-manager=repro -f - <<'EOF'
apiVersion: data.packaging.carvel.dev/v1alpha1
kind: PackageMetadata
metadata:
name: repro.example.com
namespace: default
spec:
displayName: "repro"
EOF
```

**What happened:**

```
Error from server: failed to create manager for existing fields: failed to convert new object
(...) to smd typed: no corresponding type for data.packaging.carvel.dev/v1alpha1, Kind=PackageMetadata
```

**What did you expect:**

`packagemetadata.data.packaging.carvel.dev/repro.example.com serverside-applied`

(SSA works as it did in v0.59.8 and prior.)

**Anything else you would like to add:**

In addition to SSA not working, kapp-controller can be seen logging `[SHOULD NOT HAPPEN] failed to update managedFields` for existing `packages` and `packagemetadatas`, with the practical effect that `.metadata.managedFields` on these objects goes stale. Structured merge diff, which SSA relies on, is no longer working for these types.

Bisected the issue to v0.60.0 (last good: v0.59.8). It's actually a side effect of the k8s.io module bumps in v0.60.0 (k8s.io/api, k8s.io/apimachinery, k8s.io/apiserver, k8s.io/client-go v0.30.1 bumped to v0.36.0): https://github.com/carvel-dev/kapp-controller/pull/1829

Types in `pkg/apiserver/apis/datapackaging/v1alpha1` do not implement the new opt-in `OpenAPIModelNamer` convention (see https://github.com/kubernetes/kubernetes/pull/131755, https://github.com/kubernetes/kube-openapi/pull/563, https://github.com/kubernetes/kube-openapi/pull/537), which is a [known source source of issues](https://github.com/kubernetes/kubernetes/issues/138247) with this k8s.io update, e.g. https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/4543 and https://github.com/karmada-io/karmada/pull/7255

More about the OpenAPI issue in this gist: https://gist.github.com/chappjc/abadce8b5abbfcfd677bd3688ad81e28#demo-the-served-openapi-document

**Environment:**

- kapp Controller version: v0.60.4
- Kubernetes version: v1.34.9

---
Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

Contributor guide

Open the contributing guide

Research direction

Start in pkg/apiserver/apis/datapackaging/v1alpha1 and read the OpenAPIModelNamer convention introduced by the k8s.io module updates. Reproduce the failure with the documented kubectl server-side apply command, then verify that Package and PackageMetadata support structured merge diff, server-side apply, and managedFields updates without errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.