utils

package
v0.0.0-...-0979d6c Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: GPL-3.0 Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultImage = "sonarqube"
)

Variables

This section is empty.

Functions

func ClearConditions

func ClearConditions(conditions status.Conditions) status.Conditions

func ContainsString

func ContainsString(s []string, e string) bool

func CreateResourceIfNotFound

func CreateResourceIfNotFound(client client.Client, object, output runtime.Object) error

func GenVersion

func GenVersion(spec interface{}, secret []byte) (string, error)

func GetDeploymentCondition

func GetDeploymentCondition(deployment *appsv1.Deployment, condition appsv1.DeploymentConditionType) corev1.ConditionStatus

func GetImage

func GetImage(edition, version *string) string

func GetProperties

func GetProperties(s *corev1.Secret, f string) (*properties.Properties, error)

func IsOwner

func IsOwner(owner, child metav1.Object) bool

func ParseErrorForReconcileResult

func ParseErrorForReconcileResult(client client.Client, object interface{}, err error) (reconcile.Result, error)

func ServicePorts

func ServicePorts(serverType sonarsourcev1alpha1.ServerType) []corev1.ServicePort

func UpdateResource

func UpdateResource(client client.Writer, object runtime.Object, reason ErrorType, message string) error

func UpdateStatus

func UpdateStatus(client client.Client, newObject interface{}, object interface{})

func VerifyService

func VerifyService(client client.Client, service1, service2 *corev1.Service) error

Types

type Error

type Error struct {
	Reason  ErrorType
	Message string
}

func (*Error) Error

func (r *Error) Error() string

func (*Error) Type

func (r *Error) Type() ErrorType

type ErrorType

type ErrorType string
const (
	ErrorReasonSpecUpdate       ErrorType = "SpecUpdate"
	ErrorReasonSpecInvalid      ErrorType = "SpecInvalid"
	ErrorReasonResourceCreate   ErrorType = "ResourceCreate"
	ErrorReasonResourceUpdate   ErrorType = "ResourceUpdate"
	ErrorReasonResourceWaiting  ErrorType = "ResourceWaiting"
	ErrorReasonResourceInvalid  ErrorType = "ResourceInvalid"
	ErrorReasonResourceShutdown ErrorType = "ResourceShutdown"
	ErrorReasonServerWaiting    ErrorType = "ServerWaiting"
	ErrorReasonServerDown       ErrorType = "ServerDown"
	ErrorReasonUnknown          ErrorType = "Unknown"
)

func ReasonForError

func ReasonForError(err error) ErrorType

ReasonForError returns the HTTP status for a particular error.

type SQError

type SQError interface {
	Type() ErrorType
}

type SecretMapper

type SecretMapper struct {
	Annotation string
}

func (*SecretMapper) Map

type Status

type Status interface {
	DeepCopy()
}

Jump to

Keyboard shortcuts

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