Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidSchemaVersion = errors.New("invalid schema version")
ErrInvalidSchemaVersion is used when the schemaVersion of two resources do not match exactly.
Functions ¶
func ValidateSchemaVersion ¶
func ValidateSchemaVersion(strategy CheckStrategy, supported *semver.Constraints, specified string, defaultVersion *semver.Version) (bool, error)
ValidateSchemaVersion checks the specified schema version against the supported version, returning if the result is a warning only. Warnings are returned when the versions are not an exact match. A warning is not returned when CheckStrategyNone is used.
Types ¶
type CheckStrategy ¶
type CheckStrategy string
CheckStrategy is an enum of values for handling schemaVersion comparisons of two resources. Allowed values are: CheckStrategyExact, CheckStrategyMinor, CheckStrategyMajor, CheckStrategyNone.
const ( // CheckStrategyExact requires that resource schemaVersion values exactly match the supported schema version. CheckStrategyExact CheckStrategy = "exact" // CheckStrategyMinor requires that resource schemaVersion values match the MAJOR.MINOR portion of the supported schema version. CheckStrategyMinor CheckStrategy = "minor" // CheckStrategyMajor requires that resource schemaVersion values exactly match the MAJOR portion of the supported schema version. CheckStrategyMajor CheckStrategy = "major" // CheckStrategyNone ignores the resource schemaVersion. Errors will most likely ensue but have fun! CheckStrategyNone CheckStrategy = "none" )
Click to show internal directories.
Click to hide internal directories.