common

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const MinMasterHostsNeededForInstallation = 3

Variables

This section is empty.

Functions

func CreateTar

func CreateTar(ctx context.Context, w io.Writer, files []string, client s3wrapper.API, continueOnError bool) error

continueOnError is set when running as stream, error is doing nothing when it happens cause we in the middle of stream and 200 was already returned

func DeleteTestDB

func DeleteTestDB(db *gorm.DB, dbName string)

func GenerateError

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

func GenerateErrorResponder

func GenerateErrorResponder(err error) middleware.Responder

func GenerateErrorResponderWithDefault

func GenerateErrorResponderWithDefault(err error, defaultCode int32) middleware.Responder

func GenerateInternalFromError

func GenerateInternalFromError(err error) *models.Error

func GetCurrentHostName

func GetCurrentHostName(host *models.Host) (string, error)

func GetEventSeverityFromHostStatus

func GetEventSeverityFromHostStatus(status string) string

func GetHostnameForMsg

func GetHostnameForMsg(host *models.Host) string

func InitializeDBTest

func InitializeDBTest()

func PrepareTestDB

func PrepareTestDB(dbName string, extrasSchemas ...interface{}) *gorm.DB

func TarAwsFiles

func TarAwsFiles(ctx context.Context, tarName string, files []string, client s3wrapper.API, log logrus.FieldLogger) error

Tar given files in s3 bucket. We open pipe for reading from aws and writing archived back to it while zipping them. It creates stream by using io.pipe

func TerminateDBTest

func TerminateDBTest()

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:TEXT"`

	// The compute hash value of the http-proxy, https-proxy and no-proxy attributes, used internally to indicate
	// if the proxy settings were changed while downloading ISO
	ProxyHash string `json:"proxy_hash"`
}

type DBContext

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

func (*DBContext) GetPort

func (c *DBContext) GetPort() string

Jump to

Keyboard shortcuts

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