mirror of
https://github.com/rancher/norman.git
synced 2025-09-23 20:18:51 +00:00
Use helper method
This commit is contained in:
@@ -125,10 +125,8 @@ func (o *objectLifecycleAdapter) create(metadata metav1.Object, obj runtime.Obje
|
|||||||
} else if newObj != nil {
|
} else if newObj != nil {
|
||||||
_, err = o.objectClient.Update(metadata.GetName(), newObj)
|
_, err = o.objectClient.Update(metadata.GetName(), newObj)
|
||||||
return false, err
|
return false, err
|
||||||
} else {
|
|
||||||
_, err = o.objectClient.Update(metadata.GetName(), obj)
|
|
||||||
return false, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false, nil
|
_, err = o.objectClient.Update(metadata.GetName(), obj)
|
||||||
|
return false, err
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,6 @@ package crd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -111,7 +110,7 @@ func (c *Store) AddSchemas(ctx context.Context, schemas ...*types.Schema) error
|
|||||||
var allSchemas []*types.Schema
|
var allSchemas []*types.Schema
|
||||||
|
|
||||||
for _, schema := range schemas {
|
for _, schema := range schemas {
|
||||||
if schema.Store != nil || !contains(schema.CollectionMethods, http.MethodGet) {
|
if schema.Store != nil || !schema.CanList() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user