Documentation ¶
Index ¶
- func IsCommand(err error) bool
- func IsFetch(err error) bool
- func IsIO(err error) bool
- func IsInvalidConfig(err error) bool
- func IsInvalidType(err error) bool
- func IsNoResources(err error) bool
- func IsNoSchema(err error) bool
- func IsNotFound(err error) bool
- func IsOther(err error) bool
- func ValidateSchema(valuesSchema string, yamlData map[string]interface{}) (*gojsonschema.Result, error)
- type CatalogFetchResult
- type ChartVersion
- type ChartVersions
- type Config
- type IndexFile
- type Interface
- type SchemaFetchResult
- type Service
- type ValidateOptions
- type ValidationResult
- type ValidationResults
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsInvalidConfig ¶
IsInvalidConfig asserts invalidConfigError.
func ValidateSchema ¶
func ValidateSchema(valuesSchema string, yamlData map[string]interface{}) (*gojsonschema.Result, error)
Types ¶
type CatalogFetchResult ¶
type CatalogFetchResult struct {
// contains filtered or unexported fields
}
type ChartVersion ¶
type ChartVersion struct { Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` Annotations map[string]string `json:"annotations,omitempty"` URLs []string `json:"urls"` }
ChartVersion represents a chart entry in the IndexFile
type ChartVersions ¶
type ChartVersions []*ChartVersion
ChartVersions is a list of versioned chart references.
type Config ¶
type Config struct { Client k8sclient.Interface Logger micrologger.Logger }
Config represents the values that New() needs in order to create a valid app service.
type IndexFile ¶
type IndexFile struct { APIVersion string `yaml:"apiVersion"` Entries map[string]ChartVersions `yaml:"entries"` }
type Interface ¶
type Interface interface { Validate(context.Context, ValidateOptions) (ValidationResults, error) ValidateApp(context.Context, *applicationv1alpha1.App, string, map[string]interface{}) (string, *gojsonschema.Result, error) }
Interface represents the contract for the apps service. Using this instead of a regular 'struct' makes mocking the service in tests much simpler.
type SchemaFetchResult ¶
type SchemaFetchResult struct {
// contains filtered or unexported fields
}
type Service ¶
type Service struct { Client client.Client AppDataService appdata.Interface CatalogDataService catalogdata.Interface HelmbinaryService helmbinary.Interface ValuesService *values.Values CatalogFetchResults map[string]CatalogFetchResult SchemaFetchResults map[string]SchemaFetchResult }
Service represents an instance of the App service.
func (*Service) Validate ¶
func (s *Service) Validate(ctx context.Context, options ValidateOptions) (ValidationResults, error)
Validate attempts to validate the values of a deployed app (or multiple apps depending on how this command is invoked) against the schema for those values.
func (*Service) ValidateApp ¶
type ValidateOptions ¶
type ValidationResult ¶
type ValidationResult struct { App *applicationv1alpha1.App // The schema.values.json file, fetched from the // 'application.giantswarm.io/values-schema' annotation. // Or provided by the -f flag. ValuesSchema string // An array of validation errors that surfaced after validating the merged // values against the schema.values.json file. In the context of this struct, // this is the money maker. This is what we really care about, it holds the // actual validation errors (if any) that we want to show the user. ValidationErrors []gojsonschema.ResultError // Any error that occured while attempting to validate the values of this // app. This is not a validation error, this is any actual error occured // while trying to gather all the files and information required to make a // validation pass. An error here means we were not able to validate the app. Err error }
ValidationResult contains everything we need to show information about a validation attempt.
type ValidationResults ¶
type ValidationResults []*ValidationResult
ValidationResults contains multiple validation results. The printer takes this and makes a table out of it.