-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat(cli): reduce redundancy on context to cluster flags in command deployment create
#1156
base: main
Are you sure you want to change the base?
Conversation
…data from flag.deploymentClusters and parsed data inside local config Signed-off-by: instamenta <[email protected]>
E2E Test Report 17 files 126 suites 1h 30m 12s ⏱️ Results for commit 446b8c9. ♻️ This comment has been updated with latest results. |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more Footnotes
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1156 +/- ##
==========================================
- Coverage 83.37% 83.13% -0.24%
==========================================
Files 77 77
Lines 20809 21104 +295
Branches 1717 1460 -257
==========================================
+ Hits 17349 17545 +196
- Misses 3363 3485 +122
+ Partials 97 74 -23
|
subTasks.push({ | ||
title: `Testing connection to cluster: ${chalk.cyan(cluster)}`, | ||
task: async (_, task) => { | ||
if (!(await self.k8.testClusterConnection(cluster))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to pass the context not the cluster. We need to look it up, prior to passing it.
rm -Rf ~/.solo
npm run solo -- init
npm run solo -- node keys --gossip-keys --tls-keys --node-aliases-unparsed node1,node2
npm run solo -- deployment create -n jeromy --email [email protected] --deployment-clusters solo-e2e
❯ cat local-config.yaml
userEmailAddress: [email protected]
deployments:
jeromy:
clusters:
- solo-e2e
currentDeploymentName: jeromy
clusterContextMapping:
solo-e2e: kind-solo-e2e
******************************* Solo *********************************************
Version : 0.33.0
Kubernetes Context : kind-solo-e2e
Kubernetes Cluster : kind-solo-e2e
Kubernetes Namespace : jeromy
**********************************************************************************
✔ Initialize
✔ Acquire lease - lease acquired successfully, attempt: 1/10
↓ Prompt local configuration
❯ Validate cluster connections
✖ No active cluster!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some changes:
- check and make sure that K8s
testClusterConnection
validates that the context exists in the kube config prior to setting it - put K8s
testClusterConnection
logic in a try/catch block, and if there is a failure revert the context back to its original value.
In this case:
npm run solo -- deployment create -n jeromy --email [email protected] --deployment-clusters solo-e2e
the cluster solo-e2e
is what solo will use as an alias to map to a context kind-solo-e2e
which I supplied when it prompted me.
The local-config.yaml looks good:
❯ cat local-config.yaml
userEmailAddress: [email protected]
deployments:
jeromy:
clusters:
- solo-e2e
currentDeploymentName: jeromy
clusterContextMapping:
solo-e2e: kind-solo-e2e
currently, the testClusterConnection
fails because solo-e2e
isn't a valid context, but it has already updated the kube current context. So, when the program attempts to exit, the release lease fails because k8 is a singleton, and still pointing to context = solo-e2e.
✔ Initialize
✔ Acquire lease - lease acquired successfully, attempt: 1/10
↓ Prompt local configuration
❯ Validate cluster connections
✖ No active cluster!
◼ Create remote config
*********************************** ERROR *****************************************
failed to read existing leases, unexpected server response of '500' received
***********************************************************************************
Description
Removes flag
--context-cluster
and it's usages, replaces them with data provided from local configdeployments.clusters
.Related Issues