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 dry run and output #36

Merged
merged 2 commits into from Jul 12, 2023
Merged

add dry run and output #36

merged 2 commits into from Jul 12, 2023

Conversation

mmulholla
Copy link
Member

https://issues.redhat.com/browse/APPSVC-1359

Added dry-run flag to create and join commands. For example output:

[INFO] (dry run) SUCCESS: create of Namespace primaza-alice was successful
[INFO] (dry run) SUCCESS: create of CustomResourceDefinition clusterenvironments.primaza.io was successful
[INFO] (dry run) SUCCESS: create of CustomResourceDefinition registeredservices.primaza.io was successful
[INFO] (dry run) SUCCESS: create of CustomResourceDefinition servicebindings.primaza.io was successful
[INFO] (dry run) SUCCESS: create of CustomResourceDefinition servicecatalogs.primaza.io was successful
[INFO] (dry run) SUCCESS: create of CustomResourceDefinition serviceclaims.primaza.io was successful
[INFO] (dry run) SUCCESS: create of CustomResourceDefinition serviceclasses.primaza.io was successful
[ERROR] (dry run) FAILED: create of ServiceAccount primaza-controller-manager: Exception: namespaces "primaza-alice" not found
[ERROR] (dry run) FAILED: create of Role primaza-claimer: Exception: namespaces "primaza-alice" not found
[ERROR] (dry run) FAILED: create of Role primaza-leader-election-role: Exception: namespaces "primaza-alice" not found
[ERROR] (dry run) FAILED: create of Role primaza-manager-role: Exception: namespaces "primaza-alice" not found
[ERROR] (dry run) FAILED: create of Role primaza-reporter: Exception: namespaces "primaza-alice" not found
[ERROR] (dry run) FAILED: create of RoleBinding primaza-leader-election-rolebinding: Exception: namespaces "primaza-alice" not found
[ERROR] (dry run) FAILED: create of RoleBinding primaza-manager-rolebinding: Exception: namespaces "primaza-alice" not found
[ERROR] (dry run) FAILED: create of ConfigMap primaza-manager-config: Exception: namespaces "primaza-alice" not found
[ERROR] (dry run) FAILED: create of Service primaza-webhook-service: Exception: namespaces "primaza-alice" not found
[ERROR] (dry run) FAILED: create of Deployment primaza-controller-manager: Exception: namespaces "primaza-alice" not found
[ERROR] (dry run) FAILED: create of Certificate primaza-serving-cert: Exception: namespaces "primaza-alice" not found
[ERROR] (dry run) FAILED: create of Issuer primaza-selfsigned-issuer: Exception: namespaces "primaza-alice" not found
[INFO] (dry run) SUCCESS: create of ValidatingWebhookConfiguration primaza-validating-webhook-configuration was successful
Dry run Primaza tenant install complete

Had to skip some checks in the code which rely in the resources being created.

Also added output as yaml option, if specified the only output to stdout is a yaml array of resources created which is similar to kubectl output. If a resource is modified to obscure secret data a warning is output to stderr, for example:
WARNING:Secret primaza-tkn-primaza-alice-cluster1dev: "kubeconfig" attribute modified to hide secrets

Also updated readme and added new tests. The new test also added to PR checks.

@mmulholla mmulholla requested a review from filariow July 11, 2023 15:54
Copy link
Member

@filariow filariow left a comment

Choose a reason for hiding this comment

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

some nits

scripts/src/primazactl/utils/settings.py Outdated Show resolved Hide resolved
scripts/src/primazactl/utils/settings.py Outdated Show resolved Hide resolved
Copy link
Member

@filariow filariow left a comment

Choose a reason for hiding this comment

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

lgtm

@filariow filariow merged commit 8544f34 into primaza:main Jul 12, 2023
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.

None yet

2 participants