Documentation ¶
Index ¶
- Constants
- Variables
- func AddLabel(labels map[string]string, label, value string) map[string]string
- func AttachTag(ctx context.Context, client *rest.Client, tag string, vms []mo.Reference) error
- func CreateTag(ctx context.Context, client *rest.Client, tag string) (string, error)
- func GetKubeClient(t *testing.T) (*kubernetes.Clientset, error)
- func GetVMs(ctx context.Context, client *govmomi.Client, path string) ([]*object.VirtualMachine, error)
- func WaitDeploymentReady(ctx context.Context, client *kubernetes.Clientset, ...) error
- func WaitJobComplete(ctx context.Context, client *kubernetes.Clientset, namespace, job string, ...) error
- type CleanupFunc
- type Config
- type VSphereClient
Constants ¶
View Source
const ( VSphereSecretName = "preemption-worker-secret" VCSimDeploymentName = "vcsim" VCClientJobName = "tagvms" PollInterval = time.Second * 3 PollTimeout = time.Second * 30 DeployedVMs = 8 TaggedVMs = 2 // vms with preemption tag )
Variables ¶
View Source
var (
DefaultLabels = map[string]string{
"app": "vsphere-preemption",
"test": "e2e",
}
)
Functions ¶
func AddLabel ¶
AddLabel creates and returns a copy of the given labels and adds the provided label and value. If labels is nil a new map will be created.
func GetKubeClient ¶
func GetKubeClient(t *testing.T) (*kubernetes.Clientset, error)
func WaitDeploymentReady ¶
func WaitJobComplete ¶
Types ¶
type CleanupFunc ¶
func SetupEnvironment ¶
func SetupEnvironment(t *testing.T, ctx context.Context, client *kubernetes.Clientset, logger *zap.Logger) (CleanupFunc, error)
type Config ¶
type Config struct { KubeConfig string `envconfig:"KUBECONFIG"` Namespace string `default:"vsphere-preemption-e2e" required:"true"` WorkerImage string `envconfig:"WORKER_IMAGE" required:"true"` // preemption worker CLIImage string `envconfig:"CLI_IMAGE" required:"true"` // preemptctl job TagVmsImage string `envconfig:"TAG_VM_IMAGE" required:"true"` // job configures vcsim GetVMsImage string `envconfig:"GET_VM_IMAGE" required:"true"` // job reads from vcsim // Temporal settings (helm minimal install defaults) Address string `envconfig:"TEMPORAL_URL" default:"temporaltest-frontend.default.svc.cluster.local:7233" required:"true"` TNamespace string `envconfig:"TEMPORAL_NAMESPACE" default:"vsphere-preemption" required:"true"` Queue string `envconfig:"TEMPORAL_TASKQUEUE" default:"vsphere-preemption" required:"true"` // vSphere settings (vcsim defaults) Insecure string `envconfig:"VCENTER_INSECURE" default:"true"` VCAddress string `envconfig:"VCENTER_URL" default:"https://vcsim.vsphere-preemption-e2e.svc.cluster.local" required:"true"` Tag string `envconfig:"VCENTER_TAG" default:"preemptible" required:"true"` }
type VSphereClient ¶
func GetVSphereClient ¶
Click to show internal directories.
Click to hide internal directories.