gc

package
v2.1.98 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GCActivitiesLong = templates.LongDesc(`
		Garbage collect the Jenkins X PipelineActivity and PipelineRun resources

`)

	GCActivitiesExample = templates.Examples(`
		# garbage collect PipelineActivity and PipelineRun resources
		jx gc activities

		# dry run mode
		jx gc pa --dry-run
`)
)
View Source
var (
	GCGKELong = templates.LongDesc(`
		Garbage collect Google Container Engine resources that are not deleted when a delete cluster is performed

		This command will generate the gcloud command to run and delete external loadbalancers and persistent disks
		that are no longer in use.

`)

	GCGKEExample = templates.Examples(`
		jx garbage collect gke
		jx gc gke
`)

	ServiceAccountSuffixes = []string{"-vt", "-ko", "-tf", "-dn", "-ex", "-jb", "-st", "-tk", "-vo", "-bc", "-tekton"}
)
View Source
var (
	GCHelmLong = templates.LongDesc(`
		Garbage collect Helm ConfigMaps.  To facilitate rollbacks, Helm leaves a history of chart versions in place in Kubernetes and these should be pruned at intervals to avoid consuming excessive system resources.

`)

	GCHelmExample = templates.Examples(`
		jx garbage collect helm
		jx gc helm
`)
)
View Source
var (
	GCPodsLong = templates.LongDesc(`
		Garbage collect old Pods that have completed or failed
`)

	GCPodsExample = templates.Examples(`
		# garbage collect old pods of the default age
		jx gc pods

		# garbage collect pods older than 10 minutes
		jx gc pods -a 10m

`)
)
View Source
var (
	GCPreviewsLong = templates.LongDesc(`
		Garbage collect Jenkins X preview environments.  If a pull request is merged or closed the associated preview
		environment will be deleted.

`)

	GCPreviewsExample = templates.Examples(`
		jx garbage collect previews
		jx gc previews
`)
)
View Source
var (
	GCReleasesLong = templates.LongDesc(`
		Garbage collect the Jenkins X Activity Custom Resource Definitions

`)

	GCReleasesExample = templates.Examples(`
		jx garbage collect releases
		jx gc releases
`)
)

Functions

func ExtractConfigMap

func ExtractConfigMap(cms *v1.ConfigMapList, version string) (v1.ConfigMap, error)

ExtractConfigMap extracts a configmap

func ExtractReleases

func ExtractReleases(cms *v1.ConfigMapList) []string

ExtractReleases Extract a set of releases from a list of ConfigMaps

func ExtractVersions

func ExtractVersions(cms *v1.ConfigMapList, release string) []string

ExtractVersions Extract a set of versions of a named release from a list of ConfigMaps

func NewCmdGC

func NewCmdGC(commonOpts *opts.CommonOptions) *cobra.Command

NewCmdGC creates a command object for the generic "gc" action, which retrieves one or more resources from a server.

func NewCmdGCActivities

func NewCmdGCActivities(commonOpts *opts.CommonOptions) *cobra.Command

NewCmd s a command object for the "step" command

func NewCmdGCGKE

func NewCmdGCGKE(commonOpts *opts.CommonOptions) *cobra.Command

NewCmdGCGKE is a command object for the "step" command

func NewCmdGCHelm

func NewCmdGCHelm(commonOpts *opts.CommonOptions) *cobra.Command

NewCmdGCHelm a command object for the "garbage collect" command

func NewCmdGCPods

func NewCmdGCPods(commonOpts *opts.CommonOptions) *cobra.Command

NewCmdGCPods creates the command object

func NewCmdGCPreviews

func NewCmdGCPreviews(commonOpts *opts.CommonOptions) *cobra.Command

NewCmd s a command object for the "step" command

func NewCmdGCReleases

func NewCmdGCReleases(commonOpts *opts.CommonOptions) *cobra.Command

NewCmd s a command object for the "step" command

func VersionsToDelete

func VersionsToDelete(versions []string, desired int) []string

VersionsToDelete returns a slice of strings

Types

type ByVersion

type ByVersion []string

Components for sorting versions by numeric version number where version name ends in .vddd where ddd is an arbitrary sequence of digits

func (ByVersion) Len

func (a ByVersion) Len() int

func (ByVersion) Less

func (a ByVersion) Less(i, j int) bool

func (ByVersion) Swap

func (a ByVersion) Swap(i, j int)

type GCActivitiesOptions

type GCActivitiesOptions struct {
	*opts.CommonOptions

	DryRun                  bool
	ReleaseHistoryLimit     int
	PullRequestHistoryLimit int
	ReleaseAgeLimit         time.Duration
	PullRequestAgeLimit     time.Duration
	PipelineRunAgeLimit     time.Duration
	ProwJobAgeLimit         time.Duration
	// contains filtered or unexported fields
}

GetOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of referencing the cmd.Flags()

func (*GCActivitiesOptions) Run

func (o *GCActivitiesOptions) Run() error

Run implements this command

type GCGKEFlags

type GCGKEFlags struct {
	ProjectID string
	RunNow    bool
}

GCGKEFlags contains the flags for the command

type GCGKEOptions

type GCGKEOptions struct {
	*opts.CommonOptions
	Flags                GCGKEFlags
	RevisionHistoryLimit int
}

GCGKEOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of referencing the cmd.Flags()

func (*GCGKEOptions) Run

func (o *GCGKEOptions) Run() error

Run implements this command

type GCHelmOptions

type GCHelmOptions struct {
	*opts.CommonOptions

	RevisionHistoryLimit int
	OutDir               string
	DryRun               bool
	NoBackup             bool
}

GetOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of referencing the cmd.Flags()

func (*GCHelmOptions) Run

func (o *GCHelmOptions) Run() error

type GCOptions

type GCOptions struct {
	*opts.CommonOptions

	Output string
}

GCOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of referencing the cmd.Flags()

func (*GCOptions) Run

func (o *GCOptions) Run() error

Run implements this command

type GCPodsOptions

type GCPodsOptions struct {
	*opts.CommonOptions

	Selector  string
	Namespace string
	Age       time.Duration
}

GCPodsOptions containers the CLI options

func (*GCPodsOptions) MatchesPod

func (o *GCPodsOptions) MatchesPod(pod *corev1.Pod) (bool, time.Duration)

MatchesPod returns true if this pod can be garbage collected

func (*GCPodsOptions) Run

func (o *GCPodsOptions) Run() error

Run implements this command

type GCPreviewsOptions

type GCPreviewsOptions struct {
	*opts.CommonOptions

	DisableImport bool
	OutDir        string
}

GetOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of referencing the cmd.Flags()

func (*GCPreviewsOptions) Run

func (o *GCPreviewsOptions) Run() error

Run implements this command

type GCReleasesOptions

type GCReleasesOptions struct {
	*opts.CommonOptions

	RevisionHistoryLimit int
}

GCReleasesOptions contains the CLI options for this command

func (*GCReleasesOptions) Run

func (o *GCReleasesOptions) Run() error

Run implements this command

type Rule

type Rule struct {
	Name       string   `json:"name"`
	TargetTags []string `json:"targetTags"`
}

type Rules

type Rules struct {
	Rules []Rule
}

Jump to

Keyboard shortcuts

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