upgrades

package
v1.25.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 16 Imported by: 134

Documentation

Overview

Package upgrades provides a framework for testing Kubernetes features before, during, and after different types of upgrades.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUpgradeFrameworks added in v1.21.3

func CreateUpgradeFrameworks(tests []Test) map[string]*framework.Framework

func FinalizeUpgradeTest added in v1.21.0

func FinalizeUpgradeTest(start time.Time, tc *junit.TestCase)

FinalizeUpgradeTest fills the necessary information about junit.TestCase.

func RunUpgradeSuite added in v1.21.0

func RunUpgradeSuite(
	upgCtx *UpgradeContext,
	tests []Test,
	testFrameworks map[string]*framework.Framework,
	testSuite *junit.TestSuite,
	upgradeType UpgradeType,
	upgradeFunc func(),
)

RunUpgradeSuite runs the actual upgrade tests.

Types

type Skippable

type Skippable interface {
	// Skip should return true if test should be skipped. upgCtx
	// provides information about the upgrade that is going to
	// occur.
	Skip(upgCtx UpgradeContext) bool
}

Skippable is an interface that an upgrade test can implement to be able to indicate that it should be skipped.

type Test

type Test interface {
	// Name should return a test name sans spaces.
	Name() string

	// Setup should create and verify whatever objects need to
	// exist before the upgrade disruption starts.
	Setup(f *framework.Framework)

	// Test will run during the upgrade. When the upgrade is
	// complete, done will be closed and final validation can
	// begin.
	Test(f *framework.Framework, done <-chan struct{}, upgrade UpgradeType)

	// Teardown should clean up any objects that are created that
	// aren't already cleaned up by the framework. This will
	// always be called, even if Setup failed.
	Teardown(f *framework.Framework)
}

Test is an interface for upgrade tests.

type UpgradeContext

type UpgradeContext struct {
	Versions []VersionContext
}

UpgradeContext contains information about all the stages of the upgrade that is going to occur.

type UpgradeType

type UpgradeType int

UpgradeType represents different types of upgrades.

const (
	// MasterUpgrade indicates that only the master is being upgraded.
	MasterUpgrade UpgradeType = iota

	// NodeUpgrade indicates that only the nodes are being upgraded.
	NodeUpgrade

	// ClusterUpgrade indicates that both master and nodes are
	// being upgraded.
	ClusterUpgrade

	// EtcdUpgrade indicates that only etcd is being upgraded (or migrated
	// between storage versions).
	EtcdUpgrade
)

type VersionContext

type VersionContext struct {
	Version   version.Version
	NodeImage string
}

VersionContext represents a stage of the upgrade.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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