containerized-data-importer/pkg/common/common.go
Jon Cope 785424cd8f Refactor Controller to internally setup event handlers
Make CDI selector label a global constant

Parameterize selectorlabel

Handled nil selector case

Handel NewController error in testing, use constant importer tag

Changed informer factory back to un-filtered, fixed nil ptr error

removed labels, to be handled in a separate pr

To accomodate testing, NewController takes a pre-created Informer, not a factory

Add global constant for default resync

fix makefile bug

fix bug in deployent manifest
2018-04-26 15:34:35 -05:00

32 lines
906 B
Go

package common
import "time"
// Common types and constants used by the importer and controller.
// TODO: maybe the vm cloner can use these common values
const (
CDI_VERSION = "0.4.0-alpha.0"
IMPORTER_DEFAULT_IMAGE = "docker.io/kubevirt/cdi-importer:" + CDI_VERSION
// host file constants:
IMPORTER_WRITE_DIR = "/data"
IMPORTER_WRITE_FILE = "disk.img"
IMPORTER_WRITE_PATH = IMPORTER_WRITE_DIR + "/" + IMPORTER_WRITE_FILE
// importer container constants:
IMPORTER_PODNAME = "importer"
IMPORTER_DATA_DIR = "/data"
IMPORTER_S3_HOST = "s3.amazonaws.com"
// env var names
IMPORTER_ENDPOINT = "IMPORTER_ENDPOINT"
IMPORTER_ACCESS_KEY_ID = "IMPORTER_ACCESS_KEY_ID"
IMPORTER_SECRET_KEY = "IMPORTER_SECRET_KEY"
// key names expected in credential secret
KeyAccess = "accessKeyId"
KeySecret = "secretKey"
// Shared informer resync period.
DEFAULT_RESYNC_PERIOD = 10 * time.Minute
)