validators

package
v0.0.0-...-b9bb202 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrorLogTracingPermission is a specific error to indicate that trace
	// level logging cannot be enabled within model config because the user
	// requesting the change does not have adequate permission.
	ErrorLogTracingPermission = errors.ConstError("permission denied setting log level to tracing")
)

Variables

This section is empty.

Functions

func AgentVersionChange

func AgentVersionChange() config.ValidatorFunc

AgentVersionChange returns a config validator that will check to make sure the agent version does not change and also remove it from config so that it does not get committed back to state.

Agent version is an ongoing value that is being actively removed from model config. Until we can finish removing all uses of agent version from model config this validator will keep removing it from the new config so that it does not get persisted to state.

func CharmhubURLChange

func CharmhubURLChange() config.ValidatorFunc

CharmhubURLChange returns a config validator that will check to make sure the charm hub url has not changed.

func ContainerNetworkingMethodChange

func ContainerNetworkingMethodChange() config.ValidatorFunc

ContainerNetworkingMethodChange checks to see if there has been any change to a model config's container networking method.

func ContainerNetworkingMethodValue

func ContainerNetworkingMethodValue() config.ValidatorFunc

ContainerNetworkingMethodValue checks that the container networking method supplied to model config is a valid value.

func LoggingTracePermissionChecker

func LoggingTracePermissionChecker(canTrace bool) config.ValidatorFunc

LoggingTracePermissionChecker checks the logging config for both validity and the existence of trace level debugging. If the logging config contains trace level logging and the canTrace is set to false we error with an error that satisfies both ErrorLogTracingPermission and config.ValidationError.

func SpaceChecker

func SpaceChecker(provider SpaceProvider) config.ValidatorFunc

SpaceChecker will validate a model config's space to see if it exists within this Juju controller. Should the space not exist an error satisfying config.ValidationError will be returned.

Types

type SpaceProvider

type SpaceProvider interface {
	// HasSpace checks if the supplied space exists within the controller. If
	// during the course of checking for space existence false and an error will
	// be returned.
	HasSpace(context.Context, string) (bool, error)
}

SpaceProvider is responsible for checking if a given space exists.

Jump to

Keyboard shortcuts

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