type Filter struct { // Namespace is the namespace to apply to the inputs Namespace string `yaml:"namespace,omitempty"` // FsSlice contains the FieldSpecs to locate the namespace field FsSlice types.FsSlice `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"` // UnsetOnly means only blank namespace fields will be set UnsetOnly bool `json:"unsetOnly" yaml:"unsetOnly"` // SetRoleBindingSubjects determines which subject fields in RoleBinding and ClusterRoleBinding // objects will have their namespace fields set. Overrides field specs provided for these types, if any. // - defaultOnly (default): namespace will be set only on subjects named "default". // - allServiceAccounts: namespace will be set on all subjects with "kind: ServiceAccount" // - none: all subjects will be skipped. SetRoleBindingSubjects RoleBindingSubjectMode `json:"setRoleBindingSubjects" yaml:"setRoleBindingSubjects"` // contains filtered or unexported fields }
▹ Example
func (ns Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error)
func (ns *Filter) WithMutationTracker(callback func(key, value, tag string, node *yaml.RNode))
WithMutationTracker registers a callback which will be invoked each time a field is mutated
type RoleBindingSubjectMode string
const ( DefaultSubjectsOnly RoleBindingSubjectMode = "defaultOnly" SubjectModeUnspecified RoleBindingSubjectMode = "" AllServiceAccountSubjects RoleBindingSubjectMode = "allServiceAccounts" NoSubjects RoleBindingSubjectMode = "none" )