// SetAll applies the set filter for all yaml nodes and only returns the nodes whose
// corresponding file has at least one node with input setter
SetAll applies the set filter for all yaml nodes and only returns the nodes whose
corresponding file has at least one node with input setter
// SetAll applies the set filter for all yaml nodes and only returns the nodes whose // corresponding file has at least one node with input setter
func SetAll(s *Set) kio.Filter {
	return kio.FilterFunc(func(nodes []*yaml.RNode) ([]*yaml.RNode, error) {
		filesToUpdate := sets.String{}
		for i := range nodes {
			preCount := s.Count
			_, err := s.Filter(nodes[i])
			if err != nil {
				return nil, errors.Wrap(err)
			}
			if s.Count > preCount {
				path, _, err := kioutil.GetFileAnnotations(nodes[i])
				if err != nil {
					return nil, errors.Wrap(err)
				}
				filesToUpdate.Insert(path)
			}
		}
		var nodesInUpdatedFiles []*yaml.RNode
		for i := range nodes {
			path, _, err := kioutil.GetFileAnnotations(nodes[i])
			if err != nil {
				return nil, errors.Wrap(err)
			}
			if filesToUpdate.Has(path) {
				nodesInUpdatedFiles = append(nodesInUpdatedFiles, nodes[i])
			}
		}
		return nodesInUpdatedFiles, nil
	})
}
func SetAll ( s * Set ) kio . Filter { return kio . FilterFunc ( func ( nodes [ ] * yaml . RNode ) ( [ ] * yaml . RNode , error ) { filesToUpdate := sets . String { } for i := range nodes { preCount := s . Count _ , err := s . Filter ( nodes [ i ] ) if err != nil { return nil , errors . Wrap ( err ) } if s . Count > preCount { path , _ , err := kioutil . GetFileAnnotations ( nodes [ i ] ) if err != nil { return nil , errors . Wrap ( err ) } filesToUpdate . Insert ( path ) } } var nodesInUpdatedFiles [ ] * yaml . RNode for i := range nodes { path , _ , err := kioutil . GetFileAnnotations ( nodes [ i ] ) if err != nil { return nil , errors . Wrap ( err ) } if filesToUpdate . Has ( path ) { nodesInUpdatedFiles = append ( nodesInUpdatedFiles , nodes [ i ] ) } } return nodesInUpdatedFiles , nil } ) }
SetAll applies the set filter for all yaml nodes and only returns the nodes whose
corresponding file has at least one node with input setter
SetAll applies the set filter for all yaml nodes and only returns the nodes whose corresponding file has at least one node with input setter
// for each node record the set fields count before and after filter is applied and // store the corresponding file paths if there is an increment in setters count // return only the nodes whose corresponding file has at least one node with input setter