8000 Getting empty resource list with RemoveSelfLink=true causes API to return items: null · Issue #98022 · kubernetes/kubernetes · GitHub
[go: up one dir, main page]

Skip to content
Getting empty resource list with RemoveSelfLink=true causes API to return items: null #98022
Closed
@gryf

Description

@gryf

What happened:

On Kubernetes 1.18 and 1.19, with passed --feature-gates=RemoveSelfLink=true parameter, result for query the API for a list of non-existent resources gives null as an items value:

$ curl http://localhost:8080/api/v1/pods
{
  "kind": "PodList",
  "apiVersion": "v1",
  "metadata": {
    "resourceVersion": "266"
  },
  "items": null
}

What you expected to happen:

It should return "items": [] like:

$ curl http://localhost:8080/api/v1/pods
{
  "kind": "PodList",
  "apiVersion": "v1",
  "metadata": {
    "resourceVersion": "266"
  },
  "items": []
}

similar to version 1.20.
Documentation says, that for PodList type, items must be an array[1], which API convention[2] specify that ”Any kind that has the "items" field must be a list kind.” There is no null mentioned as a possible value.

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

The only difference is the --feature-gates=RemoveSelfLink=true parameter - without it everything works as expected.

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version): 1.19.6, 1.18.0
  • Cloud provider or hardware configuration: n/a
  • OS (e.g: cat /etc/os-release): Ubuntu 18.04 LTS
  • Kernel (e.g. uname -a): 4.15.0-88
  • Install tools: manual
  • Network plugin and version (if this is a network-related bug): n/a
  • Others: n/a

[1] https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#podlist-v1-core
[2] https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#types-kinds

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.sig/api-machineryCategorizes an issue or PR as relevant to SIG API Machinery.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0