Documentation ¶
Index ¶
- Variables
- func Decode(r io.Reader, filename, requireKind string, isReleaseBuild bool) (model.ValidatorUpgrader, string, error)
- func DecodeValidateUpgrade(ctx context.Context, r io.Reader, filename, requireKind string) (model.ValidatorUpgrader, error)
- func LatestSupportedAPIVersion(isReleaseBuild bool) string
Constants ¶
This section is empty.
Variables ¶
var ( KindTemplate = "Template" // the value of the "kind" field in a spec.yaml file KindGoldenTest = "GoldenTest" // ... a test.yaml file KindManifest = "Manifest" // ... a manifest.yaml file )
Functions ¶
func Decode ¶
func Decode(r io.Reader, filename, requireKind string, isReleaseBuild bool) (model.ValidatorUpgrader, string, error)
Decode parses the given YAML contents of r into a struct and returns it. The given filename is used only for error messages. The type of struct to return is determined by the "kind" field in the YAML. If the given requireKind is non-empty, then we'll also validate that the "kind" of the YAML file matches requireKind, and return error if not. This also calls Validate() on the returned struct and returns error if invalid.
func DecodeValidateUpgrade ¶
func DecodeValidateUpgrade(ctx context.Context, r io.Reader, filename, requireKind string) (model.ValidatorUpgrader, error)
DecodeValidateUpgrade parses the given YAML contents of r into a struct, then repeatedly calls Upgrade() and Validate() on it until it's the newest version, then returns it. requireKind has the same meaning as in Decode().
func LatestSupportedAPIVersion ¶ added in v0.6.0
LatestSupportedAPIVersion is the most up-to-date API version. It's in the format "cli.abcxyz.dev/v1beta4".
isReleaseBuild is the value of version.IsReleaseBuild(), but for testing purposes we make it an argument rather than hardcoding.
Types ¶
This section is empty.