Skip to content

Commit

Permalink
Remove shortnames from Tap API resources
Browse files Browse the repository at this point in the history
The Tap API resource shortnames were colliding with existing Kubernetes
resources (e.g. `po`, `deploy`, etc), causing warnings from kubectl
v1.29.0+.

Remove the shortnames from the Tap APIService handlers.

Fixes #11784

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
  • Loading branch information
siggy committed Dec 22, 2023
1 parent eec914a commit 66d73b0
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions viz/tap/api/handlers.go
Expand Up @@ -55,19 +55,18 @@ var (

resources = []struct {
name string
shortname string
namespaced bool
}{
{"namespaces", "ns", false},
{"pods", "po", true},
{"replicationcontrollers", "rc", true},
{"services", "svc", true},
{"daemonsets", "ds", true},
{"deployments", "deploy", true},
{"replicasets", "rs", true},
{"statefulsets", "sts", true},
{"jobs", "", true},
{"cronjobs", "cj", true},
{"namespaces", false},
{"pods", true},
{"replicationcontrollers", true},
{"services", true},
{"daemonsets", true},
{"deployments", true},
{"replicasets", true},
{"statefulsets", true},
{"jobs", true},
{"cronjobs", true},
}
)

Expand Down Expand Up @@ -257,7 +256,6 @@ func handleAPIResourceList(w http.ResponseWriter, _ *http.Request, _ httprouter.
resList.APIResources = append(resList.APIResources,
metav1.APIResource{
Name: res.name,
ShortNames: []string{res.shortname},
Namespaced: res.namespaced,
Kind: gvk.Kind,
Verbs: metav1.Verbs{"watch"},
Expand Down

0 comments on commit 66d73b0

Please sign in to comment.