mirror of
https://github.com/niusmallnan/steve.git
synced 2025-09-08 16:39:36 +00:00
Drop non-preferred version and version in the schema id
This commit is contained in:
@@ -89,20 +89,40 @@ func (p *Factory) AdminClient(ctx *types.APIRequest, s *types.APISchema, namespa
|
||||
return newClient(ctx, p.clientCfg, s, namespace, false)
|
||||
}
|
||||
|
||||
func (p *Factory) ClientForWatch(ctx *types.APIRequest, s *types.APISchema, namespace string) (dynamic.ResourceInterface, error) {
|
||||
return newClient(ctx, p.watchClientCfg, s, namespace, p.impersonate)
|
||||
}
|
||||
|
||||
func (p *Factory) AdminClientForWatch(ctx *types.APIRequest, s *types.APISchema, namespace string) (dynamic.ResourceInterface, error) {
|
||||
return newClient(ctx, p.watchClientCfg, s, namespace, false)
|
||||
}
|
||||
|
||||
func (p *Factory) TableClient(ctx *types.APIRequest, s *types.APISchema, namespace string) (dynamic.ResourceInterface, error) {
|
||||
return newClient(ctx, p.tableClientCfg, s, namespace, p.impersonate)
|
||||
if attributes.Table(s) {
|
||||
return newClient(ctx, p.tableClientCfg, s, namespace, p.impersonate)
|
||||
}
|
||||
return p.Client(ctx, s, namespace)
|
||||
}
|
||||
|
||||
func (p *Factory) TableAdminClient(ctx *types.APIRequest, s *types.APISchema, namespace string) (dynamic.ResourceInterface, error) {
|
||||
return newClient(ctx, p.tableClientCfg, s, namespace, false)
|
||||
if attributes.Table(s) {
|
||||
return newClient(ctx, p.tableClientCfg, s, namespace, false)
|
||||
}
|
||||
return p.AdminClient(ctx, s, namespace)
|
||||
}
|
||||
|
||||
func (p *Factory) TableClientForWatch(ctx *types.APIRequest, s *types.APISchema, namespace string) (dynamic.ResourceInterface, error) {
|
||||
return newClient(ctx, p.tableWatchClientCfg, s, namespace, p.impersonate)
|
||||
if attributes.Table(s) {
|
||||
return newClient(ctx, p.tableWatchClientCfg, s, namespace, p.impersonate)
|
||||
}
|
||||
return p.ClientForWatch(ctx, s, namespace)
|
||||
}
|
||||
|
||||
func (p *Factory) TableAdminClientForWatch(ctx *types.APIRequest, s *types.APISchema, namespace string) (dynamic.ResourceInterface, error) {
|
||||
return newClient(ctx, p.tableWatchClientCfg, s, namespace, false)
|
||||
if attributes.Table(s) {
|
||||
return newClient(ctx, p.tableWatchClientCfg, s, namespace, false)
|
||||
}
|
||||
return p.AdminClientForWatch(ctx, s, namespace)
|
||||
}
|
||||
|
||||
func newClient(ctx *types.APIRequest, cfg *rest.Config, s *types.APISchema, namespace string, impersonate bool) (dynamic.ResourceInterface, error) {
|
||||
|
Reference in New Issue
Block a user