1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-13 13:59:40 +00:00

[release/v0.4] Add schema links and resource methods for resource verb patch (#450) (#498)

* Show patch link on the API resource when patch permission is present and add patch ResourceMethod to the schema.
This commit is contained in:
Chad Roberts
2025-02-14 12:19:15 -05:00
committed by GitHub
parent aa220d13a6
commit 504819d943
5 changed files with 30 additions and 8 deletions

View File

@@ -38,6 +38,15 @@ func TestSchemas(t *testing.T) {
errDesired: false,
},
},
{
name: "basic patch schema test",
config: schemaTestConfig{
permissionVerbs: []string{"patch"},
desiredResourceVerbs: []string{"PATCH"},
desiredCollectionVerbs: []string{},
errDesired: false,
},
},
}
for _, test := range tests {
test := test
@@ -162,7 +171,7 @@ func makeSchema(resourceType string) *types.APISchema {
"group": testGroup,
"version": testVersion,
"resource": resourceType,
"verbs": []string{"get", "list", "watch", "delete", "update", "create"},
"verbs": []string{"get", "list", "watch", "delete", "update", "create", "patch"},
},
},
}