Skip to content

Conversation

@sanposhiho
Copy link
Member

What this PR does / why we need it:
Create Role, RoleBinding, ClusterRole, ClusterRoleBinding health check

Which issue(s) this PR fixes:

Fixes #1136

Does this PR introduce a user-facing change?:

NONE

@sanposhiho
Copy link
Member Author

I checked the definitions of structures of Role, but I couldn't figure out how to specify the criteria for determining healthy.
I felt that as long as the role is applied successfully, it will not become unhealthy in the middle of the process, so I implemented functions in this PR so that it always returns healthy.
The same goes for Rolebinding, ClusterRole, and ClusterRoleBinding.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.73%. This pull request decreases coverage by -0.08%.

File Function Base Head Diff
pkg/app/api/grpcapi/api.go API.RegisterEvent -- 0.00% +0.00%
pkg/app/piped/cloudprovider/kubernetes/state.go determineRoleHealth -- 0.00% +0.00%
pkg/app/piped/cloudprovider/kubernetes/state.go determineRoleBindingHealth -- 0.00% +0.00%
pkg/app/piped/cloudprovider/kubernetes/state.go determineClusterRoleHealth -- 0.00% +0.00%
pkg/app/piped/cloudprovider/kubernetes/state.go determineClusterRoleBindingHealth -- 0.00% +0.00%
pkg/config/deployment.go GenericDeploymentSpec.Validate -- 100.00% +100.00%
pkg/datastore/event.go NewEventStore -- 100.00% +100.00%
pkg/datastore/event.go eventStore.AddEvent -- 100.00% +100.00%
pkg/app/piped/cloudprovider/kubernetes/state.go determinePersistentVolumeHealth 0.00% 0.00% +0.00%
pkg/app/piped/controller/scheduler.go scheduler.Run 0.00% 0.00% +0.00%
pkg/config/deployment_kubernetes.go KubernetesDeploymentSpec.Validate 100.00% 66.67% -33.33%
pkg/app/piped/cloudprovider/kubernetes/state.go determineResourceHealth 0.00% 0.00% +0.00%
pkg/app/piped/cloudprovider/kubernetes/state.go determineCronJobHealth 0.00% 0.00% +0.00%
pkg/app/api/grpcapi/api.go API.PushImageReference 0.00% -- +-0.00%
pkg/datastore/imagereference.go NewImageReferenceStore 100.00% -- -100.00%
pkg/datastore/imagereference.go imageReferenceStore.AddImageReference 100.00% -- -100.00%

@nakabonne
Copy link
Member

nakabonne commented Jan 12, 2021

@sanposhiho Thank you for your investigation! To be honest we've put off that check the whole time. As you mentioned, it looks like never getting unhealthy once applied. Let's deal with it later if we have to finely control in the future 👍
/lgtm

@khanhtc1202
Copy link
Member

thank you
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by khanhtc1202.

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.

@pipecd-bot pipecd-bot merged commit 7dd90d9 into master Jan 12, 2021
@pipecd-bot pipecd-bot deleted the health-state-role branch January 12, 2021 08:52
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 health state of Role resources

5 participants