From 3dd0c4166399ea7374076cf02ff36fe2b75bd265 Mon Sep 17 00:00:00 2001 From: kkkkun Date: Thu, 2 Mar 2023 09:04:28 +0000 Subject: [PATCH] support short name for flowschema and prioritylevelconfiguration --- pkg/registry/flowcontrol/flowschema/storage/storage.go | 8 ++++++++ .../prioritylevelconfiguration/storage/storage.go | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/pkg/registry/flowcontrol/flowschema/storage/storage.go b/pkg/registry/flowcontrol/flowschema/storage/storage.go index 5a1146201a6..de29f55499d 100644 --- a/pkg/registry/flowcontrol/flowschema/storage/storage.go +++ b/pkg/registry/flowcontrol/flowschema/storage/storage.go @@ -72,6 +72,14 @@ func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST, error) { return &REST{store}, &StatusREST{store: &statusStore}, nil } +// Implement ShortNamesProvider +var _ rest.ShortNamesProvider = &REST{} + +// ShortNames implements the ShortNamesProvider interface. Returns a list of short names for a resource. +func (r *REST) ShortNames() []string { + return []string{"fs"} +} + // StatusREST implements the REST endpoint for changing the status of a flow schema. type StatusREST struct { store *genericregistry.Store diff --git a/pkg/registry/flowcontrol/prioritylevelconfiguration/storage/storage.go b/pkg/registry/flowcontrol/prioritylevelconfiguration/storage/storage.go index 2149b5906f4..b5f90bbf514 100644 --- a/pkg/registry/flowcontrol/prioritylevelconfiguration/storage/storage.go +++ b/pkg/registry/flowcontrol/prioritylevelconfiguration/storage/storage.go @@ -72,6 +72,14 @@ func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST, error) { return &REST{store}, &StatusREST{store: &statusStore}, nil } +// Implement ShortNamesProvider +var _ rest.ShortNamesProvider = &REST{} + +// ShortNames implements the ShortNamesProvider interface. Returns a list of short names for a resource. +func (r *REST) ShortNames() []string { + return []string{"plc"} +} + // StatusREST implements the REST endpoint for changing the status of a priority level configuration. type StatusREST struct { store *genericregistry.Store