core

package
v0.0.0-...-5e30e7d Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SwiftContainerName = "image-migration-dashboard"
	ScanResultPrefix   = "scan-result"
)

SwiftContainerName is the name of the Swift container where ScanResult backups are stored.

View Source
const ISODateFormat = "2006-01-02"

ISODateFormat is what it is.

Variables

This section is empty.

Functions

func GetObjectStoreAccount

func GetObjectStoreAccount() (*schwift.Account, error)

GetObjectStoreAccount logs in to an OpenStack cloud, acquires a token, and returns the relevant Swift account.

Types

type Database

type Database struct {
	RW             sync.RWMutex
	DailyResults   map[string]ScanResult // map of date (ISO format) to ScanResult
	Images         ImageReport
	LastScrapeTime time.Time
}

Database is the in-memory database that persists for the duration of the application execution. It holds the required data to render the dashboard.

func (*Database) ScanCluster

func (db *Database) ScanCluster(clientset *kubernetes.Clientset) error

ScanCluster scans a cluster for all the pods, processes the information, and saves it to the object store.

type Image

type Image struct {
	Name string `json:"name"`
	// Container names are in the form: namespace/pod/container
	Containers []string `json:"containers"`
}

Image holds the data for a specific image.

type ImageReport

type ImageReport struct {
	Keppel    []Image `json:"keppel"`
	Quay      []Image `json:"quay"`
	DockerHub []Image `json:"docker_hub"`
	Misc      []Image `json:"misc"`
}

ImageReport holds the data for all the images.

type ScanResult

type ScanResult struct {
	ScrapedAt  int64 `json:"scraped_at"` // UTC
	NoOfImages struct {
		Total  int `json:"total"`
		Keppel int `json:"keppel"`
		// Note: here Quay refers to the self-hosted Quay, not the public Quay.io
		Quay      int `json:"quay"`
		DockerHub int `json:"docker_hub"`
		Misc      int `json:"misc"`
	} `json:"no_of_images"`
}

ScanResult holds the processed data for a single cluster scan.

Jump to

Keyboard shortcuts

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