client

package
v0.0.0-...-9b3dd14 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LIVE_POLICY string = "policy-backup-live-image"
View Source
var NAMESPACE = "open-cluster-management"
View Source
var RELEASE_POLICY string = "policy-backup-release-image"
View Source
var RETRY_PERIOD_SECONDS = 10
View Source
var TIMEOUT_MINUTES = 15

Functions

func RandomString

func RandomString(n int) string

Types

type BackupImageSpoke

type BackupImageSpoke struct {
	SpokeName             string
	PolicyName            string
	ImageBinaryImageName  string
	ImageURL              string
	RecoveryPartitionPath string
	RandomId              string
}

type Client

type Client struct {
	KubeconfigPath        string
	Spoke                 string
	BinaryImage           string
	BackupPath            string
	KubernetesClient      dynamic.Interface
	CurrentLiveVersion    string
	CurrentReleaseVersion string
}

func New

func New(KubeconfigPath string, Spoke string, BinaryImage string, BackupPath string) (Client, error)

func (Client) CreatePlacementBinding

func (c Client) CreatePlacementBinding(PlacementBindingName string, PlacementRuleName string) error

create a generic placement binding

func (Client) CreatePlacementRule

func (c Client) CreatePlacementRule() error

creates a global placement rule for spoke

func (Client) GetImageFromImageSet

func (c Client) GetImageFromImageSet(name string) (string, error)

function to query an imageset and return the image

func (Client) GetReleaseImage

func (c Client) GetReleaseImage() (string, error)

function to retrieve a Release Image of a given cluster

func (Client) GetRootFSUrl

func (c Client) GetRootFSUrl() (string, error)

function to retrieve the openshift version and retrieve rootfs

func (Client) GetRootFsFromVersion

func (c Client) GetRootFsFromVersion(version string) (string, error)

given a version, retrieves the matching rootfs

func (Client) LaunchLiveImageBackup

func (c Client) LaunchLiveImageBackup(liveImg string) error

launch the backup for the spoke cluster, for the specific image

func (Client) LaunchReleaseImageBackup

func (c Client) LaunchReleaseImageBackup(releaseImg string) error

launch the backup for the spoke cluster, for the specific release image

func (*Client) MonitorPolicies

func (c *Client) MonitorPolicies() bool

checks status of policies and deletes if completed

func (Client) NoPoliciesExist

func (c Client) NoPoliciesExist() bool

checks if the expected policies are already removed

func (Client) RemovePreviousResources

func (c Client) RemovePreviousResources() error

removes all previously created resources

func (Client) SpokeClusterExists

func (c Client) SpokeClusterExists() bool

func (Client) WaitForCompletion

func (c Client) WaitForCompletion() error

waits until policies are completed, and clean resources

type PlacementBinding

type PlacementBinding struct {
	PlacementName string
	PolicyName    string
}

Jump to

Keyboard shortcuts

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