Skip to content

Commit 039ce70

Browse files
authored
Print errors while parsing default values for a pkg (#1041)
Do not ignore errors are from `saveDefaultValuesFileOutput`.
1 parent 943bfa9 commit 039ce70

File tree

1 file changed

+5
-3
lines changed
  • cli/pkg/kctrl/cmd/package/available

1 file changed

+5
-3
lines changed

cli/pkg/kctrl/cmd/package/available/get.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ func (o *GetOptions) show(client pkgclient.Interface, pkgName, pkgVersion string
161161
}
162162

163163
if len(o.DefaultValuesFile) > 0 {
164-
o.saveDefaultValuesFileOutput(pkg)
164+
err := o.saveDefaultValuesFileOutput(pkg)
165+
if err != nil {
166+
o.ui.ErrorLinef("Default values file output: %v", err)
167+
}
165168
}
166169

167170
headers = append(headers, []uitable.Header{
@@ -291,8 +294,7 @@ func (o *GetOptions) showValuesSchema(client pkgclient.Interface, pkgName, pkgVe
291294

292295
func (o *GetOptions) saveDefaultValuesFileOutput(pkg *v1alpha1.Package) error {
293296
if len(pkg.Spec.ValuesSchema.OpenAPIv3.Raw) == 0 {
294-
o.ui.PrintLinef("Package '%s/%s' does not have any user configurable values in the '%s' namespace", pkg.Spec.RefName, pkg.Spec.Version, o.NamespaceFlags.Name)
295-
return nil
297+
return fmt.Errorf("Package '%s/%s' does not have any user configurable values in the '%s' namespace", pkg.Spec.RefName, pkg.Spec.Version, o.NamespaceFlags.Name)
296298
}
297299

298300
s := PackageSchema{pkg.Spec.ValuesSchema.OpenAPIv3.Raw}

0 commit comments

Comments
 (0)