verifier

package
v0.36.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOutputVerifier added in v0.19.4

func NewOutputVerifier(
	ctx context.Context,
	discClient discovery.DiscoveryInterface,
	options map[schema.GroupVersionKind]ServerVerifyOption,
) *outputVerifier

func NewVerifier

func NewVerifier(
	ctx context.Context,
	options map[schema.GroupVersionKind]ServerVerifyOption,
) *verifier

NewVerifier returns a new verifier

Types

type ClearableCache added in v0.22.24

type ClearableCache interface {
	ResetCache(ctx context.Context)
}

type Factory added in v0.22.24

type Factory interface {
	// NewOutputResourceVerifier returns a new output verifier with the given options
	NewOutputResourceVerifier(
		ctx context.Context,
		discoveryClient discovery.DiscoveryInterface,
		options map[schema.GroupVersionKind]ServerVerifyOption,
	) OutputResourceVerifier
	// NewServerResourceVerifier returns a new server verifier with the given options
	NewServerResourceVerifier(
		ctx context.Context,
		options map[schema.GroupVersionKind]ServerVerifyOption,
	) ServerResourceVerifier
	// ResetAllCaches invalidates the caches of each verifier created by this factory
	ResetAllCaches(
		ctx context.Context,
	)
}

func NewVerifierFactory added in v0.22.24

func NewVerifierFactory() Factory

type OutputResourceVerifier added in v0.19.4

type OutputResourceVerifier interface {
	ClearableCache
	// VerifyServerResource verifies whether the API server for the given rest.Config supports the resource with the given GVK.
	// For the "local/management" cluster, set cluster to ""
	// Note that once a resource has been verified, the result will be cached for subsequent calls.
	// Returns true if the resource is registered, false otherwise.
	// an error will be returned if the ErrorIfNotPresent option is selected for the given GVK
	VerifyServerResource(cluster string, gvk schema.GroupVersionKind) (bool, error)
}

ServerResourceVerifier verifies whether a given cluster server supports a given resource.

type ServerResourceVerifier

type ServerResourceVerifier interface {
	ClearableCache
	// VerifyServerResource verifies whether the API server for the given rest.Config supports the resource with the given GVK.
	// For the "local/management" cluster, set cluster to ""
	// Note that once a resource has been verified, the result will be cached for subsequent calls.
	// Returns true if the resource is registered, false otherwise.
	// an error will be returned if the ErrorIfNotPresent option is selected for the given GVK
	VerifyServerResource(cluster string, cfg *rest.Config, gvk schema.GroupVersionKind) (bool, error)
}

ServerResourceVerifier verifies whether a given cluster server supports a given resource.

type ServerVerifyOption

type ServerVerifyOption int

ServerVerifyOption is used to specify one of several options on whether and how to verify the resource's availabiltiy on the API server

const (
	// skip verifying whether a resource is  for a kind before reading it from the API server
	ServerVerifyOption_SkipVerify ServerVerifyOption = iota

	// return an error if the resource does not exist for a kind before reading it from the API server
	ServerVerifyOption_ErrorIfNotPresent

	// log a warning (and continue) if the resource does not exist for a kind before reading it from the API server
	// the reconcile loop will not be started if the server resource is not supported.
	ServerVerifyOption_WarnIfNotPresent

	// write a debug log (and continue) if the resource does not exist for a kind before reading it from the API server
	// the reconcile loop will not be started if the server resource is not supported.
	ServerVerifyOption_LogDebugIfNotPresent

	// ignore error (and continue) if the resource does not exist for a kind before reading it from the API server.
	// the reconcile loop will not be started if the server resource is not supported.
	ServerVerifyOption_IgnoreIfNotPresent
)

Directories

Path Synopsis
Package mock_discovery is a generated GoMock package.
Package mock_discovery is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL