common

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateMachineNetworkCIDR

func CalculateMachineNetworkCIDR(apiVip string, ingressVip string, hosts []*models.Host) (string, error)

* Calculate the machine network CIDR from the one of (ApiVip, IngressVip) and the ip addresses of the hosts. * The ip addresses of the host appear with CIDR notation. Therefore, the network can be calculated from it. * The goal of this function is to find the first network that one of the vips belongs to it. * This network is returned as a result.

func GenerateError

func GenerateError(id int32, err error) *models.Error

func GenerateErrorResponder

func GenerateErrorResponder(err error) middleware.Responder

func GenerateInternalFromError

func GenerateInternalFromError(err error) *models.Error

func GetMachineCIDRHosts

func GetMachineCIDRHosts(log logrus.FieldLogger, cluster *Cluster) ([]*models.Host, error)

func IsHostInMachineNetCidr

func IsHostInMachineNetCidr(log logrus.FieldLogger, cluster *Cluster, host *models.Host) bool

func VerifyVips

func VerifyVips(machineNetworkCidr string, apiVip string, ingressVip string, mustExist bool) error

Types

type ApiErrorResponse

type ApiErrorResponse struct {
	// contains filtered or unexported fields
}

func NewApiError

func NewApiError(statusCode int32, err error) *ApiErrorResponse

func (*ApiErrorResponse) Error

func (a *ApiErrorResponse) Error() string

func (*ApiErrorResponse) StatusCode

func (a *ApiErrorResponse) StatusCode() int32

func (*ApiErrorResponse) WriteResponse

func (a *ApiErrorResponse) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

type Cluster

type Cluster struct {
	models.Cluster
	// The pull secret that obtained from the Pull Secret page on the Red Hat OpenShift Cluster Manager site.
	PullSecret string `json:"pull_secret" gorm:"type:LONGTEXT"`
}

Jump to

Keyboard shortcuts

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