File tree 1 file changed +13
-1
lines changed 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -666,6 +666,16 @@ func GetKotsKindsPath(archive string) string {
666
666
// it loads the rendered kots kinds if they exist (should always be the case for app version archives created by newer kots versions).
667
667
// otherwise it loads the non-rendered kots kinds (app version archives created by older kots versions).
668
668
func LoadKotsKinds (archive string ) (* KotsKinds , error ) {
669
+ return LoadKotsKindsWithOpts (archive , LoadKotsKindsOptions {Strict : true })
670
+ }
671
+
672
+ // When strict is true, it returns an error if it fails to load any kotskinds file.
673
+ // When strict is false, kotskinds with errors will be ignored if they cannot be parsed.
674
+ type LoadKotsKindsOptions struct {
675
+ Strict bool
676
+ }
677
+
678
+ func LoadKotsKindsWithOpts (archive string , opts LoadKotsKindsOptions ) (* KotsKinds , error ) {
669
679
kotsKinds := EmptyKotsKinds ()
670
680
671
681
fromDir := GetKotsKindsPath (archive )
@@ -703,7 +713,9 @@ func LoadKotsKinds(archive string) (*KotsKinds, error) {
703
713
}
704
714
705
715
if err := kotsKinds .addKotsKinds (contents ); err != nil {
706
- return errors .Wrapf (err , "failed to add kots kinds from %s" , path )
716
+ if opts .Strict {
717
+ return errors .Wrapf (err , "failed to add kots kinds from %s" , path )
718
+ }
707
719
}
708
720
709
721
return nil
You can’t perform that action at this time.
0 commit comments