scan

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckReleaseExpired

func CheckReleaseExpired(r release.Release) (bool, error)

CheckReleaseExpired will return true if the release should be deleted. Safely returns false for any errors that occur.

func NameList

func NameList(r []*release.Release) []string

NameList loops through the releases and returns a []string of the Release[*].Name values

func RunV2

func RunV2(sr InputRun)

func ValidateScanArg

func ValidateScanArg(args []string) (bool, error)

ValidateScanArgs returns true when we have inputs

Types

type Annotations

type Annotations struct {
	Expiry string `json:"janitor/expires,omitempty"`
	Ttl    string `json:"janitor/ttl,omitempty"`
}

Annotations

type InputRun

type InputRun interface {
	Init()
	Makeawscfg() aws.Config
	Getekscluster(aws.Config, client.Generator) client.EKSCluster
	Config() janitorconfig.EnvConfig
	Getreleases(client.EKSCluster, *action.Configuration, internalhelm.HelmList) []*release.Release
	Deleterelease(client.EKSCluster, *action.Configuration, *release.Release, internalhelm.HelmDelete) error
	Makeekscfg() client.Generator // Experimental. Using this to mock...
}

type ScanClient

type ScanClient struct {
	Selector          string
	Namespace         string
	AllNamespaces     bool
	IncludeNamespaces string
	ExcludeNamespaces string
	Env               janitorconfig.EnvConfig
	Dryrun            bool
	Context           context.Context
}

func NewScanClient

func NewScanClient() *ScanClient

func (*ScanClient) Config

func (sc *ScanClient) Config() janitorconfig.EnvConfig

Config - return it!

func (*ScanClient) Deleterelease

Deleterelease will try and delete a release

func (*ScanClient) Getekscluster

func (sc *ScanClient) Getekscluster(c aws.Config, g client.Generator) client.EKSCluster

Getekscluster - Return the cluster, endpoints and auth token!

func (*ScanClient) Getreleases

Getreleases will return the array of helm releases

func (*ScanClient) Init

func (sc *ScanClient) Init()

Init - initialise!

func (*ScanClient) Makeawscfg

func (sc *ScanClient) Makeawscfg() aws.Config

Makeawscfg - creates the cfg object

func (*ScanClient) Makeekscfg

func (sc *ScanClient) Makeekscfg() client.Generator

Loose - experimental...

Jump to

Keyboard shortcuts

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