From ceb9dc42ba52ae9804fed4806a330fdca98b6f98 Mon Sep 17 00:00:00 2001 From: Rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Thu, 9 Jun 2022 15:44:44 +0800 Subject: [PATCH] Skip to report the status when the phase was done (#97) --- .github/workflows/build.yaml | 3 +++ controllers/status_controller.go | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9c9dad6..228d4cc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,6 +4,9 @@ on: push: branches: - master + pull_request: + branches: + - master jobs: build: diff --git a/controllers/status_controller.go b/controllers/status_controller.go index 036db3d..4b1bd34 100644 --- a/controllers/status_controller.go +++ b/controllers/status_controller.go @@ -59,6 +59,11 @@ func (c *StatusController) Reconcile(ctx context.Context, req ctrl.Request) (res return } + // do not report the status when the phase was done + if releaser.Spec.Phase == devopsv1alpha1.PhaseDone { + return + } + // only take care of those have errors failedConditions := getFailedConditions(releaser.Status.Conditions) if len(failedConditions) == 0 {