Documentation ¶
Overview ¶
Copyright 2022 Replicated Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Replicated Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotInstaller = fmt.Errorf("object is not an installer")
)
Functions ¶
func ValidInstallerSpecProperties ¶ added in v1.2.0
func ValidInstallerSpecProperties() []string
ValidInstallerSpecProperties returns a list of properties known by the installer spec type. Eseentially everything that is marshalable to json.
Types ¶
type Linter ¶
type Linter struct {
// contains filtered or unexported fields
}
func New ¶
New returns a new v1beta1.Installer linter. this linter is capable of evaluating if a struct has all its fields properly set, rules in the "rego/" directory are used.
func (*Linter) ValidateMarshaledYAML ¶ added in v1.0.2
ValidateMarshaledYAML verifies if the provided data blob is an installer and applies the lint rules. If you have an already unmarshaled Installer instruct use Validate() instead.
type Option ¶
type Option func(*Linter)
Option is a function that sets an option in Linter object.
func WithAPIBaseURL ¶
WithAPIBaseURL sets a different api base url from where the linter attempts to load known versions for all addons. The default is "https://kurl.sh".
func WithDebug ¶ added in v1.0.7
func WithDebug() Option
WithDebug enables debug logging for the linter. debug logs are written to stdout.
func WithInfoSeverity ¶ added in v1.2.0
func WithInfoSeverity() Option
WithInfoSeverity enables info severity in the linter. By default this is disabled.
type Output ¶
type Output struct { Type string `json:"type"` Message string `json:"message"` Severity Severity `json:"severity"` Patch jsonpatch.Patch `json:"patch,omitempty"` }
Output holds the outcome of a lint pass on top of a Installer struct.
func (*Output) UnmarshalYAML ¶ added in v1.2.0
UnmarshalYAML is a helper function that unmarshals a yaml blob into an Output struct. As the Output struct contains a jsonpatch.Patch field and that field contains a property of type json.RawMessage, the default yaml unmarshaller is not able to do the job.