Skip to content

Document /logs API for API server #38870

Open
@RichardoC

Description

@RichardoC

What happened?

While experimenting with the following command, I spotted an API that's not documented in the API one pager, which doesn't conform to the schema I would expect (it's HTML, not JSON)

$ kubectl  get --raw / | grep logs
    "/logs",

$ kubectl  get --raw /logs
<pre>
<a href="acpid.log">acpid.log</a>
<a href="buildkitd.log">buildkitd.log</a>
<a href="cloud-init-output.log">cloud-init-output.log</a>
<a href="containerd.log">containerd.log</a>
<a href="containers/">containers/</a>
<a href="dmesg">dmesg</a>
<a href="lima-init.log">lima-init.log</a>
<a href="messages">messages</a>
<a href="openresty/">openresty/</a>
<a href="pods/">pods/</a>
<a href="rancher-desktop-guestagent.log">rancher-desktop-guestagent.log</a>
<a href="wtmp">wtmp</a>
</pre>

This should be documented, and preferably be json to conform to the other APIs exposed.

What did you expect to happen?

This API would be documented, especially since it's serving up all files from a specific file path and the API should present some sort of json list rather than a webpage.

How can we reproduce it (as minimally and precisely as possible)?

$ kubectl  get --raw / | grep logs
    "/logs",

$ kubectl  get --raw /logs
...

Anything else we need to know?

This is the root cause of rancher-sandbox/docs.rancherdesktop.io#136 and k3s-io/k3s#6709 as I didn't expect an undocumented file server API from kubernetes.

Kubernetes version

$ kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.4", GitCommit:"95ee5ab382d64cfe6c28967f36b53970b8374491", GitTreeState:"clean", BuildDate:"2022-08-17T18:54:23Z", GoVersion:"go1.18.5", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.8+k3s1", GitCommit:"648004e4faeaf9e8705386342e95ec9bd211c2b8", GitTreeState:"clean", BuildDate:"2022-11-18T18:29:47Z", GoVersion:"go1.18.8", Compiler:"gc", Platform:"linux/amd64"}

Cloud provider

$ rdctl version rdctl client version: 1.1.0, targeting server version: v0 Rancher Desktop version 1.7.0 on Ubuntu 22.04.1 x64

OS version

Ubuntu 22.04.1

Install tools

No response

Container runtime (CRI) and version (if applicable)

No response

Related plugins (CNI, CSI, ...) and versions (if applicable)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.language/enIssues or PRs related to English languagepriority/backlogHigher priority than priority/awaiting-more-evidence.sig/api-machineryCategorizes an issue or PR as relevant to SIG API Machinery.sig/docsCategorizes an issue or PR as relevant to SIG Docs.sig/securityCategorizes an issue or PR as relevant to SIG Security.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