Drop non-preferred version and version in the schema id

This commit is contained in:
Darren Shepherd
2020-03-10 23:12:04 -07:00
parent 39ae8e9c14
commit 0ad6c2aba1
16 changed files with 292 additions and 49 deletions

View File

@@ -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) {