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

[DPE-2123] Ensure feature parity between kubectl and lightkube backends and add integration tests. #54

Merged
merged 33 commits into from
Jan 11, 2024

Conversation

theoctober19th
Copy link
Member

@theoctober19th theoctober19th commented Jan 8, 2024

This PR

  • Attempts to make the behavior of kubectl and lightkube backends consistent on all service account registry commands.
  • Adds integration tests (parameterized by backend) to ensure the consisitency of two backends.

Jira:
DPE-2123

The output produced from the program are presented to the user by
writing directly the stdout (via print function). Also, the debug
information should not appear as output to the user's console. For that,
the log level of logs written in a few places have been demoted.
If no namespace is provided explicitly, for both backends, all service
accounts in all namespaces that have the custom labels provided by this
tool should be listed. Earlier, only the accounts in the `default`
namespace were listed when no `--namespace` option was provided. This is
done for the `lightkube` backend to be consistent with the `kubectl`
backend, because `kubectl` lists all accounts in all namespaces by
default.
For lightkube backend, the behavior should be the same as it exists in
kubectl backend.
Since this information is only relevant for debugging purposes, this
should not be a warning log.
Added new test cases for deletion of service account, adding config,
removing config, clearing config, get primary and get config commands.
This needs to be done to ensure the service account, role and role
binding to be created as part of creation of service account do not
exist already in the Kubernetes cluster. If such scenario happens, then
the program would crash with exception, while it may have created some
resources already but still not able to create all of the resources.
Test the behavior of creation when the service account about to be
created already exists in Kubernetes cluster.
@theoctober19th theoctober19th changed the title Remove feature parity between kubectl and lightkube backends and add integration tests. Feature parity between kubectl and lightkube backends and add integration tests. Jan 8, 2024
@theoctober19th theoctober19th marked this pull request as ready for review January 9, 2024 11:53
Copy link
Contributor

@deusebio deusebio left a comment

Choose a reason for hiding this comment

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

Great job @theoctober19th ! I have some suggestions comments here and there, but overall I really liked the PR, and I don't have major concerns.

Just run through the suggestions with @welpaolo and you are free to decide the way forward

Thanks!

spark8t/cli/service_account_registry.py Show resolved Hide resolved
tests/integration/test_service_accounts.py Outdated Show resolved Hide resolved
tests/integration/test_service_accounts.py Outdated Show resolved Hide resolved
tests/integration/test_service_accounts.py Outdated Show resolved Hide resolved
tests/integration/test_service_accounts.py Outdated Show resolved Hide resolved
@theoctober19th theoctober19th changed the title Feature parity between kubectl and lightkube backends and add integration tests. [DPE-2123] Feature parity between kubectl and lightkube backends and add integration tests. Jan 11, 2024
Copy link
Contributor

@welpaolo welpaolo left a comment

Choose a reason for hiding this comment

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

Really good job! I left some minor comments.

spark8t/exceptions.py Show resolved Hide resolved
@theoctober19th theoctober19th changed the title [DPE-2123] Feature parity between kubectl and lightkube backends and add integration tests. [DPE-2123] Ensure feature parity between kubectl and lightkube backends and add integration tests. Jan 11, 2024
@theoctober19th theoctober19th merged commit e75412f into canonical:main Jan 11, 2024
4 checks 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