MCPcopy
hub / github.com/helm/helm / Validate

Method Validate

internal/plugin/metadata_v1.go:50–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48}
49
50func (m *MetadataV1) Validate() error {
51 if !validPluginName.MatchString(m.Name) {
52 return errors.New("invalid plugin `name`")
53 }
54
55 if m.Version == "" {
56 return errors.New("plugin `version` is required")
57 }
58 if !isValidSemver(m.Version) {
59 return fmt.Errorf("invalid plugin `version` %q: must be valid semver", m.Version)
60 }
61
62 if m.APIVersion != "v1" {
63 return fmt.Errorf("invalid `apiVersion`: %q", m.APIVersion)
64 }
65
66 if m.Type == "" {
67 return errors.New("`type` missing")
68 }
69
70 if m.Runtime == "" {
71 return errors.New("`runtime` missing")
72 }
73
74 return nil
75}

Callers 1

loadMetadataV1Function · 0.95

Calls 1

isValidSemverFunction · 0.70

Tested by

no test coverage detected