app

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SanitizeKind is the kind for SanitizeKind resources.
	SanitizeKind = "Sanitize"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Replacement

type Replacement struct {
	Find    string `yaml:"find,omitempty"`
	Replace string `yaml:"replace,omitempty"`
	// Glob expression used to match files
	FileGlob string `yaml:"fileGlob,omitempty"`
}

Replacement is a string to match and replace.

type Sanitize

type Sanitize struct {
	APIVersion string            `yaml:"apiVersion" yamltags:"required"`
	Kind       string            `yaml:"kind" yamltags:"required"`
	Metadata   v1alpha1.Metadata `yaml:"metadata,omitempty"`

	// List of directories and files to remove.
	Remove []string `yaml:"remove,omitempty"`

	// UnsafeRegex is a list of regular expressions matching strings that shouldn't be allowed in the open
	// sourced files.
	UnsafeRegex []string `yaml:"unsafeRegex,omitempty"`

	// Replacement is a list of regexes to find and replace
	Replacements []Replacement `yaml:"replacements,omitempty"`
}

Sanitize describes a bunch of transformations to be applied to prepare a directory for open source.

type Sanitizer

type Sanitizer struct {
	// contains filtered or unexported fields
}

Sanitizer is used to prepare code for open source.

func New

func New(config Sanitize, log logr.Logger) (*Sanitizer, error)

New creates a new Sanitizer

func (*Sanitizer) Run

func (s *Sanitizer) Run(source string, dest string) error

Run sanitizes the provided directory

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL