Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Prepare for RedHat marketplace release #228

Merged
merged 3 commits into from
Apr 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## Future

### Features

### Bug fixes

### Other changes
* Added environment variable 'RELATED_IMAGE_DYNATRACE_ONEAGENT' as preparation for RedHat marketplace release ([#228](hhttps://github.com/Dynatrace/dynatrace-oneagent-operator/pull/228))

## v0.7

### [v0.7.0](https://github.com/Dynatrace/dynatrace-oneagent-operator/releases/tag/v0.7.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ spec:
operator: Exists
# oneagent installer image (optional)
# certified image from Red Hat Container Catalog for use on OpenShift: registry.connect.redhat.com/dynatrace/oneagent
# defaults to docker.io/dynatrace/oneagent
# for kubernetes it defaults to docker.io/dynatrace/oneagent
image: ""
# arguments to oneagent installer (optional)
# https://www.dynatrace.com/support/help/shortlink/oneagent-docker#limitations
Expand Down
2 changes: 1 addition & 1 deletion deploy/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
operator: Exists
# oneagent installer image (optional)
# certified image from Red Hat Container Catalog for use on OpenShift: registry.connect.redhat.com/dynatrace/oneagent
# defaults to docker.io/dynatrace/oneagent
# for kubernetes it defaults to docker.io/dynatrace/oneagent
image: ""
# arguments to oneagent installer (optional)
# https://www.dynatrace.com/support/help/shortlink/oneagent-docker#limitations
Expand Down
3 changes: 2 additions & 1 deletion deploy/crds/dynatrace.com_oneagents_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ spec:
type: array
image:
description: 'Optional: the Dynatrace installer container image Defaults
to docker.io/dynatrace/oneagent:latest'
to docker.io/dynatrace/oneagent:latest for Kubernetes and to registry.connect.redhat.com/dynatrace/oneagent
for OpenShift'
type: string
labels:
additionalProperties:
Expand Down
2 changes: 2 additions & 0 deletions deploy/openshift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: RELATED_IMAGE_DYNATRACE_ONEAGENT
value: registry.connect.redhat.com/dynatrace/oneagent
ports:
- containerPort: 60000
name: metrics
Expand Down
2 changes: 2 additions & 0 deletions deploy/openshift/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: RELATED_IMAGE_DYNATRACE_ONEAGENT
value: registry.connect.redhat.com/dynatrace/oneagent
ports:
- containerPort: 60000
name: metrics
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/dynatrace/v1alpha1/oneagent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type OneAgentSpec struct {
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:number"
WaitReadySeconds *uint16 `json:"waitReadySeconds,omitempty"`
// Optional: the Dynatrace installer container image
// Defaults to docker.io/dynatrace/oneagent:latest
// Defaults to docker.io/dynatrace/oneagent:latest for Kubernetes and to registry.connect.redhat.com/dynatrace/oneagent for OpenShift
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image"
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
Expand Down
4 changes: 4 additions & 0 deletions pkg/controller/oneagent/oneagent_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"net/http"
"os"
"reflect"
"strconv"
"strings"
Expand Down Expand Up @@ -391,9 +392,12 @@ func newDaemonSetForCR(instance *dynatracev1alpha1.OneAgent) *appsv1.DaemonSet {
func newPodSpecForCR(instance *dynatracev1alpha1.OneAgent) corev1.PodSpec {
trueVar := true

envVarImg := os.Getenv("RELATED_IMAGE_DYNATRACE_ONEAGENT")
img := "docker.io/dynatrace/oneagent:latest"
if instance.Spec.Image != "" {
img = instance.Spec.Image
} else if envVarImg != "" {
img = envVarImg
}

sa := "dynatrace-oneagent"
Expand Down