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

Add Kubernetes CRD client and schemas #33

Merged
merged 19 commits into from
Oct 14, 2024

Conversation

t-persson
Copy link
Collaborator

Applicable Issues

eiffel-community/etos#242

Description of the Change

Added schemas and helper methods for interacting with ETOS kubernetes resources.

Alternate Designs

I had these helpers in each service before, but that cause so much friction any time the packages changed as I needed to update every single one and make the correct change. While we still have to update every service when the library updates, at least we don't have to make the same code change multiple times.

Possible Drawbacks

Explained briefly in Alternate Designs.

Sign-off

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

Signed-off-by: Tobias Persson [email protected]

@t-persson t-persson requested a review from a team as a code owner July 26, 2024 10:29
@t-persson t-persson requested review from fredjn and andmat900 and removed request for a team July 26, 2024 10:29
@t-persson
Copy link
Collaborator Author

Dataset requires some more work.

src/etos_lib/kubernetes/provider.py Outdated Show resolved Hide resolved
src/etos_lib/kubernetes/etos.py Outdated Show resolved Hide resolved
src/etos_lib/kubernetes/schemas/provider.py Show resolved Hide resolved
@t-persson t-persson requested a review from andmat900 August 26, 2024 05:58
src/etos_lib/kubernetes/etos.py Show resolved Hide resolved
src/etos_lib/kubernetes/provider.py Outdated Show resolved Hide resolved
annotations: Optional[dict[str, str]] = None


class Image(BaseModel):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that it matters, but Image is only used with TestRunSepc making it not very commonly used between Kubernetes resources.

pyproject.toml Outdated Show resolved Hide resolved
src/etos_lib/kubernetes/etos.py Show resolved Hide resolved
src/etos_lib/kubernetes/etos.py Outdated Show resolved Hide resolved
src/etos_lib/kubernetes/etos.py Show resolved Hide resolved
src/etos_lib/kubernetes/etos.py Show resolved Hide resolved
fredjn
fredjn previously approved these changes Oct 10, 2024


class EnvironmentSpec(BaseModel):
"""EnvironmentSpec is the specification of a Environment Kubernetes resource."""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: a -> an

src/etos_lib/kubernetes/etos.py Show resolved Hide resolved
Also moved the NotFound check to the 'exists' method.
Copy link
Contributor

@andmat900 andmat900 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@t-persson t-persson requested a review from fredjn October 14, 2024 10:15
@t-persson t-persson merged commit c8d24db into eiffel-community:main Oct 14, 2024
1 check passed
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.

3 participants