Skip to content

podMetadata feature no longer functional #3041

Closed

Description

@coderanger

What happened?

All edits to the podMetadata field of a Prometheus object are discarded by kube-apiserver.

Did you expect to see something different?

Data should be stored by kube-apiserver.

How to reproduce it (as minimally and precisely as possible):

Try to set a label or annotation using podMetadata.

Environment

  • Prometheus Operator version: 0.36.0

  • Kubernetes version information: 1.17.2

  • Kubernetes cluster kind: kops

  • Manifests:

podMetadata:
  labels:
    foo: bar
  • Prometheus Operator Logs: N/A (data never makes it that far.

Anything else we need to know?:

This was caused by a mix of #2855 where controller-tools didn't recurse into the ObjectMeta struct so it was changed in the generated CRD to be just a plain type: object with no fields. And then #2903 which disabled saving unknown fields so any data set on podMetadata will be discarded by apiserver since it has no declared fields. The same issue might be affecting other fields, I didn't do a check of the full diff from #2855.

Getting controller-tools to recurse outside of the current package is an old bug, we've run into it on our operators a few times, but hopefully an upgrade there would fix it? If not, I'm sure Solly could assist.

Activity

  1. pgier commented on Feb 25, 2020

    @pgier
    Contributor

    I tried updating to the latest version of controller-tools (v0.2.5) but it seems this is still an issue (kubernetes-sigs/controller-tools#385). There is a possible fix available (kubernetes-sigs/controller-tools#395), so a local patch might be an option until it's fixed in controller-tools master.

  2. pgier commented on Feb 25, 2020

    @pgier
    Contributor

    I created #3043 to test out the upstream patch. @coderanger can you give that one a try to see if it fixes the issue?

  3. added 2 commits that reference this issue on Feb 27, 2020
    76a5f8a
    9d2d9e7
  4. added 6 commits that reference this issue on May 8, 2020
    483b80b
    d160946
    83c6dc5
    b1127d2
    020ee69
    3fa50cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions