Skip to content

PodDisruptionBudget types are incorrect #675

Closed
@maxweisel

Description

@maxweisel

Describe the bug
V1beta1PodDisruptionBudgetSpec defines minAvailable and maxUnavailable as type object but the spec accepts string or number.

** Client Version **
e.g. 0.14.3

** Server Version **
e.g. 1.17.17

To Reproduce
Steps to reproduce the behavior:

Try to compile the following:

const kubeconfig = new Kubernetes.KubeConfig()
const kubernetesPolicy = kubeconfig.makeApiClient(Kubernetes.PolicyV1beta1Api)
kubernetesPolicy.createNamespacedPodDisruptionBudget({
  apiVersion: 'policy/v1beta1',
  kind: 'PodDisruptionBudget',
  metadata: {
    name: 'test',
  },
  spec: {
    minAvailable: 2,
    selector: {
      matchLabels: {
        app: 'test'
      }
    }
  }
}

Expected behavior
I'd expect the typescript compiler to allow this. However, instead it complains that minAvailable is not of type object

Environment (please complete the following information):

  • OS: Mac
  • NodeJS Version 14 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions