Skip to content

Commit

Permalink
Merge branch 'release-1.4' into fix/validate-only-1-rep-kspm
Browse files Browse the repository at this point in the history
  • Loading branch information
waodim authored Dec 2, 2024
2 parents 35718e1 + a3f024a commit a597eda
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 20 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/e2e-tests-ondemand.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ jobs:
- name: Notify failure in Slack
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
payload: |
message: ":x: E2E ondemand tests failed on ${{ env.branch }} branch (${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})",
run_id: "${{ github.run_id }}"
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: webhook-trigger
payload-templated: true
payload: |
"message": ":red_circle: E2E ondemand tests failed on ${{ env.branch }} branch (${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
"run_id": "${{ github.run_id }}"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN --mount=type=cache,target="/root/.cache/go-build" CGO_ENABLED=1 CGO_CFLAGS="
go build -tags "${GO_BUILD_TAGS}" -trimpath -ldflags="${GO_LINKER_ARGS}" \
-o ./build/_output/bin/dynatrace-operator ./cmd/

FROM registry.access.redhat.com/ubi9-micro:9.5-1731934928@sha256:31f00ba1d79523e182624c96e05b2f5ca66ea35d64959d84acdc8b670429415f AS base
FROM registry.access.redhat.com/ubi9-micro:9.5-1733126338@sha256:a410623c2b8e9429f9606af821be0231fef2372bd0f5f853fbe9743a0ddf7b34 AS base
FROM registry.access.redhat.com/ubi9:9.5-1732804088@sha256:1057dab827c782abcfb9bda0c3900c0966b5066e671d54976a7bcb3a2d1a5e53 AS dependency
RUN mkdir -p /tmp/rootfs-dependency
COPY --from=base / /tmp/rootfs-dependency
Expand Down
4 changes: 2 additions & 2 deletions test/features/cloudnative/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package upgrade
import (
"testing"

dynakubev1beta1 "github.com/Dynatrace/dynatrace-operator/pkg/api/v1beta1/dynakube" //nolint:staticcheck
dynakubev1beta2 "github.com/Dynatrace/dynatrace-operator/pkg/api/v1beta2/dynakube" //nolint:staticcheck
"github.com/Dynatrace/dynatrace-operator/test/features/cloudnative"
"github.com/Dynatrace/dynatrace-operator/test/helpers"
"github.com/Dynatrace/dynatrace-operator/test/helpers/components/dynakube"
Expand All @@ -31,7 +31,7 @@ func Feature(t *testing.T) features.Feature {
)
builder.Assess("create sample namespace", sampleApp.InstallNamespace())

previousVersionDynakube := &dynakubev1beta1.DynaKube{}
previousVersionDynakube := &dynakubev1beta2.DynaKube{}
previousVersionDynakube.ConvertFrom(&testDynakube)
dynakube.InstallPreviousVersion(builder, helpers.LevelAssess, &secretConfig, *previousVersionDynakube)

Expand Down
8 changes: 4 additions & 4 deletions test/helpers/components/dynakube/dynakube.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"

"github.com/Dynatrace/dynatrace-operator/pkg/api/status"
prevDynakube "github.com/Dynatrace/dynatrace-operator/pkg/api/v1beta1/dynakube" //nolint:staticcheck
prevDynakube "github.com/Dynatrace/dynatrace-operator/pkg/api/v1beta2/dynakube" //nolint:staticcheck
"github.com/Dynatrace/dynatrace-operator/pkg/api/v1beta3/dynakube"
"github.com/Dynatrace/dynatrace-operator/test/helpers/components/oneagent"
"github.com/Dynatrace/dynatrace-operator/test/helpers/tenant"
Expand Down Expand Up @@ -63,7 +63,7 @@ func CreatePreviousVersion(builder *features.FeatureBuilder, level features.Leve

func VerifyStartupPreviousVersion(builder *features.FeatureBuilder, level features.Level, prevDk prevDynakube.DynaKube) {
if prevDk.NeedsOneAgent() {
builder.WithStep("oneagent started", level, oneagent.WaitFromDaemonSetPrevDk(prevDk))
builder.WithStep("oneagent started", level, oneagent.WaitForDaemonset(prevDk.OneAgentDaemonsetName(), prevDk.Namespace))
}
builder.WithStep(
fmt.Sprintf("'%s' dynakube phase changes to 'Running'", prevDk.Name),
Expand All @@ -74,7 +74,7 @@ func VerifyStartupPreviousVersion(builder *features.FeatureBuilder, level featur
func Delete(builder *features.FeatureBuilder, level features.Level, dk dynakube.DynaKube) {
builder.WithStep("dynakube deleted", level, remove(dk))
if dk.NeedsOneAgent() {
builder.WithStep("oneagent pods stopped", level, oneagent.WaitForDaemonSetPodsDeletion(dk))
builder.WithStep("oneagent pods stopped", level, oneagent.WaitForDaemonSetPodsDeletion(dk.OneAgentDaemonsetName(), dk.Namespace))
}
if dk.ClassicFullStackMode() {
oneagent.RunClassicUninstall(builder, level, dk)
Expand All @@ -83,7 +83,7 @@ func Delete(builder *features.FeatureBuilder, level features.Level, dk dynakube.

func VerifyStartup(builder *features.FeatureBuilder, level features.Level, dk dynakube.DynaKube) {
if dk.NeedsOneAgent() {
builder.WithStep("oneagent started", level, oneagent.WaitForDaemonset(dk))
builder.WithStep("oneagent started", level, oneagent.WaitForDaemonset(dk.OneAgentDaemonsetName(), dk.Namespace))
}
builder.WithStep(
fmt.Sprintf("'%s' dynakube phase changes to 'Running'", dk.Name),
Expand Down
13 changes: 4 additions & 9 deletions test/helpers/components/oneagent/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package oneagent
import (
"context"

dynakubev1beta1 "github.com/Dynatrace/dynatrace-operator/pkg/api/v1beta1/dynakube" //nolint
dynakubev1beta3 "github.com/Dynatrace/dynatrace-operator/pkg/api/v1beta3/dynakube"
"github.com/Dynatrace/dynatrace-operator/test/helpers"
"github.com/Dynatrace/dynatrace-operator/test/helpers/kubeobjects/daemonset"
Expand All @@ -16,16 +15,12 @@ import (
"sigs.k8s.io/e2e-framework/pkg/features"
)

func WaitForDaemonset(dk dynakubev1beta3.DynaKube) features.Func {
return helpers.ToFeatureFunc(daemonset.WaitFor(dk.OneAgentDaemonsetName(), dk.Namespace), true)
func WaitForDaemonset(dsName, namespace string) features.Func {
return helpers.ToFeatureFunc(daemonset.WaitFor(dsName, namespace), true)
}

func WaitFromDaemonSetPrevDk(prevDk dynakubev1beta1.DynaKube) features.Func {
return helpers.ToFeatureFunc(daemonset.WaitFor(prevDk.OneAgentDaemonsetName(), prevDk.Namespace), true)
}

func WaitForDaemonSetPodsDeletion(dk dynakubev1beta3.DynaKube) features.Func {
return pod.WaitForPodsDeletionWithOwner(dk.OneAgentDaemonsetName(), dk.Namespace)
func WaitForDaemonSetPodsDeletion(dsName, namespace string) features.Func {
return pod.WaitForPodsDeletionWithOwner(dsName, namespace)
}

func Get(ctx context.Context, resource *resources.Resources, dk dynakubev1beta3.DynaKube) (appsv1.DaemonSet, error) {
Expand Down
2 changes: 1 addition & 1 deletion test/scenarios/release/release_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var (
cfg *envconf.Config
)

const releaseTag = "1.2.2"
const releaseTag = "1.3.2"

func TestMain(m *testing.M) {
cfg = environment.GetStandardKubeClusterEnvConfig()
Expand Down

0 comments on commit a597eda

Please sign in to comment.