Compare commits
4 Commits
export_fun
...
pf_remove_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df018078d4 | ||
|
|
e5bc89c757 | ||
|
|
c84dcb03b0 | ||
|
|
5a00b5218c |
@@ -3,7 +3,6 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/kyokomi/emoji"
|
|
||||||
ansi "github.com/mattn/go-colorable"
|
ansi "github.com/mattn/go-colorable"
|
||||||
"github.com/qlik-oss/sense-installer/pkg/preflight"
|
"github.com/qlik-oss/sense-installer/pkg/preflight"
|
||||||
"github.com/ttacon/chalk"
|
"github.com/ttacon/chalk"
|
||||||
@@ -38,7 +37,7 @@ func pfDnsCheckCmd(q *qliksense.Qliksense) *cobra.Command {
|
|||||||
// Preflight DNS check
|
// Preflight DNS check
|
||||||
namespace, kubeConfigContents, err := preflight.InitPreflight()
|
namespace, kubeConfigContents, err := preflight.InitPreflight()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight DNS check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight DNS check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -46,11 +45,11 @@ func pfDnsCheckCmd(q *qliksense.Qliksense) *cobra.Command {
|
|||||||
namespace = "default"
|
namespace = "default"
|
||||||
}
|
}
|
||||||
if err = qp.CheckDns(namespace, kubeConfigContents); err != nil {
|
if err = qp.CheckDns(namespace, kubeConfigContents); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight DNS check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight DNS check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Green.Color(":heavy_check_mark: Preflight DNS check"))
|
fmt.Fprintf(out, "%s\n", chalk.Green.Color("Preflight DNS check PASSED"))
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -76,16 +75,16 @@ func pfK8sVersionCheckCmd(q *qliksense.Qliksense) *cobra.Command {
|
|||||||
// Preflight Kubernetes minimum version check
|
// Preflight Kubernetes minimum version check
|
||||||
namespace, kubeConfigContents, err := preflight.InitPreflight()
|
namespace, kubeConfigContents, err := preflight.InitPreflight()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight kubernetes minimum version check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight kubernetes minimum version check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if err = qp.CheckK8sVersion(namespace, kubeConfigContents); err != nil {
|
if err = qp.CheckK8sVersion(namespace, kubeConfigContents); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight kubernetes minimum version check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight kubernetes minimum version check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Green.Color(":heavy_check_mark: Preflight kubernetes minimum version check"))
|
fmt.Fprintf(out, "%s\n", chalk.Green.Color("Preflight kubernetes minimum version check PASSED"))
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -113,7 +112,7 @@ func pfAllChecksCmd(q *qliksense.Qliksense) *cobra.Command {
|
|||||||
fmt.Printf("Running all preflight checks...\n\n")
|
fmt.Printf("Running all preflight checks...\n\n")
|
||||||
namespace, kubeConfigContents, err := preflight.InitPreflight()
|
namespace, kubeConfigContents, err := preflight.InitPreflight()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Unable to run the preflight checks suite"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Unable to run the preflight checks suite"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -121,11 +120,11 @@ func pfAllChecksCmd(q *qliksense.Qliksense) *cobra.Command {
|
|||||||
namespace = "default"
|
namespace = "default"
|
||||||
}
|
}
|
||||||
if err = qp.RunAllPreflightChecks(kubeConfigContents, namespace, preflightOpts); err != nil {
|
if err = qp.RunAllPreflightChecks(kubeConfigContents, namespace, preflightOpts); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: 1 or more preflight checks have FAILED"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("1 or more preflight checks have FAILED"))
|
||||||
fmt.Println("Completed running all preflight checks")
|
fmt.Println("Completed running all preflight checks")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
emoji.Fprintf(out, "%s\n\n", chalk.Green.Color(":heavy_check_mark: All preflight checks have PASSED"))
|
fmt.Fprintf(out, "%s\n\n", chalk.Green.Color("All preflight checks have PASSED"))
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -157,7 +156,7 @@ func pfDeploymentCheckCmd(q *qliksense.Qliksense) *cobra.Command {
|
|||||||
// Preflight deployments check
|
// Preflight deployments check
|
||||||
namespace, kubeConfigContents, err := preflight.InitPreflight()
|
namespace, kubeConfigContents, err := preflight.InitPreflight()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight deployment check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight deployment check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -165,11 +164,11 @@ func pfDeploymentCheckCmd(q *qliksense.Qliksense) *cobra.Command {
|
|||||||
namespace = "default"
|
namespace = "default"
|
||||||
}
|
}
|
||||||
if err = qp.CheckDeployment(namespace, kubeConfigContents); err != nil {
|
if err = qp.CheckDeployment(namespace, kubeConfigContents); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight deployment check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight deployment check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Green.Color(":heavy_check_mark: Preflight deployment check"))
|
fmt.Fprintf(out, "%s\n", chalk.Green.Color("Preflight deployment check PASSED"))
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -195,7 +194,7 @@ func pfServiceCheckCmd(q *qliksense.Qliksense) *cobra.Command {
|
|||||||
// Preflight service check
|
// Preflight service check
|
||||||
namespace, kubeConfigContents, err := preflight.InitPreflight()
|
namespace, kubeConfigContents, err := preflight.InitPreflight()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight service check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight service check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -204,11 +203,11 @@ func pfServiceCheckCmd(q *qliksense.Qliksense) *cobra.Command {
|
|||||||
namespace = "default"
|
namespace = "default"
|
||||||
}
|
}
|
||||||
if err = qp.CheckService(namespace, kubeConfigContents); err != nil {
|
if err = qp.CheckService(namespace, kubeConfigContents); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight service check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight service check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Green.Color(":heavy_check_mark: Preflight service check"))
|
fmt.Fprintf(out, "%s\n", chalk.Green.Color("Preflight service check PASSED"))
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -234,7 +233,7 @@ func pfPodCheckCmd(q *qliksense.Qliksense) *cobra.Command {
|
|||||||
// Preflight pod check
|
// Preflight pod check
|
||||||
namespace, kubeConfigContents, err := preflight.InitPreflight()
|
namespace, kubeConfigContents, err := preflight.InitPreflight()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight pod check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight pod check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -242,11 +241,11 @@ func pfPodCheckCmd(q *qliksense.Qliksense) *cobra.Command {
|
|||||||
namespace = "default"
|
namespace = "default"
|
||||||
}
|
}
|
||||||
if err = qp.CheckPod(namespace, kubeConfigContents); err != nil {
|
if err = qp.CheckPod(namespace, kubeConfigContents); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight pod check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight pod check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Green.Color(":heavy_check_mark: Preflight pod check"))
|
fmt.Fprintf(out, "%s\n", chalk.Green.Color("Preflight pod check PASSED"))
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -272,16 +271,16 @@ func pfCreateRoleCheckCmd(q *qliksense.Qliksense) *cobra.Command {
|
|||||||
// Preflight role check
|
// Preflight role check
|
||||||
namespace, _, err := preflight.InitPreflight()
|
namespace, _, err := preflight.InitPreflight()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight role check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight role check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if err = qp.CheckCreateRole(namespace); err != nil {
|
if err = qp.CheckCreateRole(namespace); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight role check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight role check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Green.Color(":heavy_check_mark: Preflight role check"))
|
fmt.Fprintf(out, "%s\n", chalk.Green.Color("Preflight role check PASSED"))
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -307,16 +306,16 @@ func pfCreateRoleBindingCheckCmd(q *qliksense.Qliksense) *cobra.Command {
|
|||||||
// Preflight createRoleBinding check
|
// Preflight createRoleBinding check
|
||||||
namespace, _, err := preflight.InitPreflight()
|
namespace, _, err := preflight.InitPreflight()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight rolebinding check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight rolebinding check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if err = qp.CheckCreateRoleBinding(namespace); err != nil {
|
if err = qp.CheckCreateRoleBinding(namespace); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight rolebinding check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight rolebinding check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Green.Color(":heavy_check_mark: Preflight rolebinding check"))
|
fmt.Fprintf(out, "%s\n", chalk.Green.Color("Preflight rolebinding check PASSED"))
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -342,16 +341,16 @@ func pfCreateServiceAccountCheckCmd(q *qliksense.Qliksense) *cobra.Command {
|
|||||||
// Preflight createServiceAccount check
|
// Preflight createServiceAccount check
|
||||||
namespace, _, err := preflight.InitPreflight()
|
namespace, _, err := preflight.InitPreflight()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight ServiceAccount check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight ServiceAccount check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if err = qp.CheckCreateServiceAccount(namespace); err != nil {
|
if err = qp.CheckCreateServiceAccount(namespace); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight ServiceAccount check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight ServiceAccount check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Green.Color(":heavy_check_mark: Preflight rolebinding check"))
|
fmt.Fprintf(out, "%s\n", chalk.Green.Color("Preflight ServiceAccount check PASSED"))
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -376,16 +375,16 @@ func pfCreateAuthCheckCmd(q *qliksense.Qliksense) *cobra.Command {
|
|||||||
// Preflight authcheck
|
// Preflight authcheck
|
||||||
namespace, kubeConfigContents, err := preflight.InitPreflight()
|
namespace, kubeConfigContents, err := preflight.InitPreflight()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight authcheck"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight authcheck FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if err = qp.CheckCreateRB(namespace, kubeConfigContents); err != nil {
|
if err = qp.CheckCreateRB(namespace, kubeConfigContents); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight authcheck"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight authcheck FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Green.Color(":heavy_check_mark: Preflight authcheck"))
|
fmt.Fprintf(out, "%s\n", chalk.Green.Color("Preflight authcheck PASSED"))
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -411,7 +410,7 @@ func pfMongoCheckCmd(q *qliksense.Qliksense) *cobra.Command {
|
|||||||
// Preflight mongo check
|
// Preflight mongo check
|
||||||
namespace, kubeConfigContents, err := preflight.InitPreflight()
|
namespace, kubeConfigContents, err := preflight.InitPreflight()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight mongo check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight mongo check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -419,11 +418,11 @@ func pfMongoCheckCmd(q *qliksense.Qliksense) *cobra.Command {
|
|||||||
namespace = "default"
|
namespace = "default"
|
||||||
}
|
}
|
||||||
if err = qp.CheckMongo(kubeConfigContents, namespace, preflightOpts); err != nil {
|
if err = qp.CheckMongo(kubeConfigContents, namespace, preflightOpts); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight mongo check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight mongo check FAILED"))
|
||||||
fmt.Printf("Error: %v\n", err)
|
fmt.Printf("Error: %v\n", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Green.Color(":heavy_check_mark: Preflight mongo check"))
|
fmt.Fprintf(out, "%s\n", chalk.Green.Color("Preflight mongo check PASSED"))
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,103 +3,102 @@ package preflight
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/kyokomi/emoji"
|
|
||||||
ansi "github.com/mattn/go-colorable"
|
ansi "github.com/mattn/go-colorable"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/ttacon/chalk"
|
"github.com/ttacon/chalk"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (qp *QliksensePreflight) RunAllPreflightChecks(kubeConfigContents []byte, namespace string, preflightOpts *PreflightOptions) error {
|
func (qp *QliksensePreflight) RunAllPreflightChecks(kubeConfigContents []byte, namespace string, preflightOpts *PreflightOptions) error {
|
||||||
out := ansi.NewColorableStdout()
|
|
||||||
checkCount := 0
|
checkCount := 0
|
||||||
totalCount := 0
|
totalCount := 0
|
||||||
|
|
||||||
|
out := ansi.NewColorableStdout()
|
||||||
// Preflight minimum kuberenetes version check
|
// Preflight minimum kuberenetes version check
|
||||||
if err := qp.CheckK8sVersion(namespace, kubeConfigContents); err != nil {
|
if err := qp.CheckK8sVersion(namespace, kubeConfigContents); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight kubernetes minimum version check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight kubernetes minimum version check FAILED"))
|
||||||
fmt.Printf("Error: %v\n\n", err)
|
fmt.Printf("Error: %v\n\n", err)
|
||||||
} else {
|
} else {
|
||||||
emoji.Fprintf(out, "%s\n\n", chalk.Green.Color(":heavy_check_mark: Preflight kubernetes minimum version check"))
|
fmt.Fprintf(out, "%s\n\n", chalk.Green.Color("Preflight kubernetes minimum version check PASSED"))
|
||||||
checkCount++
|
checkCount++
|
||||||
}
|
}
|
||||||
totalCount++
|
totalCount++
|
||||||
|
|
||||||
// Preflight deployment check
|
// Preflight deployment check
|
||||||
if err := qp.CheckDeployment(namespace, kubeConfigContents); err != nil {
|
if err := qp.CheckDeployment(namespace, kubeConfigContents); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight deployment check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight deployment check FAILED"))
|
||||||
fmt.Printf("Error: %v\n\n", err)
|
fmt.Printf("Error: %v\n\n", err)
|
||||||
} else {
|
} else {
|
||||||
emoji.Fprintf(out, "%s\n\n", chalk.Green.Color(":heavy_check_mark: Preflight deployment check"))
|
fmt.Fprintf(out, "%s\n\n", chalk.Green.Color("Preflight deployment check PASSED"))
|
||||||
checkCount++
|
checkCount++
|
||||||
}
|
}
|
||||||
totalCount++
|
totalCount++
|
||||||
|
|
||||||
// Preflight service check
|
// Preflight service check
|
||||||
if err := qp.CheckService(namespace, kubeConfigContents); err != nil {
|
if err := qp.CheckService(namespace, kubeConfigContents); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight service check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight service check FAILED"))
|
||||||
fmt.Printf("Error: %v\n\n", err)
|
fmt.Printf("Error: %v\n\n", err)
|
||||||
} else {
|
} else {
|
||||||
emoji.Fprintf(out, "%s\n\n", chalk.Green.Color(":heavy_check_mark: Preflight service check"))
|
fmt.Fprintf(out, "%s\n\n", chalk.Green.Color("Preflight service check PASSED"))
|
||||||
checkCount++
|
checkCount++
|
||||||
}
|
}
|
||||||
totalCount++
|
totalCount++
|
||||||
|
|
||||||
// Preflight pod check
|
// Preflight pod check
|
||||||
if err := qp.CheckPod(namespace, kubeConfigContents); err != nil {
|
if err := qp.CheckPod(namespace, kubeConfigContents); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight pod check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight pod check FAILED"))
|
||||||
fmt.Printf("Error: %v\n\n", err)
|
fmt.Printf("Error: %v\n\n", err)
|
||||||
} else {
|
} else {
|
||||||
emoji.Fprintf(out, "%s\n\n", chalk.Green.Color(":heavy_check_mark: Preflight pod check"))
|
fmt.Fprintf(out, "%s\n\n", chalk.Green.Color("Preflight pod check PASSED"))
|
||||||
checkCount++
|
checkCount++
|
||||||
}
|
}
|
||||||
totalCount++
|
totalCount++
|
||||||
|
|
||||||
// Preflight role check
|
// Preflight role check
|
||||||
if err := qp.CheckCreateRole(namespace); err != nil {
|
if err := qp.CheckCreateRole(namespace); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight role check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color("Preflight role check FAILED"))
|
||||||
fmt.Printf("Error: %v\n\n", err)
|
fmt.Printf("Error: %v\n\n", err)
|
||||||
} else {
|
} else {
|
||||||
emoji.Fprintf(out, "%s\n\n", chalk.Green.Color(":heavy_check_mark: Preflight role check"))
|
fmt.Fprintf(out, "%s\n\n", chalk.Green.Color("Preflight role check PASSED"))
|
||||||
checkCount++
|
checkCount++
|
||||||
}
|
}
|
||||||
totalCount++
|
totalCount++
|
||||||
|
|
||||||
// Preflight rolebinding check
|
// Preflight rolebinding check
|
||||||
if err := qp.CheckCreateRoleBinding(namespace); err != nil {
|
if err := qp.CheckCreateRoleBinding(namespace); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight rolebinding check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color(" Preflight rolebinding check FAILED"))
|
||||||
fmt.Printf("Error: %v\n\n", err)
|
fmt.Printf("Error: %v\n\n", err)
|
||||||
} else {
|
} else {
|
||||||
emoji.Fprintf(out, "%s\n\n", chalk.Green.Color(":heavy_check_mark: Preflight rolebinding check"))
|
fmt.Fprintf(out, "%s\n\n", chalk.Green.Color("Preflight rolebinding check PASSED"))
|
||||||
checkCount++
|
checkCount++
|
||||||
}
|
}
|
||||||
totalCount++
|
totalCount++
|
||||||
|
|
||||||
// Preflight serviceaccount check
|
// Preflight serviceaccount check
|
||||||
if err := qp.CheckCreateServiceAccount(namespace); err != nil {
|
if err := qp.CheckCreateServiceAccount(namespace); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight serviceaccount check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color(" Preflight serviceaccount check FAILED"))
|
||||||
fmt.Printf("Error: %v\n\n", err)
|
fmt.Printf("Error: %v\n\n", err)
|
||||||
} else {
|
} else {
|
||||||
emoji.Fprintf(out, "%s\n\n", chalk.Green.Color(":heavy_check_mark: Preflight serviceaccount check"))
|
fmt.Fprintf(out, "%s\n\n", chalk.Green.Color("Preflight serviceaccount check PASSED"))
|
||||||
checkCount++
|
checkCount++
|
||||||
}
|
}
|
||||||
totalCount++
|
totalCount++
|
||||||
|
|
||||||
// Preflight mongo check
|
// Preflight mongo check
|
||||||
if err := qp.CheckMongo(kubeConfigContents, namespace, preflightOpts); err != nil {
|
if err := qp.CheckMongo(kubeConfigContents, namespace, preflightOpts); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight mongo check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color(" Preflight mongo check FAILED"))
|
||||||
fmt.Printf("Error: %v\n\n", err)
|
fmt.Printf("Error: %v\n\n", err)
|
||||||
} else {
|
} else {
|
||||||
emoji.Fprintf(out, "%s\n\n", chalk.Green.Color(":heavy_check_mark: Preflight mongo check"))
|
fmt.Fprintf(out, "%s\n\n", chalk.Green.Color("Preflight mongo check PASSED"))
|
||||||
checkCount++
|
checkCount++
|
||||||
}
|
}
|
||||||
totalCount++
|
totalCount++
|
||||||
|
|
||||||
// Preflight DNS check
|
// Preflight DNS check
|
||||||
if err := qp.CheckDns(namespace, kubeConfigContents); err != nil {
|
if err := qp.CheckDns(namespace, kubeConfigContents); err != nil {
|
||||||
emoji.Fprintf(out, "%s\n", chalk.Red.Color(":heavy_multiplication_x: Preflight DNS check"))
|
fmt.Fprintf(out, "%s\n", chalk.Red.Color(" Preflight DNS check FAILED"))
|
||||||
fmt.Printf("Error: %v\n\n", err)
|
fmt.Printf("Error: %v\n\n", err)
|
||||||
} else {
|
} else {
|
||||||
emoji.Fprintf(out, "%s\n\n", chalk.Green.Color(":heavy_check_mark: Preflight DNS check"))
|
fmt.Fprintf(out, "%s\n\n", chalk.Green.Color("Preflight DNS check PASSED"))
|
||||||
checkCount++
|
checkCount++
|
||||||
}
|
}
|
||||||
totalCount++
|
totalCount++
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ func (qp *QliksensePreflight) mongoConnCheck(kubeConfigContents []byte, namespac
|
|||||||
caCertSecretName = "preflight-mongo-test-cacert"
|
caCertSecretName = "preflight-mongo-test-cacert"
|
||||||
caCertSecret, err := qp.createSecret(clientset, namespace, preflightOpts.MongoOptions.CaCertFile, caCertSecretName)
|
caCertSecret, err := qp.createSecret(clientset, namespace, preflightOpts.MongoOptions.CaCertFile, caCertSecretName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = fmt.Errorf("unable to create a create ca cert kubernetes secret: %v\n", err)
|
err = fmt.Errorf("unable to create a ca cert kubernetes secret: %v\n", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ func (qp *QliksensePreflight) mongoConnCheck(kubeConfigContents []byte, namespac
|
|||||||
clientCertSecretName = "preflight-mongo-test-clientcert"
|
clientCertSecretName = "preflight-mongo-test-clientcert"
|
||||||
clientCertSecret, err := qp.createSecret(clientset, namespace, preflightOpts.MongoOptions.ClientCertFile, clientCertSecretName)
|
clientCertSecret, err := qp.createSecret(clientset, namespace, preflightOpts.MongoOptions.ClientCertFile, clientCertSecretName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = fmt.Errorf("unable to create a create client cert kubernetes secret: %v\n", err)
|
err = fmt.Errorf("unable to create a client cert kubernetes secret: %v\n", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user