@ -38,6 +38,8 @@ By default, the output is printed in a Table but you can change this behavior
with the ' -- output ' Flag .
`
var ignoreNoRepo bool = false
func newOutdatedCmd ( cfg * action . Configuration , out io . Writer ) * cobra . Command {
client := action . NewList ( cfg )
var outfmt output . Format
@ -80,6 +82,7 @@ func newOutdatedCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
flags . BoolVar ( & client . Uninstalling , "uninstalling" , false , "show releases that are currently being uninstalled" )
flags . BoolVar ( & client . Deployed , "deployed" , false , "show deployed releases. If no other is specified, this will be automatically enabled" )
flags . BoolVar ( & client . Failed , "failed" , false , "show failed releases" )
flags . BoolVar ( & ignoreNoRepo , "ignore-repo" , false , "ignore error if no repo for a chart is found" )
flags . BoolVar ( & client . Pending , "pending" , false , "show pending releases" )
flags . BoolVarP ( & client . AllNamespaces , "all-namespaces" , "A" , false , "list releases across all namespaces" )
flags . IntVarP ( & client . Limit , "max" , "m" , 256 , "maximum number of releases to fetch" )
@ -129,8 +132,13 @@ func newOutdatedListWriter(releases []*release.Release, cfg *action.Configuratio
// search if it exists a newer Chart in the Chart-Repository
repoResult , err := searchChart ( results , r . Chart . Name ( ) , r . Chart . Metadata . Version , devel )
if err != nil {
if ! ignoreNoRepo {
fmt . Fprintf ( out , "%s" , errors . Wrap ( err , "ERROR: Could not initialize search index" ) . Error ( ) )
os . Exit ( 1 )
} else {
fmt . Fprintf ( out , "WARNING: No Repo was found which containing the Chart '%s' (skipping)\n" , r . Chart . Name ( ) )
continue
}
}
// skip if no newer Chart was found