Documentation ¶
Index ¶
- func ConvertJSONSchemaPropsWithPostProcess(in *apiext.JSONSchemaProps, out *spec.Schema, postProcess PostProcessFunc) error
- func StripUnsupportedFormatsPostProcess(s *spec.Schema) error
- type ConfigureContextFunc
- type CreateContextFunc
- type DeleteContextFunc
- type GRPCProviderServer
- func (r *GRPCProviderServer) Capabilities(ctx context.Context, req *kfplugin1.Capabilities_Request) (*kfplugin1.Capabilities_Response, error)
- func (r *GRPCProviderServer) Configure(ctx context.Context, req *kfplugin1.Configure_Request) (*kfplugin1.Configure_Response, error)
- func (r *GRPCProviderServer) CreateResource(ctx context.Context, req *kfplugin1.CreateResource_Request) (*kfplugin1.CreateResource_Response, error)
- func (r *GRPCProviderServer) DeleteResource(ctx context.Context, req *kfplugin1.DeleteResource_Request) (*kfplugin1.DeleteResource_Response, error)
- func (r *GRPCProviderServer) ListDataSource(ctx context.Context, req *kfplugin1.ListDataSource_Request) (*kfplugin1.ListDataSource_Response, error)
- func (r *GRPCProviderServer) ReadDataSource(ctx context.Context, req *kfplugin1.ReadDataSource_Request) (*kfplugin1.ReadDataSource_Response, error)
- func (r *GRPCProviderServer) ReadResource(ctx context.Context, req *kfplugin1.ReadResource_Request) (*kfplugin1.ReadResource_Response, error)
- func (r *GRPCProviderServer) StopProvider(ctx context.Context, req *kfplugin1.StopProvider_Request) (*kfplugin1.StopProvider_Response, error)
- func (r *GRPCProviderServer) UpdateResource(ctx context.Context, req *kfplugin1.UpdateResource_Request) (*kfplugin1.UpdateResource_Response, error)
- type ListContextFunc
- type PostProcessFunc
- type Provider
- type ReadContextFunc
- type Resource
- type ResourceObject
- type ResourceTimeout
- type SchemaCreateValidator
- type SchemaValidator
- type UpdateContextFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertJSONSchemaPropsWithPostProcess ¶
func ConvertJSONSchemaPropsWithPostProcess(in *apiext.JSONSchemaProps, out *spec.Schema, postProcess PostProcessFunc) error
ConvertJSONSchemaPropsWithPostProcess converts the schema from apiextensions.JSONSchemaPropos to go-openapi/spec.Schema and run a post process step on each JSONSchemaProps node. postProcess is never called for nil schemas.
func StripUnsupportedFormatsPostProcess ¶
StripUnsupportedFormatsPostProcess sets unsupported formats to empty string.
Types ¶
type ConfigureContextFunc ¶
type CreateContextFunc ¶
type CreateContextFunc func(context.Context, *ResourceObject, interface{}) ([]byte, diag.Diagnostics)
type DeleteContextFunc ¶
type DeleteContextFunc func(context.Context, *ResourceObject, interface{}) diag.Diagnostics
type GRPCProviderServer ¶
type GRPCProviderServer struct {
// contains filtered or unexported fields
}
GRPCProviderServer handles the server, or plugin side of the rpc connection.
func NewGRPCProviderServer ¶
func NewGRPCProviderServer(p *Provider) *GRPCProviderServer
func (*GRPCProviderServer) Capabilities ¶
func (r *GRPCProviderServer) Capabilities(ctx context.Context, req *kfplugin1.Capabilities_Request) (*kfplugin1.Capabilities_Response, error)
func (*GRPCProviderServer) Configure ¶
func (r *GRPCProviderServer) Configure(ctx context.Context, req *kfplugin1.Configure_Request) (*kfplugin1.Configure_Response, error)
func (*GRPCProviderServer) CreateResource ¶
func (r *GRPCProviderServer) CreateResource(ctx context.Context, req *kfplugin1.CreateResource_Request) (*kfplugin1.CreateResource_Response, error)
func (*GRPCProviderServer) DeleteResource ¶
func (r *GRPCProviderServer) DeleteResource(ctx context.Context, req *kfplugin1.DeleteResource_Request) (*kfplugin1.DeleteResource_Response, error)
func (*GRPCProviderServer) ListDataSource ¶
func (r *GRPCProviderServer) ListDataSource(ctx context.Context, req *kfplugin1.ListDataSource_Request) (*kfplugin1.ListDataSource_Response, error)
func (*GRPCProviderServer) ReadDataSource ¶
func (r *GRPCProviderServer) ReadDataSource(ctx context.Context, req *kfplugin1.ReadDataSource_Request) (*kfplugin1.ReadDataSource_Response, error)
func (*GRPCProviderServer) ReadResource ¶
func (r *GRPCProviderServer) ReadResource(ctx context.Context, req *kfplugin1.ReadResource_Request) (*kfplugin1.ReadResource_Response, error)
func (*GRPCProviderServer) StopProvider ¶
func (r *GRPCProviderServer) StopProvider(ctx context.Context, req *kfplugin1.StopProvider_Request) (*kfplugin1.StopProvider_Response, error)
func (*GRPCProviderServer) UpdateResource ¶
func (r *GRPCProviderServer) UpdateResource(ctx context.Context, req *kfplugin1.UpdateResource_Request) (*kfplugin1.UpdateResource_Response, error)
type ListContextFunc ¶
type ListContextFunc func(context.Context, *ResourceObject, interface{}) ([]byte, diag.Diagnostics)
type PostProcessFunc ¶
PostProcessFunc post-processes one node of a spec.Schema.
type Provider ¶
type ReadContextFunc ¶
type ReadContextFunc func(context.Context, *ResourceObject, interface{}) ([]byte, diag.Diagnostics)
type Resource ¶
type Resource struct { CreateContext CreateContextFunc UpdateContext UpdateContextFunc DeleteContext DeleteContextFunc ReadContext ReadContextFunc ListContext ListContextFunc Timeouts *ResourceTimeout }
type ResourceObject ¶
type ResourceObject struct { Scope kfplugin1.Scope DryRun bool Obj []byte // new resource obj in json format OldObj []byte // old resource obj in json format }
func (*ResourceObject) GetObject ¶
func (r *ResourceObject) GetObject() []byte
func (*ResourceObject) GetOldObject ¶
func (r *ResourceObject) GetOldObject() []byte
func (*ResourceObject) GetScope ¶
func (r *ResourceObject) GetScope() kfplugin1.Scope
func (*ResourceObject) IsDryRun ¶
func (r *ResourceObject) IsDryRun() bool
type ResourceTimeout ¶
type SchemaCreateValidator ¶
type SchemaValidator ¶
type SchemaValidator interface { SchemaCreateValidator ValidateUpdate(new, old interface{}) *validate.Result }
func NewSchemaValidator ¶
func NewSchemaValidator(customResourceValidation *apiext.JSONSchemaProps) (SchemaValidator, *spec.Schema, error)
NewSchemaValidator creates an openapi schema validator for the given CRD validation.
If feature `CRDValidationRatcheting` is disabled, this returns validator which validates all `Update`s and `Create`s as a `Create` - without considering old value.
If feature `CRDValidationRatcheting` is enabled - the validator returned will support ratcheting unchanged correlatable fields across an update.
type UpdateContextFunc ¶
type UpdateContextFunc func(context.Context, *ResourceObject, interface{}) ([]byte, diag.Diagnostics)