Skip to content

Conversation

ricoberger
Copy link
Member

This commit refactors the "cluster" and "clusters" package. We
introduced some new interfaces and now creating "clients" in both
packages which must implement the interfaces to interact with a
Kubernetes cluster.

This was required to increase the test coverage in the future, by
mocking the clients to interact with all / one Kubernetes cluser.

With this change with had to adjust multiple packages and plugins where
the clusters client was used. For all plugins which are not interacting
with a Kubernetes cluster we removed the clusters client as parameter.

This commit refactors the "cluster" and "clusters" package. We
introduced some new interfaces and now creating "clients" in both
packages which must implement the interfaces to interact with a
Kubernetes cluster.

This was required to increase the test coverage in the future, by
mocking the clients to interact with all / one Kubernetes cluser.

With this change with had to adjust multiple packages and plugins where
the clusters client was used. For all plugins which are not interacting
with a Kubernetes cluster we removed the clusters client as parameter.
@codecov-commenter
Copy link

Codecov Report

Merging #263 (8ef3cd3) into main (a9d15fb) will increase coverage by 6.20%.
The diff coverage is 52.53%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #263      +/-   ##
==========================================
+ Coverage   16.20%   22.41%   +6.20%     
==========================================
  Files          89       89              
  Lines        7533     7539       +6     
==========================================
+ Hits         1221     1690     +469     
+ Misses       6295     5818     -477     
- Partials       17       31      +14     
Impacted Files Coverage Δ
cmd/kobs/kobs.go 8.10% <0.00%> (ø)
pkg/api/api.go 5.26% <0.00%> (ø)
pkg/api/clusters/cluster/cluster.go 0.00% <0.00%> (ø)
pkg/api/clusters/router.go 0.00% <0.00%> (ø)
pkg/api/middleware/auth/auth.go 0.00% <0.00%> (ø)
pkg/api/middleware/auth/handler.go 29.41% <0.00%> (ø)
plugins/applications/pkg/teams/teams.go 0.00% <0.00%> (ø)
plugins/applications/pkg/topology/topology.go 14.51% <0.00%> (ø)
plugins/flux/pkg/sync/sync.go 0.00% <0.00%> (ø)
plugins/resources/resources.go 6.10% <20.00%> (+6.10%) ⬆️
... and 42 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a9d15fb...8ef3cd3. Read the comment docs.

@ricoberger ricoberger merged commit 57183de into main Dec 28, 2021
@ricoberger ricoberger deleted the rework-cluster-and-cluster-packages branch December 28, 2021 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants