mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Merge pull request #49624 from guangxuli/fix_daemonset_resource_type
Automatic merge from submit-queue (batch tested with PRs 50306, 49624) Add daemonset to all categories **What this PR does / why we need it**: We could get daemonset resource by running command `kubectl get all`. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # fix https://github.com/kubernetes/kubernetes/issues/49620
This commit is contained in:
commit
4dc4c3c4a4
@ -746,12 +746,12 @@ func TestDiscoveryReplaceAliases(t *testing.T) {
|
||||
{
|
||||
name: "all-replacement",
|
||||
arg: "all",
|
||||
expected: "pods,replicationcontrollers,services,statefulsets.apps,horizontalpodautoscalers.autoscaling,jobs.batch,cronjobs.batch,deployments.extensions,replicasets.extensions",
|
||||
expected: "pods,replicationcontrollers,services,statefulsets.apps,horizontalpodautoscalers.autoscaling,jobs.batch,cronjobs.batch,daemonsets.extensions,deployments.extensions,replicasets.extensions",
|
||||
},
|
||||
{
|
||||
name: "alias-in-comma-separated-arg",
|
||||
arg: "all,secrets",
|
||||
expected: "pods,replicationcontrollers,services,statefulsets.apps,horizontalpodautoscalers.autoscaling,jobs.batch,cronjobs.batch,deployments.extensions,replicasets.extensions,secrets",
|
||||
expected: "pods,replicationcontrollers,services,statefulsets.apps,horizontalpodautoscalers.autoscaling,jobs.batch,cronjobs.batch,daemonsets.extensions,deployments.extensions,replicasets.extensions,secrets",
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -118,6 +118,7 @@ var legacyUserResources = []schema.GroupResource{
|
||||
{Group: "autoscaling", Resource: "horizontalpodautoscalers"},
|
||||
{Group: "batch", Resource: "jobs"},
|
||||
{Group: "batch", Resource: "cronjobs"},
|
||||
{Group: "extensions", Resource: "daemonsets"},
|
||||
{Group: "extensions", Resource: "deployments"},
|
||||
{Group: "extensions", Resource: "replicasets"},
|
||||
}
|
||||
|
@ -47,6 +47,7 @@ func TestCategoryExpansion(t *testing.T) {
|
||||
{Resource: "horizontalpodautoscalers", Group: "autoscaling"},
|
||||
{Resource: "jobs", Group: "batch"},
|
||||
{Resource: "cronjobs", Group: "batch"},
|
||||
{Resource: "daemonsets", Group: "extensions"},
|
||||
{Resource: "deployments", Group: "extensions"},
|
||||
{Resource: "replicasets", Group: "extensions"},
|
||||
},
|
||||
|
@ -66,6 +66,13 @@ func (r *REST) ShortNames() []string {
|
||||
return []string{"ds"}
|
||||
}
|
||||
|
||||
var _ rest.CategoriesProvider = &REST{}
|
||||
|
||||
// Categories implements the CategoriesProvider interface. Returns a list of categories a resource is part of.
|
||||
func (r *REST) Categories() []string {
|
||||
return []string{"all"}
|
||||
}
|
||||
|
||||
// StatusREST implements the REST endpoint for changing the status of a daemonset
|
||||
type StatusREST struct {
|
||||
store *genericregistry.Store
|
||||
|
Loading…
Reference in New Issue
Block a user