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

feat: Add domain checks for Kubernetes family infrastructures #615

Merged
merged 1 commit into from
Apr 3, 2020

Conversation

mmorhun
Copy link
Contributor

@mmorhun mmorhun commented Apr 1, 2020

Signed-off-by: Mykola Morhun mmorhun@redhat.com

What does this PR do?

Adds check whether Kubernetes cluster is reachable when installing Che.
The check could be disabled by --skip-cluster-check flag.

What issues does this PR fix or reference?

#613

@mmorhun mmorhun requested a review from l0rd as a code owner April 1, 2020 14:40
@mmorhun mmorhun self-assigned this Apr 1, 2020
@mmorhun mmorhun changed the title Add domain checks for Kubernetes family infrastructures feat: Add domain checks for Kubernetes family infrastructures Apr 1, 2020
@tolusha tolusha mentioned this pull request Apr 1, 2020
43 tasks
export function getPingClusterTask(flags: any): Listr.ListrTask {
return {
title: 'Check if cluster accessible',
skip: () => flags['skip-cluster-check'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

|| !flags.domain ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, because I want to show warning

}

if (!await checkServer(domain, 80) || !await checkServer(domain, 443)) {
throw new Error(`Cannot reach cluster "${domain}". To skip this check add "--skip-cluster-check" flag.`)
Copy link
Collaborator

Choose a reason for hiding this comment

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

neither ${domain}:80 nor ${domain}:443

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, thanks

Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of
Cannot reach cluster "${domain}". To skip this check add "--skip-cluster-check" flag.
it is better to log
Cannot reach neither '${domain}:80' nor '${domain}:443'. It means the incorrect domain is used. Please, set the correct domain or bypass the check by using '--skip-domain-check' flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not think it is a good idea to print domain twice. I would like to avoid it.

@@ -140,6 +140,10 @@ export default class Start extends Command {
'skip-version-check': flags.boolean({
description: 'Skip minimal versions check.',
default: false
}),
'skip-cluster-check': flags.boolean({
Copy link
Collaborator

Choose a reason for hiding this comment

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

skip-domain-check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

--skip-cluster-availability-check as we agreed

}

if (!await checkServer(domain, 80) || !await checkServer(domain, 443)) {
throw new Error(`Cannot reach cluster "${domain}". To skip this check add "--skip-cluster-check" flag.`)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of
Cannot reach cluster "${domain}". To skip this check add "--skip-cluster-check" flag.
it is better to log
Cannot reach neither '${domain}:80' nor '${domain}:443'. It means the incorrect domain is used. Please, set the correct domain or bypass the check by using '--skip-domain-check' flag.

Copy link
Collaborator

@tolusha tolusha left a comment

Choose a reason for hiding this comment

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

Pls, consider my comments

Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
@mmorhun mmorhun merged commit 2dc3889 into master Apr 3, 2020
@mmorhun mmorhun deleted the add-domain-ping-check branch April 3, 2020 08:32
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

3 participants