context

package
v0.0.0-...-c210e35 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Copyright 2019 Kazumichi Yamamoto.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterContext

type ClusterContext struct {
	context.Context
	Cluster            *clusterv1.Cluster
	SakuraCloudCluster *v1alpha2.SakuraCloudCluster
	Client             client.Client
	Logger             logr.Logger
	Session            *session.Client
	// contains filtered or unexported fields
}

ClusterContext is a Go context used with a CAPI cluster.

func NewClusterContext

func NewClusterContext(params *ClusterContextParams) (*ClusterContext, error)

NewClusterContext returns a new ClusterContext.

func (*ClusterContext) AccessSecret

func (c *ClusterContext) AccessSecret() string

AccessSecret returns the password used to access the SakuraCloud API.

func (*ClusterContext) AccessToken

func (c *ClusterContext) AccessToken() string

AccessToken returns the username used to access the SakuraCloud API.

func (*ClusterContext) ClusterName

func (c *ClusterContext) ClusterName() string

ClusterName returns the name of the cluster.

func (*ClusterContext) GetClient

func (c *ClusterContext) GetClient() client.Client

GetClient returns the controller client.

func (*ClusterContext) GetCluster

func (c *ClusterContext) GetCluster() *clusterv1.Cluster

GetCluster returns the Cluster object.

func (*ClusterContext) GetLogger

func (c *ClusterContext) GetLogger() logr.Logger

GetLogger returns the Logger.

func (*ClusterContext) GetObject

func (c *ClusterContext) GetObject() runtime.Object

GetObject returns the Cluster object.

func (*ClusterContext) Patch

func (c *ClusterContext) Patch() error

Patch updates the object and its status on the API server.

func (*ClusterContext) SetClusterError

func (c *ClusterContext) SetClusterError(reason clusterv1errors.ClusterStatusError, msg string)

SetClusterError sets error details

func (*ClusterContext) String

func (c *ClusterContext) String() string

Strings returns ClusterNamespace/ClusterName

func (*ClusterContext) Zone

func (c *ClusterContext) Zone() string

Zone returns the name of target zone.

type ClusterContextParams

type ClusterContextParams struct {
	Context            context.Context
	Cluster            *clusterv1.Cluster
	SakuraCloudCluster *v1alpha2.SakuraCloudCluster
	Client             client.Client
	Logger             logr.Logger
}

ClusterContextParams are the parameters needed to create a ClusterContext.

type MachineContext

type MachineContext struct {
	*ClusterContext
	Machine            *clusterv1.Machine
	SakuraCloudMachine *infrav1.SakuraCloudMachine
	Session            *session.Client
	// contains filtered or unexported fields
}

MachineContext is a Go context used with a CAPI cluster.

func NewMachineContext

func NewMachineContext(params *MachineContextParams) (*MachineContext, error)

NewMachineContext returns a new MachineContext.

func NewMachineContextFromClusterContext

func NewMachineContextFromClusterContext(
	clusterCtx *ClusterContext,
	machine *clusterv1.Machine,
	sakuracloudMachine *infrav1.SakuraCloudMachine) (*MachineContext, error)

NewMachineContextFromClusterContext creates a new MachineContext using an existing CluserContext.

func (*MachineContext) GetObject

func (c *MachineContext) GetObject() runtime.Object

GetObject returns the Machine object.

func (*MachineContext) Patch

func (c *MachineContext) Patch() error

Patch updates the object and its status on the API server.

func (*MachineContext) SetMachineError

func (c *MachineContext) SetMachineError(reason clusterv1errors.MachineStatusError, msg string)

SetMachineError sets error details

func (*MachineContext) String

func (c *MachineContext) String() string

Strings returns ClusterNamespace/ClusterName/MachineName

func (*MachineContext) Zone

func (c *MachineContext) Zone() string

Zone returns the name of target zone.

type MachineContextParams

type MachineContextParams struct {
	ClusterContextParams
	Machine            *clusterv1.Machine
	SakuraCloudMachine *infrav1.SakuraCloudMachine
}

MachineContextParams are the parameters needed to create a MachineContext.

Jump to

Keyboard shortcuts

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