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

Remove k8s package #2507

Closed
phillebaba opened this issue May 15, 2024 · 0 comments · Fixed by #2627
Closed

Remove k8s package #2507

phillebaba opened this issue May 15, 2024 · 0 comments · Fixed by #2627
Assignees

Comments

@phillebaba
Copy link
Member

Describe what should be investigated or refactored

The k8s package with exception for a couple of functions simply wraps a Kubernetes clientset with very little value add. The functions return structs from k8s api package so the current implementation does not decouple the dependency towards these packages. This just increases bloat and complexity without any functionality. I suggest that we remove the k8s package and instead export a clientset in the Cluster struct. Allowing the calling code to use the clientset directly.

Links to any relevant code

https://github.com/defenseunicorns/zarf/blob/48c11d99547b59ff2f10fa60078741376059f821/src/pkg/k8s/pods.go#L81
https://github.com/defenseunicorns/zarf/blob/48c11d99547b59ff2f10fa60078741376059f821/src/pkg/k8s/secrets.go#L18

Additional context

N/A

@phillebaba phillebaba self-assigned this May 16, 2024
lucasrod16 pushed a commit that referenced this issue May 28, 2024
## Description

Removes use of k8s info and nodes functions. 

## Related Issue

Relates to #2507

## Checklist before merging

- [ ] Test, docs, adr added or updated as needed
- [ ] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed
lucasrod16 pushed a commit that referenced this issue May 30, 2024
## Description

Removes use of k8s deprecations functions.

## Related Issue

Relates to #2507

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed
AustinAbro321 pushed a commit that referenced this issue Jun 3, 2024
## Description

Removes use of k8s dynamic functions.

## Related Issue

Relates to #2507 

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed

Co-authored-by: Lucas Rodriguez <lucas.rodriguez@defenseunicorns.com>
lucasrod16 pushed a commit that referenced this issue Jun 3, 2024
## Description

This change removes the k8s namespace code and replaces it with direct
use of the client set instead.

## Related Issue

Relates to #2507

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed

---------
AustinAbro321 pushed a commit that referenced this issue Jun 10, 2024
## Description

Moves the tunnel code to cluster pacakge.

This is far from a perfect solution but I do not want to make a enormous
change. The tunnel code needs some refactoring in the future but before
that can be done we need to understand how dependencies on Cluster
looks.

## Related Issue

Relates to #2507 

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed
AustinAbro321 pushed a commit that referenced this issue Jun 11, 2024
## Description

Removes use of k8s pod functions.

## Related Issue

Relates to #2507

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed
AustinAbro321 pushed a commit that referenced this issue Jun 14, 2024
## Description

Removes use of k8s secret functions.

## Related Issue

Relates to #2507

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed
AustinAbro321 pushed a commit that referenced this issue Jul 23, 2024
## Description

Removes use of k8s info and nodes functions.

## Related Issue

Relates to #2507

## Checklist before merging

- [ ] Test, docs, adr added or updated as needed
- [ ] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
AustinAbro321 pushed a commit that referenced this issue Jul 23, 2024
## Description

Removes use of k8s deprecations functions.

## Related Issue

Relates to #2507

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
AustinAbro321 pushed a commit that referenced this issue Jul 23, 2024
## Description

Removes use of k8s dynamic functions.

## Related Issue

Relates to #2507

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed

Co-authored-by: Lucas Rodriguez <lucas.rodriguez@defenseunicorns.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
AustinAbro321 pushed a commit that referenced this issue Jul 23, 2024
## Description

This change removes the k8s namespace code and replaces it with direct
use of the client set instead.

## Related Issue

Relates to #2507

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed

---------

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
AustinAbro321 pushed a commit that referenced this issue Jul 23, 2024
## Description

Moves the tunnel code to cluster pacakge.

This is far from a perfect solution but I do not want to make a enormous
change. The tunnel code needs some refactoring in the future but before
that can be done we need to understand how dependencies on Cluster
looks.

## Related Issue

Relates to #2507

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
AustinAbro321 pushed a commit that referenced this issue Jul 23, 2024
## Description

Removes use of k8s pod functions.

## Related Issue

Relates to #2507

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
AustinAbro321 pushed a commit that referenced this issue Jul 23, 2024
## Description

Removes use of k8s secret functions.

## Related Issue

Relates to #2507

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
AustinAbro321 added a commit that referenced this issue Jul 23, 2024
## Description

This is the final PR to completlty remove the k8s package. It refactors
some of the cluster creation and moves constants that are still needed.

## Related Issue

Fixes #2507

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed

Co-authored-by: Austin Abro <37223396+AustinAbro321@users.noreply.github.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant