Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set deployment status to inactive on missing status #731

Merged
merged 9 commits into from
Sep 22, 2022
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
2 changes: 2 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ jobs:
DEPLOYMENT_URL: ${{ steps.deployment-app3.outputs.url }}
GITHUB_TOKEN: ${{ steps.octoken.outputs.token }}

- run: make -C e2e_test delete-apps

# show logs
- run: make -C e2e_test logs-argocd
if: always()
Expand Down
2 changes: 2 additions & 0 deletions controllers/applicationhealthdeployment_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ func (applicationHealthDeploymentComparer) Compare(applicationOld, applicationNe
case health.HealthStatusHealthy, health.HealthStatusDegraded:
lastNotifiedDeploymentURL := applicationNew.Annotations[annotationNameOfLastDeploymentOfHealthy]
return currentDeploymentURL != lastNotifiedDeploymentURL
case health.HealthStatusMissing:
return true
}
return false
}
3 changes: 3 additions & 0 deletions e2e_test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ deploy-app3:
$(MAKE) -C $(FIXTURE_DIR) update-manifest-app3
go run ./waitforapp -revision "`git -C $(FIXTURE_DIR) rev-parse $(FIXTURE_BASE_BRANCH)`" app3

delete-apps:
kubectl -n argocd delete applications -l int128.github.io/e2e-test=fixture

logs-controller:
-kubectl -n argocd-commenter-system logs -l control-plane=controller-manager --all-containers --tail=-1
logs-argocd:
Expand Down
4 changes: 4 additions & 0 deletions e2e_test/applications/app1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: Application
metadata:
name: app1
namespace: argocd
labels:
int128.github.io/e2e-test: fixture
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
Expand Down
4 changes: 4 additions & 0 deletions e2e_test/applications/app2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: Application
metadata:
name: app2
namespace: argocd
labels:
int128.github.io/e2e-test: fixture
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
Expand Down
4 changes: 4 additions & 0 deletions e2e_test/applications/app3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: Application
metadata:
name: app3
namespace: argocd
labels:
int128.github.io/e2e-test: fixture
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
Expand Down
3 changes: 3 additions & 0 deletions pkg/notification/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ func generateDeploymentStatus(e Event) *github.DeploymentStatus {
case health.HealthStatusDegraded:
ds.State = "failure"
return &ds
case health.HealthStatusMissing:
ds.State = "inactive"
return &ds
}
}

Expand Down