mirror of
https://github.com/niusmallnan/steve.git
synced 2025-08-28 17:51:57 +00:00
Don't put an update link if update is not allowed
This commit is contained in:
parent
a8ce2f5ec8
commit
f86e19a301
@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/rancher/steve/pkg/stores/proxy"
|
"github.com/rancher/steve/pkg/stores/proxy"
|
||||||
"github.com/rancher/steve/pkg/summarycache"
|
"github.com/rancher/steve/pkg/summarycache"
|
||||||
"github.com/rancher/wrangler/pkg/data"
|
"github.com/rancher/wrangler/pkg/data"
|
||||||
|
"github.com/rancher/wrangler/pkg/slice"
|
||||||
"github.com/rancher/wrangler/pkg/summary"
|
"github.com/rancher/wrangler/pkg/summary"
|
||||||
"k8s.io/apimachinery/pkg/api/meta"
|
"k8s.io/apimachinery/pkg/api/meta"
|
||||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||||
@ -38,7 +39,7 @@ func formatter(summarycache *summarycache.SummaryCache) types.Formatter {
|
|||||||
u := request.URLBuilder.RelativeToRoot(selfLink)
|
u := request.URLBuilder.RelativeToRoot(selfLink)
|
||||||
resource.Links["view"] = u
|
resource.Links["view"] = u
|
||||||
|
|
||||||
if _, ok := resource.Links["update"]; !ok {
|
if _, ok := resource.Links["update"]; !ok && slice.ContainsString(resource.Schema.CollectionMethods, "PUT") {
|
||||||
resource.Links["update"] = u
|
resource.Links["update"] = u
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user