Skip to content

kubectl debug compatibility with pre-1.22 ephemeral containers API #102008

Closed
@verb

Description

What would you like to be added:

#101034 changed the Kind used with the /ephemeralcontainers subresource from EphemeralContainers to Pod. This change will break old clients. (The ephemeral containers API is still in alpha, so this is acceptable.)

Currently, compatibility is broken in both directions:

  1. kubectl versions prior to 1.22 are incompatible with server version 1.22
  2. kubectl version 1.22 is incompatible with server versions prior to 1.22

Remediating the first requires complex server-side backwards compatibility logic which is not worth implementing for an alpha API.

Remediating the second for kubectl debug should be much easier. The EphemeralContainer struct hasn't changed, only the path in the object. We could detect the kind returned by the server and change the path used in the JSON patch (or even just naively try the previous path if the server returns an error).

This behavior would be removed after the old server version falls out of the support window.

Why is this needed:

This isn't strictly needed, but it would improve UX for what I expect is a common scenario: using the latest kubectl with older servers.

/sig cli
/priority important-soon

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.sig/cliCategorizes an issue or PR as relevant to SIG CLI.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions