-
Notifications
You must be signed in to change notification settings - Fork 7
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: Implement solo context connect #863
base: main
Are you sure you want to change the base?
feat: Implement solo context connect #863
Conversation
Signed-off-by: Ivo Yankov <[email protected]>
…of-2-updates-the-localconfig-by-connecting-a-deployment-to-a-k8s-context # Conflicts: # src/commands/node/handlers.ts # src/commands/node/tasks.ts # src/core/k8.ts
Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
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 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #863 +/- ##
==========================================
- Coverage 83.81% 83.62% -0.19%
==========================================
Files 49 54 +5
Lines 14934 15239 +305
Branches 1034 1126 +92
==========================================
+ Hits 12517 12744 +227
- Misses 2401 2436 +35
- Partials 16 59 +43
|
…of-2-updates-the-localconfig-by-connecting-a-deployment-to-a-k8s-context
src/commands/context/flags.ts
Outdated
|
||
export const DEFAULT_FLAGS = { | ||
requiredFlags: [], | ||
requiredFlagsWithDisabledPrompt: [flags.namespace, flags.cacheDir, flags.releaseTag], |
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.
what makes releaseTag required or used for solo context connect
?
src/commands/context/tasks.ts
Outdated
this.parent.logger.info(`currentDeploymentName: ${currentDeploymentName}`) | ||
this.parent.logger.info(`contextName: ${contextName}`) | ||
this.parent.logger.info(`clusterAliases: ${clusterAliases.join(' ')}`) | ||
this.parent.logger.info('Save LocalConfig file') |
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.
this.parent.logger.info(`currentDeploymentName: ${currentDeploymentName}`) | |
this.parent.logger.info(`contextName: ${contextName}`) | |
this.parent.logger.info(`clusterAliases: ${clusterAliases.join(' ')}`) | |
this.parent.logger.info('Save LocalConfig file') | |
this.parent.logger.info('Save LocalConfig file: [currentDeploymentName: ${currentDeploymentName}, contextName: ${contextName}, clusterAliases: ${clusterAliases.join(' ')}]') |
less verbose in the log file if it is on one line
src/core/config/local_config.ts
Outdated
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.
I recall us talking about storing the cluster to context mapping by reading it in, but not saving it to the local config file, so that it would be rebuilt each time and can be used by other parts of the application. Maybe I'll find it somewhere else while reviewing this PR?
src/core/task.ts
Outdated
constructor (public title: string, public task: Function, public skip: Function | boolean = false) { | ||
this.title = title | ||
this.task = task | ||
this.skip = skip | ||
} |
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.
constructor (public title: string, public task: Function, public skip: Function | boolean = false) { | |
this.title = title | |
this.task = task | |
this.skip = skip | |
} | |
constructor (public title: string, public task: Function, public skip: Function | boolean = false) { } |
I think this means the same thing?
src/core/k8.ts
Outdated
.then(conn => { | ||
self.logger.info(`${messagePrefix} connection established`) | ||
localContext.connection = conn | ||
({ status }) => self.handleCallback(status, localContext, messagePrefix)) |
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.
what formatter are you using? I noticed that npm run format
does not do this. I have an outstanding item to implement prettier. although now that we agreed on google style, there is probably a better way.
In IntelliJ, I had the Palantir Style set, previously in Java, so some of those settings carried over. If I reformat this file, it changes everything back to how I had it. We need to all get on the same page and use the same settings.
src/commands/flags.ts
Outdated
constName: 'contextName', | ||
name: 'context', | ||
definition: { | ||
describe: 'The kind context name to be used', |
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.
describe: 'The kind context name to be used', | |
describe: 'The Kubernetes context name to be used', |
Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
solo context connect
command.context
andclusterName
solo context connect
accepts the following flags:--namespace
--context
--cluster-name
--quiet-mode
When a flag is not specified the user will be prompted to input a value. For
context
a list of all contexts fromkubectl config
is provided. Whenquiet=true
the default values fromkubectl
are used.Currently the command utilizes the
promptLocalConfigTask
task, which creates thelocal-config.yaml
file if it doesn't exist and prompts foruserEmailAddress
and fordeployments
. In a future PR this will be changed so that a different command will be responsible for instantiating the local configuration.Related Issues
solo context connect
part 1 of 2 - updates the LocalConfig by connecting a deployment to a k8s context #754