cleaner

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// JSONPatchRules is a map with the paths to files in the archive to apply RFC6902 JSON patches.
	JSONPatchRules = map[string]*PatchRule{
		"resources/cluster/machineconfiguration.openshift.io_v1_controllerconfigs.json": &PatchRule{
			JSONPatch: ptr.To[string](`[
					{
						"op": "replace",
						"path": "/items/0/spec/internalRegistryPullSecret",
						"value": "REDACTED"
					}
				]`,
			),
		},
	}

	// RemoveFilePatternRules is a map with regular expressions to remove files in the result archive.
	RemoveFilePatternRules = map[string]*PatchRule{
		"packages.operators.coreos.com_v1_packagemanifests.json": &PatchRule{
			RegexPattern: regexp.MustCompile("resources/ns/.*/packages.operators.coreos.com_v1_packagemanifests.json"),

			KeepCount: 1,
			Count:     0,
		},
	}
)

Functions

func ScanPatchTarGzipReaderFor

func ScanPatchTarGzipReaderFor(r io.Reader) (resp io.Reader, size int, err error)

ScanPatchTarGzipReaderFor scans and patches the artifact stream, returning the cleaned artifact.

Types

type PatchRule added in v0.6.0

type PatchRule struct {
	JSONPatch    *string
	RegexPattern *regexp.Regexp
	KeepCount    uint64
	Count        uint64
}

Jump to

Keyboard shortcuts

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