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

Commit

Permalink
Merge pull request #337 from Dynatrace/bugfix/preparation-0.9.0
Browse files Browse the repository at this point in the history
Preparation for v0.9.0 release
  • Loading branch information
lrgar authored Oct 23, 2020
2 parents ad445f2 + e16287f commit 965aaa3
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 45 deletions.
26 changes: 14 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
# Changelog

### Future
## v0.9

### v0.9.0

#### Features
* Control whether the init container crashes in case of download failures through the `oneagent.dynatrace.com/failure-policy: fail` annotation, off by default ([#288](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/234))
* Adaptions to the OneAgent webhook injection ([#286](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/286), [#290](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/290), [#301](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/301))
* When enabled, use image from Dynatrace environment's Docker registry to fetch OneAgent binaries.
* Disabled when a custom installer URL annotation is set, or `.spec.useImmutableImage` is false ([#306](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/306))
* A dedicated OneAgent version can be set as a property now (e.g. 1.185.1). If not set it defaults to the latest version
* Added the metrics endpoint for the webhook pod (port 8383 and 8484) ([#305](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/305))
* Fixed the metrics port for the operator pod ([#305](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/305))
* Added check if cluster and agent versions are compatible with immutable images ([#314](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/314), [#334](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/334))
* Provide Prometheus metrics for the Operator pod on port 8080, and Webhook Pod on ports 8383 and 8484 ([#305](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/305))
* Control whether the init container crashes in case of download failures through the `oneagent.dynatrace.com/failure-policy: fail` Pod annotation, off by default ([#288](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/288))
* Regardless of the annotation, if the unzip operation fails, a file `package.zip` will be included on the target directory for debugging purposes.

* Resource limits and requests for the OneAgentAPM initContainer are configurable on the `.spec.resources` field ([#332](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/332))

* Early Adopter: support full-stack OneAgent running on unprivileged mode ([#324](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/324), [#333](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/333))

#### Bug fixes
* Logged errors when API token is missing on OneAgentAPM's secret ([#298](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/298))
* Fixed printing the name of the used token secret for OneAgent instances ([311](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/311))
* Fixed printing the name of the used token secret for OneAgent instances ([311](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/311))
* Fixed setting instances metadata when auto-update is disabled ([#313](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/313))
* Fixed logging problem - [incorrect stackdriver severity on GCP](https://github.com/Dynatrace/dynatrace-oneagent-operator/issues/277) ([#318](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/318))

#### Other changes
* Added support for immutable OneAgent images - waiting for support on Dynatrace cluster ([#300](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/300), [#286](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/286), [#290](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/290), [#301](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/301))
* Added check if cluster and agent versions are compatible with immutable images ([#314](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/314), [#334](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/334))
* Immutable image mode is disabled when a custom installer URL annotation is set, or `.spec.useImmutableImage` is false ([#306](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/306))
* Pod and node metadata added for the OneAgent ([#294](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/294), [#295](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/295), [#308](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/308), [#325](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/325), [#326](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/326))
* Code cleanup to remove unused functions, variables and beautify the code ([#302](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/302))
* Sped up TravisCI duration ([#310](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/310), [#312](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/312))
* Upgrade to Go 1.15 ([#310](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/310))
* Added a resource limit and resource request for the OneAgentAPM initContainer ([#315](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/315), [#317](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/317))
* Add linter to TravisCI pipeline ([#316](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/316))
* App-only init container will log an warning when the full-stack OneAgent has been injected on it ([#323](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/323))
* Early Adopter: support full-stack OneAgent running on unprivileged mode ([#324](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/324), [#332](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/332))
* Improve error message when OneAgentAPM is missing ([#327](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/327))
* Improve descriptions on cr.yaml example ([#328](https://github.com/Dynatrace/dynatrace-oneagent-operator/pull/328))

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Depending of the version of the Dynatrace OneAgent Operator, it supports the fol

| Dynatrace OneAgent Operator version | Kubernetes | OpenShift Container Platform |
| ----------------------------------- | ---------- | ------------------------------------------ |
| master | 1.14+ | 3.11[<sup>[1]</sup>](#openshift-311), 4.1+ |
| master | 1.15+ | 3.11[<sup>[1]</sup>](#openshift-311), 4.3+ |
| v0.9.0 | 1.15+ | 3.11[<sup>[1]</sup>](#openshift-311), 4.3+ |
| v0.8.2 | 1.14+ | 3.11[<sup>[1]</sup>](#openshift-311), 4.1+ |
| v0.7.1 | 1.14+ | 3.11[<sup>[1]</sup>](#openshift-311), 4.1+ |
| v0.6.0 | 1.11+ | 3.11+ |
Expand Down
14 changes: 0 additions & 14 deletions deploy/cr-apm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,6 @@ spec:
# Either set ENVIRONMENTID to the proper tenant id or change the apiUrl as a whole, e.q. for Managed.
apiUrl: https://ENVIRONMENTID.live.dynatrace.com/api

# Optional: Custom OneAgent docker image
# In case you have the docker image for the oneagent in a custom docker registry you need to provide it here
#
image: ""

# if set the immutable image from the dynatrace environment or your custom registry will be used
# else the installer will be used
useImmutableImage: false

# Optional: The version of the oneagent to be used
# Default (if nothing set): latest
#
agentVersion: ""

# Name of secret holding `paasToken`. If unset, name of custom resource is used.
tokens: "oneagent"

Expand Down
8 changes: 1 addition & 7 deletions deploy/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ spec:
#
# image: ""

# [On development, to be released]
# Optional: if enabled, the Operator will use the immutable image from the Dynatrace environment
# or from your custom registry, otherwise an installer image is used.
#
# useImmutableImage: true

# Optional: arguments to add to the OneAgent installer.
# Available options: https://www.dynatrace.com/support/help/shortlink/linux-custom-installation
# Limitations: https://www.dynatrace.com/support/help/shortlink/oneagent-docker#limitations
Expand Down Expand Up @@ -121,7 +115,7 @@ spec:
#
# networkZone: name-of-my-network-zone

# [On development, to be released as Early Adopter]
# [Since Operator v0.9.0, Early Adopter]
# Optional: when enabled the OneAgent Pods will run as unprivileged. Disabled by default.
#
# useUnprivilegedMode: true
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 @@ -60,7 +60,7 @@ type OneAgentSpec struct {
// Work in progress
// Disables automatic injection into applications
// OneAgentAPM together with the webhook will then do the injection
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=false
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Webhook injection"
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
WebhookInjection bool `json:"webhookInjection,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/dynatrace/v1alpha1/oneagentapm_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type OneAgentAPMSpec struct {

// Optional: Custom code modules OneAgent docker image
// In case you have the docker image for the oneagent in a custom docker registry you need to provide it here
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=false
// +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.tectonicx.ui:text"
Image string `json:"image,omitempty"`
Expand Down
7 changes: 6 additions & 1 deletion pkg/controller/oneagent/oneagent_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func (r *ReconcileOneAgent) reconcileImpl(rec *reconciliation) {
return
}

if rec.instance.GetOneAgentStatus().UseImmutableImage && rec.instance.GetOneAgentSpec().CustomPullSecret == "" {
if rec.instance.GetOneAgentStatus().UseImmutableImage && rec.instance.GetOneAgentSpec().Image == "" {
err = r.reconcilePullSecret(rec.instance, rec.log)
if rec.Error(err) {
return
Expand Down Expand Up @@ -577,6 +577,11 @@ func preparePodSpecImmutableImage(p *corev1.PodSpec, instance *dynatracev1alpha1
Name: pullSecretName,
})

if instance.Spec.Image != "" {
p.Containers[0].Image = instance.Spec.Image
return nil
}

i, err := utils.BuildOneAgentImage(instance.GetSpec().APIURL, instance.GetOneAgentSpec().AgentVersion)
if err != nil {
return err
Expand Down
9 changes: 4 additions & 5 deletions pkg/controller/oneagent/oneagent_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,23 +142,22 @@ func (r *ReconcileOneAgent) findOutdatedPodsImmutableImage(logger logr.Logger, i
// If image is not yet pulled skip check
continue
}
logger.Info("pods container status", "pod", pod.Name, "container", status.Name, "image id", status.ImageID)
logger.Info("pods container status", "pod", pod.Name, "container", status.Name, "imageID", status.ImageID)

imagePullSecret := &corev1.Secret{}
pullSecretName := instance.GetName() + "-pull-secret"
if instance.GetOneAgentSpec().CustomPullSecret != "" {
pullSecretName = instance.GetOneAgentSpec().CustomPullSecret
}

err := r.client.Get(context.TODO(), client.ObjectKey{Namespace: pod.Namespace, Name: pullSecretName}, imagePullSecret)
if err != nil {
logger.Error(err, err.Error())
return nil, err
}

isLatest, err := isLatestFn(logger, status.Image, status.ImageID, imagePullSecret)
if err != nil {
logger.Info(err.Error())
//Error during image check, do nothing an continue with next status
continue
return nil, fmt.Errorf("failed to verify if Pod is outdated: %w", err)
}

if !isLatest {
Expand Down
2 changes: 1 addition & 1 deletion pkg/version/agent_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
// Pre-production, adapt accordingly once images are released
var minSupportedAgentVersion = versionInfo{
major: 1,
minor: 198,
minor: 203,
release: 0,
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/version/cluster_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

var minSupportedClusterVersion = versionInfo{
major: 1,
minor: 198,
minor: 205,
release: 0,
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/version/cluster_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func TestIsRemoteClusterVersionSupported(t *testing.T) {
logger := zap.New(zap.UseDevMode(true), zap.WriteTo(os.Stdout))

t.Run("IsRemoteClusterVersionSupported", func(t *testing.T) {
isSupported := IsRemoteClusterVersionSupported(logger, "1.203.0")
isSupported := IsRemoteClusterVersionSupported(logger, "1.205.0")
assert.True(t, isSupported)
})
t.Run("IsRemoteClusterVersionSupported unsupported version", func(t *testing.T) {
Expand Down

0 comments on commit 965aaa3

Please sign in to comment.