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

Check and show health state of K8s Namespace resource #2828

Merged
merged 9 commits into from
Nov 24, 2021
Merged

Conversation

ono-max
Copy link
Member

@ono-max ono-max commented Nov 24, 2021

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #1610

Does this PR introduce a user-facing change?:

NONE

@pipecd-bot
Copy link
Collaborator

GO_LINTER

The following files are not gofmt-ed. By commenting /golinter fmt, the formatted one will be appended to this pull request automatically.

pkg/app/piped/cloudprovider/kubernetes/state.go
--- pkg/app/piped/cloudprovider/kubernetes/state.go.orig
+++ pkg/app/piped/cloudprovider/kubernetes/state.go
@@ -560,15 +560,15 @@
 	status = model.KubernetesResourceState_HEALTHY
 
 	var cond *corev1.NamespaceCondition
-	L:
-		for i := range ns.Status.Conditions {
-			c := ns.Status.Conditions[i]
-			switch c.Type {
-			case corev1.NamespaceDeletionDiscoveryFailure, corev1.NamespaceDeletionContentFailure, corev1.NamespaceDeletionGVParsingFailure:
-				cond = &c
-				break L
-			}
+L:
+	for i := range ns.Status.Conditions {
+		c := ns.Status.Conditions[i]
+		switch c.Type {
+		case corev1.NamespaceDeletionDiscoveryFailure, corev1.NamespaceDeletionContentFailure, corev1.NamespaceDeletionGVParsingFailure:
+			cond = &c
+			break L
 		}
+	}
 
 	if cond != nil && cond.Status == corev1.ConditionTrue {
 		status = model.KubernetesResourceState_OTHER

@pipecd-bot
Copy link
Collaborator

GO_LINTER

The golinter build is completed with FAILURE. The build will be triggered again when you push any other commits. Or you can trigger it manually by /golinter trigger command right now.

You can check the build log from here.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 31.78%. This pull request decreases coverage by -0.05%.

File Function Base Head Diff
pkg/app/piped/cloudprovider/kubernetes/state.go determineNameSpace -- 0.00% +0.00%
pkg/app/piped/cloudprovider/kubernetes/state.go determineResourceHealth 0.00% 0.00% +0.00%

@pipecd-bot
Copy link
Collaborator

GO_LINTER

The golinter build is completed with FAILURE. The build will be triggered again when you push any other commits. Or you can trigger it manually by /golinter trigger command right now.

You can check the build log from here.

@pipecd-bot
Copy link
Collaborator

GO_LINTER

The golinter build is completed with FAILURE. The build will be triggered again when you push any other commits. Or you can trigger it manually by /golinter trigger command right now.

You can check the build log from here.

@ono-max ono-max requested a review from nghialv November 24, 2021 04:47
@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 31.78%. This pull request decreases coverage by -0.06%.

File Function Base Head Diff
pkg/app/piped/cloudprovider/kubernetes/state.go determineNameSpace -- 0.00% +0.00%
pkg/app/piped/cloudprovider/kubernetes/state.go determineResourceHealth 0.00% 0.00% +0.00%

@ono-max ono-max requested a review from nghialv November 24, 2021 04:58
@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 31.78%. This pull request decreases coverage by -0.06%.

File Function Base Head Diff
pkg/app/piped/cloudprovider/kubernetes/state.go determineNameSpace -- 0.00% +0.00%
pkg/app/piped/cloudprovider/kubernetes/state.go determineResourceHealth 0.00% 0.00% +0.00%

@nghialv
Copy link
Member

nghialv commented Nov 24, 2021

Just left the last nit.
/lgtm

Co-authored-by: Le Van Nghia <nghialv2607@gmail.com>
@pipecd-bot pipecd-bot removed the lgtm label Nov 24, 2021
@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 31.78%. This pull request decreases coverage by -0.06%.

File Function Base Head Diff
pkg/app/piped/cloudprovider/kubernetes/state.go determineNameSpace -- 0.00% +0.00%
pkg/app/piped/cloudprovider/kubernetes/state.go determineResourceHealth 0.00% 0.00% +0.00%

@nghialv
Copy link
Member

nghialv commented Nov 24, 2021

/lgtm

@nakabonne
Copy link
Member

Way to go!
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by nakabonne.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check and show health state of K8s Namespace resource
4 participants