mirror of
https://github.com/rancher/steve.git
synced 2025-09-18 08:20:36 +00:00
Updates Schemas watch logic.
Updated logic used to decide when and what schema events are sent during a watch.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package schema
|
||||
|
||||
//go:generate mockgen --build_flags=--mod=mod -package fake -destination fake/factory.go "github.com/rancher/steve/pkg/schema" Factory
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
@@ -9,9 +11,18 @@ import (
|
||||
"github.com/rancher/apiserver/pkg/types"
|
||||
"github.com/rancher/steve/pkg/accesscontrol"
|
||||
"github.com/rancher/steve/pkg/attributes"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apiserver/pkg/authentication/user"
|
||||
)
|
||||
|
||||
type Factory interface {
|
||||
Schemas(user user.Info) (*types.APISchemas, error)
|
||||
ByGVR(gvr schema.GroupVersionResource) string
|
||||
ByGVK(gvr schema.GroupVersionKind) string
|
||||
OnChange(ctx context.Context, cb func())
|
||||
AddTemplate(template ...Template)
|
||||
}
|
||||
|
||||
func newSchemas() (*types.APISchemas, error) {
|
||||
apiSchemas := types.EmptyAPISchemas()
|
||||
if err := apiSchemas.AddSchemas(builtin.Schemas); err != nil {
|
||||
|
Reference in New Issue
Block a user