utils

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DynatracePaasToken = "paasToken"
	DynatraceApiToken  = "apiToken"
)

Variables

This section is empty.

Functions

func CheckIfOneAgentAPMExists

func CheckIfOneAgentAPMExists(cfg *rest.Config) (bool, error)

CheckIfOneAgentAPMExists checks if a OneAgentAPM object exists

func CreateOrUpdateSecretIfNotExists

func CreateOrUpdateSecretIfNotExists(c client.Client, r client.Reader, secretName string, targetNS string, data map[string][]byte, secretType corev1.SecretType, log logr.Logger) error

CreateOrUpdateSecretIfNotExists creates a secret in case it does not exist or updates it if there are changes

func ExtractToken

func ExtractToken(secret *corev1.Secret, key string) (string, error)

func GetDeployment

func GetDeployment(c client.Client, ns string) (*appsv1.Deployment, error)

GetDeployment returns the Deployment object who is the owner of this pod.

func GetField

func GetField(values map[string]string, key, defaultValue string) string

func GetTokensName

func GetTokensName(obj *dynatracev1alpha1.DynaKube) string

func SetUseImmutableImageStatus

func SetUseImmutableImageStatus(instance *dynatracev1alpha1.DynaKube, fs *dynatracev1alpha1.FullStackSpec) bool

SetUseImmutableImageStatus updates the status' UseImmutableImage field to indicate whether the Operator should use immutable images or not.

Types

type DockerConfig

type DockerConfig struct {
	Auths map[string]struct {
		Username string
		Password string
	}
}

func NewDockerConfig

func NewDockerConfig(secret *corev1.Secret) (*DockerConfig, error)

type Reconciliation

type Reconciliation struct {
	Log      logr.Logger
	Instance *dynatracev1alpha1.DynaKube
	Now      metav1.Time

	// If update is true, then changes on instance will be sent to the Kubernetes API.
	//
	// Additionally, if err is not nil, then the Reconciliation will fail with its value. Unless it's a Too Many
	// Requests HTTP error from the Dynatrace API, on which case, a reconciliation is requeued after one minute delay.
	//
	// If err is nil, then a reconciliation is requeued after requeueAfter.
	Err          error
	Updated      bool
	RequeueAfter time.Duration
}

func NewReconciliation

func NewReconciliation(log logr.Logger, dk *dynatracev1alpha1.DynaKube) *Reconciliation

func (*Reconciliation) Error

func (rec *Reconciliation) Error(err error) bool

func (*Reconciliation) IsOutdated

func (rec *Reconciliation) IsOutdated(last *metav1.Time, threshold time.Duration) bool

func (*Reconciliation) Update

func (rec *Reconciliation) Update(upd bool, d time.Duration, cause string) bool

type Tokens

type Tokens struct {
	ApiToken  string
	PaasToken string
}

func NewTokens

func NewTokens(secret *corev1.Secret) (*Tokens, error)

Jump to

Keyboard shortcuts

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