utils

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DynatracePaasToken = "paasToken"
	DynatraceApiToken  = "apiToken"
)
View Source
const VersionLabel = "com.dynatrace.build-version"

VersionLabel is the name of the label used on ActiveGate-provided images.

Variables

This section is empty.

Functions

func BuildDynatraceClient

func BuildDynatraceClient(rtc client.Client, instance dynatracev1alpha1.BaseOneAgent, hasAPIToken, hasPaaSToken bool) (dtclient.Client, error)

BuildDynatraceClient creates a new Dynatrace client using the settings configured on the given instance.

func BuildOneAgentAPMImage

func BuildOneAgentAPMImage(apiURL string, flavor string, technologies string, agentVersion string) (string, error)

BuildOneAgentAPMImage builds the docker image for the agentapm based on the api url If annotations are set (flavor or technologies) they get appended

func BuildOneAgentImage

func BuildOneAgentImage(apiURL string, agentVersion string) (string, error)

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 GeneratePullSecretData

func GeneratePullSecretData(c client.Client, oa dynatracev1alpha1.BaseOneAgent, tkns *corev1.Secret) (map[string][]byte, error)

GeneratePullSecretData generates the secret data for the PullSecret

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 GetImageRegistryFromAPIURL

func GetImageRegistryFromAPIURL(apiURL string) (string, error)

func GetTokensName

func GetTokensName(obj dynatracev1alpha1.BaseOneAgent) string

func MakeSystemContext

func MakeSystemContext(dockerReference reference.Named, dockerConfig *DockerConfig) *types.SystemContext

MakeSystemContext returns a SystemConfig for the given image and Dockerconfig.

func SetUseImmutableImageStatus

func SetUseImmutableImageStatus(instance dynatracev1alpha1.BaseOneAgent) 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 DynatraceClientFunc

type DynatraceClientFunc func(rtc client.Client, instance dynatracev1alpha1.BaseOneAgent, hasAPIToken, hasPaaSToken bool) (dtclient.Client, error)

DynatraceClientFunc defines handler func for dynatrace client

func StaticDynatraceClient

func StaticDynatraceClient(c dtclient.Client) DynatraceClientFunc

StaticDynatraceClient creates a DynatraceClientFunc always returning c.

type DynatraceClientReconciler

type DynatraceClientReconciler struct {
	Client              client.Client
	DynatraceClientFunc DynatraceClientFunc
	Now                 metav1.Time
	UpdatePaaSToken     bool
	UpdateAPIToken      bool
}

func (*DynatraceClientReconciler) Reconcile

type ImageVersion

type ImageVersion struct {
	Version string
	Hash    string
}

ImageVersion includes information for a given image. Version can be empty if the corresponding label isn't set.

func GetImageVersion

func GetImageVersion(imageName string, dockerConfig *DockerConfig) (ImageVersion, error)

GetImageVersion fetches image information for imageName

type ImageVersionProvider

type ImageVersionProvider func(img string, dockerConfig *DockerConfig) (ImageVersion, error)

ImageVersionProvider can fetch image information from img

Jump to

Keyboard shortcuts

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