From b7f233b36c0db5bc9456dcec92ee3852647578a4 Mon Sep 17 00:00:00 2001 From: Craig Jellick Date: Wed, 31 Jan 2018 19:24:16 -0700 Subject: [PATCH] limit methods on authconfig --- apis/management.cattle.io/v3/schema/schema.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apis/management.cattle.io/v3/schema/schema.go b/apis/management.cattle.io/v3/schema/schema.go index 3e0ba0fa..2e4414d1 100644 --- a/apis/management.cattle.io/v3/schema/schema.go +++ b/apis/management.cattle.io/v3/schema/schema.go @@ -1,6 +1,8 @@ package schema import ( + "net/http" + "github.com/rancher/norman/types" m "github.com/rancher/norman/types/mapper" "github.com/rancher/types/apis/cluster.cattle.io/v3/schema" @@ -176,7 +178,9 @@ func authnTypes(schemas *types.Schemas) *types.Schemas { }, } }). - MustImport(&Version, v3.AuthConfig{}). + MustImportAndCustomize(&Version, v3.AuthConfig{}, func(schema *types.Schema) { + schema.CollectionMethods = []string{http.MethodGet} + }). MustImportAndCustomize(&Version, v3.GithubConfig{}, func(schema *types.Schema) { schema.BaseType = "authConfig" schema.ResourceActions = map[string]types.Action{ @@ -189,11 +193,15 @@ func authnTypes(schemas *types.Schemas) *types.Schemas { Output: "githubConfig", }, } + schema.CollectionMethods = []string{} + schema.ResourceMethods = []string{http.MethodGet} }). MustImport(&Version, v3.GithubConfigTestInput{}). MustImport(&Version, v3.GithubConfigApplyInput{}). MustImportAndCustomize(&Version, v3.LocalConfig{}, func(schema *types.Schema) { schema.BaseType = "authConfig" + schema.CollectionMethods = []string{} + schema.ResourceMethods = []string{http.MethodGet} }) }