1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-01 07:27:46 +00:00

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

@@ -1,6 +1,8 @@
package attributes
import (
"fmt"
"github.com/rancher/steve/pkg/schemaserver/types"
"github.com/rancher/wrangler/pkg/data/convert"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -75,6 +77,14 @@ func SetGVK(s *types.APISchema, gvk schema.GroupVersionKind) {
SetKind(s, gvk.Kind)
}
func Table(s *types.APISchema) bool {
return str(s, "table") != "false"
}
func SetTable(s *types.APISchema, value bool) {
setVal(s, "table", fmt.Sprint(value))
}
func GVR(s *types.APISchema) schema.GroupVersionResource {
return schema.GroupVersionResource{
Group: Group(s),