mirror of
https://github.com/argoproj/argo-cd
synced 2026-05-24 01:38:43 +00:00
This commit is contained in:
parent
476682ba8c
commit
9d4a32e94f
2 changed files with 10 additions and 6 deletions
|
|
@ -1375,7 +1375,7 @@ func getResourceStates(app *argoappv1.Application, selectedResources []argoappv1
|
|||
health := string(res.Status)
|
||||
key := kube.NewResourceKey(res.Group, res.Kind, res.Namespace, res.Name)
|
||||
if resource, ok := resourceByKey[key]; ok && res.HookType == "" {
|
||||
health = argoappv1.HealthStatusUnknown
|
||||
health = ""
|
||||
if resource.Health != nil {
|
||||
health = resource.Health.Status
|
||||
}
|
||||
|
|
@ -1396,7 +1396,7 @@ func getResourceStates(app *argoappv1.Application, selectedResources []argoappv1
|
|||
// print rest of resources which were not part of most recent operation
|
||||
for _, resKey := range resKeys {
|
||||
res := resourceByKey[resKey]
|
||||
health := argoappv1.HealthStatusUnknown
|
||||
health := ""
|
||||
if res.Health != nil {
|
||||
health = res.Health.Status
|
||||
}
|
||||
|
|
|
|||
|
|
@ -409,7 +409,7 @@ func TestDuplicatedResources(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestConfigMap(t *testing.T) {
|
||||
testEdgeCasesApplicationResources(t, "config-map", HealthStatusHealthy)
|
||||
testEdgeCasesApplicationResources(t, "config-map", HealthStatusHealthy, "my-map Synced configmap/my-map created")
|
||||
}
|
||||
|
||||
func TestFailedConversion(t *testing.T) {
|
||||
|
|
@ -421,15 +421,19 @@ func TestFailedConversion(t *testing.T) {
|
|||
testEdgeCasesApplicationResources(t, "failed-conversion", HealthStatusProgressing)
|
||||
}
|
||||
|
||||
func testEdgeCasesApplicationResources(t *testing.T, appPath string, statusCode HealthStatusCode) {
|
||||
Given(t).
|
||||
func testEdgeCasesApplicationResources(t *testing.T, appPath string, statusCode HealthStatusCode, message ...string) {
|
||||
expect := Given(t).
|
||||
Path(appPath).
|
||||
When().
|
||||
Create().
|
||||
Sync().
|
||||
Then().
|
||||
Expect(OperationPhaseIs(OperationSucceeded)).
|
||||
Expect(SyncStatusIs(SyncStatusCodeSynced)).
|
||||
Expect(SyncStatusIs(SyncStatusCodeSynced))
|
||||
for i := range message {
|
||||
expect = expect.Expect(Success(message[i]))
|
||||
}
|
||||
expect.
|
||||
Expect(HealthIs(statusCode)).
|
||||
And(func(app *Application) {
|
||||
diffOutput, err := fixture.RunCli("app", "diff", app.Name, "--local", path.Join("testdata", appPath))
|
||||
|
|
|
|||
Loading…
Reference in a new issue