mirror of
https://github.com/rancher/norman.git
synced 2025-09-23 12:09:01 +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 {
|
||||
_, err = o.objectClient.Update(metadata.GetName(), newObj)
|
||||
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 (
|
||||
"context"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -111,7 +110,7 @@ func (c *Store) AddSchemas(ctx context.Context, schemas ...*types.Schema) error
|
||||
var allSchemas []*types.Schema
|
||||
|
||||
for _, schema := range schemas {
|
||||
if schema.Store != nil || !contains(schema.CollectionMethods, http.MethodGet) {
|
||||
if schema.Store != nil || !schema.CanList() {
|
||||
continue
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user