nodeupdater

package
v0.0.0-...-ba4eae4 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package nodeupdater ...

Package nodeupdater ...

Package nodeupdater ...

Package nodeupdater ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfRequiredLabelsPresent

func CheckIfRequiredLabelsPresent(labelMap map[string]string) bool

CheckIfRequiredLabelsPresent checks if nodes are already labeled with the required labels

func ErrorRetry

func ErrorRetry(logger *zap.Logger, funcToRetry func() (error, bool)) error

ErrorRetry ...

func GetTestLogger

func GetTestLogger(t *testing.T) (logger *zap.Logger, teardown func())

GetTestLogger ...

Types

type AccessTokenResponse

type AccessTokenResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token,omitempty"`
	TokenType    string `json:"token_type,omitempty"`
	ExpiresIn    int64  `json:"expires_in,omitempty"`
	Expiration   int64  `json:"expiration,omitempty"`
}

AccessTokenResponse ...

type Device

type Device struct {
	ID string `json:"id,omitempty"`
}

Device ...

type HReference

type HReference struct {
	Href string `json:"href,omitempty"`
}

HReference ...

type Image

type Image struct {
	ID   string `json:"id,omitempty"`
	Href string `json:"href,omitempty"`
	Name string `json:"name,omitempty"`
	CRN  string `json:"crn,omitempty"`
}

Image ...

type Instance

type Instance struct {
	Href                    string              `json:"href,omitempty"`
	ID                      string              `json:"id,omitempty"`
	Name                    string              `json:"name,omitempty"`
	Memory                  int64               `json:"memory,omitempty"`
	ResourceGroup           *ResourceGroup      `json:"resource_group,omitempty"`
	Vcpu                    *Vcpu               `json:"vcpu,omitempty"`
	Vpc                     *Vpc                `json:"vpc,omitempty"`
	CreatedAt               *time.Time          `json:"created_at,omitempty"`
	Status                  string              `json:"status,omitempty"`
	VolumeAttachments       *[]VolumeAttachment `json:"volume_attachments,omitempty"`
	NetworkInterfaces       *[]NetworkInterface `json:"network_interfaces,omitempty"`
	PrimaryNetworkInterface *NetworkInterface   `json:"primary_network_interface,omitempty"`
	BootVolumeAttachment    *VolumeAttachment   `json:"boot_volume_attachment,omitempty"`

	Zone    *Zone    `json:"zone,omitempty"`
	CRN     string   `json:"crn,omitempty"`
	Image   *Image   `json:"image,omitempty"`
	Profile *Profile `json:"profile,omitempty"`
}

Instance ...

type InstanceList

type InstanceList struct {
	First      *HReference `json:"first,omitempty"`
	Next       *HReference `json:"next,omitempty"`
	Instances  []*Instance `json:"instances"`
	Limit      int         `json:"limit,omitempty"`
	TotalCount int         `json:"total_count,omitempty"`
}

InstanceList ...

type MockVPCNodeLabelUpdater

type MockVPCNodeLabelUpdater struct {
	Node                *v1.Node
	K8sClient           *kubernetes.Clientset
	Logger              *zap.Logger
	StorageSecretConfig *StorageSecretConfig
}

MockVPCNodeLabelUpdater ...

func (*MockVPCNodeLabelUpdater) GetInstanceByIP

func (m *MockVPCNodeLabelUpdater) GetInstanceByIP(workerNodeName string) (*NodeInfo, error)

GetInstanceByIP ...

func (*MockVPCNodeLabelUpdater) GetInstanceByName

func (m *MockVPCNodeLabelUpdater) GetInstanceByName(workerNodeName string) (*NodeInfo, error)

GetInstanceByName ...

func (*MockVPCNodeLabelUpdater) GetInstancesFromVPC

func (m *MockVPCNodeLabelUpdater) GetInstancesFromVPC(riaasInstanceURL *url.URL) ([]*Instance, error)

GetInstancesFromVPC ...

func (*MockVPCNodeLabelUpdater) GetWorkerDetails

func (m *MockVPCNodeLabelUpdater) GetWorkerDetails(workerNodeName string) (*NodeInfo, error)

GetWorkerDetails ...

func (*MockVPCNodeLabelUpdater) UpdateNodeLabel

func (m *MockVPCNodeLabelUpdater) UpdateNodeLabel(ctx context.Context, workerNodeName string) (done bool, err error)

UpdateNodeLabel ...

type NetworkInterface

type NetworkInterface struct {
	ID                 string  `json:"id,omitempty"`
	Href               string  `json:"href,omitempty"`
	Name               string  `json:"name,omitempty"`
	PrimaryIpv4Address string  `json:"primary_ipv4_address,omitempty"`
	ResourceTyoe       string  `json:"resource_type,omitempty"`
	Subnet             *Subnet `json:"subnet,omitempty"`
}

NetworkInterface ...

type NodeInfo

type NodeInfo struct {
	InstanceID string
	Region     string
	Zone       string
}

NodeInfo ...

type Profile

type Profile struct {
	Name string `json:"name,omitempty"`
	Href string `json:"href,omitempty"`
}

Profile ...

type ResourceGroup

type ResourceGroup struct {
	Href string `json:"href,omitempty"`
	ID   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

ResourceGroup ...

type StorageSecretConfig

type StorageSecretConfig struct {
	RiaasEndpointURL *url.URL
	IAMAccessToken   string
}

StorageSecretConfig ...

func ReadSecretConfiguration

func ReadSecretConfiguration(k8sClient *k8s_utils.KubernetesClient, ctxLogger *zap.Logger) (*StorageSecretConfig, error)

ReadSecretConfiguration ...

type Subnet

type Subnet struct {
	ID           string `json:"id,omitempty"`
	Href         string `json:"href,omitempty"`
	Name         string `json:"name,omitempty"`
	CRN          string `json:"crn,omitempty"`
	ResourceType string `json:"resource_type,omitempty"`
}

Subnet ...

type Vcpu

type Vcpu struct {
	Architecture string `json:"architecture,omitempty"`
	Count        int64  `json:"count,omitempty"`
}

Vcpu ...

type Volume

type Volume struct {
	ID   string `json:"id,omitempty"`
	Href string `json:"href,omitempty"`
	Name string `json:"name,omitempty"`
	CRN  string `json:"crn,omitempty"`
}

Volume ...

type VolumeAttachment

type VolumeAttachment struct {
	ID     string  `json:"id,omitempty"`
	Href   string  `json:"href,omitempty"`
	Name   string  `json:"name,omitempty"`
	Volume *Volume `json:"volume,omitempty"`
	Device *Device `json:"device,omitempty"`
}

VolumeAttachment ...

type Vpc

type Vpc struct {
	ID           string `json:"id,omitempty"`
	Href         string `json:"href,omitempty"`
	Name         string `json:"name,omitempty"`
	CRN          string `json:"crn,omitempty"`
	ResourceType string `json:"resource_type,omitempty"`
}

Vpc ...

type VpcNodeLabelUpdater

type VpcNodeLabelUpdater struct {
	Node                *v1.Node
	K8sClient           kubernetes.Interface
	Logger              *zap.Logger
	StorageSecretConfig *StorageSecretConfig
}

VpcNodeLabelUpdater ...

func (*VpcNodeLabelUpdater) GetInstanceByIP

func (c *VpcNodeLabelUpdater) GetInstanceByIP(workerNodeName string) (*NodeInfo, error)

GetInstanceByIP ...

func (*VpcNodeLabelUpdater) GetInstanceByName

func (c *VpcNodeLabelUpdater) GetInstanceByName(workerNodeName string) (*NodeInfo, error)

GetInstanceByName ...

func (*VpcNodeLabelUpdater) GetInstancesFromVPC

func (c *VpcNodeLabelUpdater) GetInstancesFromVPC(riaasInstanceURL *url.URL) ([]*Instance, error)

GetInstancesFromVPC ...

func (*VpcNodeLabelUpdater) GetWorkerDetails

func (c *VpcNodeLabelUpdater) GetWorkerDetails(workerNodeName string) (*NodeInfo, error)

GetWorkerDetails ...

func (*VpcNodeLabelUpdater) UpdateNodeLabel

func (c *VpcNodeLabelUpdater) UpdateNodeLabel(ctx context.Context, workerNodeName string) (done bool, err error)

UpdateNodeLabel gets the details of the newly added node from riaas and updates the labels. Returns false and err as nil if labels not updated. else returns true

type Zone

type Zone struct {
	Name string `json:"name,omitempty"`
	Href string `json:"href,omitempty"`
}

Zone ...

Jump to

Keyboard shortcuts

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