Fix(addon): correct metadata.yaml filename in addon validation errors (#7224)

The addon package validator reported the required manifest as
`matadata.yaml` in two of its error messages, telling addon authors
to fix a file that does not exist. The correct filename is
`metadata.yaml` (see the MetadataFileName constant and the sibling
error on the missing-manifest branch, which already spell it right).

Correct the two misspelled literals in validateAddonPackage and update
the matching assertions in TestCheckAddonPackageValid, which already
exercises the empty-name and empty-version branches.

Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
This commit is contained in:
Anas Khan
2026-07-23 04:59:41 +05:30
committed by GitHub
parent afd2f4f5d0
commit 39183d5ba3
2 changed files with 4 additions and 4 deletions

View File

@@ -531,10 +531,10 @@ func validateAddonPackage(addonPkg *InstallPackage) error {
return fmt.Errorf("the addon package doesn't have `metadata.yaml`")
}
if addonPkg.Name == "" {
return fmt.Errorf("`matadata.yaml` must define the name of addon")
return fmt.Errorf("`metadata.yaml` must define the name of addon")
}
if addonPkg.Version == "" {
return fmt.Errorf("`matadata.yaml` must define the version of addon")
return fmt.Errorf("`metadata.yaml` must define the version of addon")
}
return nil
}

View File

@@ -468,10 +468,10 @@ func TestCheckAddonPackageValid(t *testing.T) {
err: fmt.Errorf("the addon package doesn't have `metadata.yaml`"),
}, {
testCase: Meta{Version: "v1.4.0"},
err: fmt.Errorf("`matadata.yaml` must define the name of addon"),
err: fmt.Errorf("`metadata.yaml` must define the name of addon"),
}, {
testCase: Meta{Name: "test-addon"},
err: fmt.Errorf("`matadata.yaml` must define the version of addon"),
err: fmt.Errorf("`metadata.yaml` must define the version of addon"),
}, {
testCase: Meta{Name: "test-addon", Version: "1.4.5"},
err: nil,