Skip to content

Commit

Permalink
Changes:
Browse files Browse the repository at this point in the history
	- camelCase naming convention

Signed-off-by: Rahul M Chheda <[email protected]>
  • Loading branch information
Rahul M Chheda committed Sep 3, 2019
1 parent 4e4c150 commit 308d8e9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
18 changes: 8 additions & 10 deletions cmd/exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ func contains(l []string, e string) bool {
}

// getnamespaceEnv checks whether an ENV variable has been set, else sets a default value
func getnamespaceEnv(key, fallback string) string {
func getNamespaceEnv(key, fallback string) string {
if value, ok := os.LookupEnv(key); ok {
return value
}
return fallback
}

// get
func getopenebsEnv(key, fallback string) string {
func getOpenebsEnv(key, fallback string) string {
if value, ok := os.LookupEnv(key); ok {
return value
}
Expand Down Expand Up @@ -149,14 +149,12 @@ func main() {

// Get app details & chaoengine name from ENV
// Add checks for default
//applicationUUID := os.Getenv("APP_UUID")
applicationUUID := "1234"
//chaosEngine := os.Getenv("CHAOSENGINE")
chaosEngine := "engine8"
applicationUUID := os.Getenv("APP_UUID")
chaosEngine := os.Getenv("CHAOSENGINE")
//appNS := os.Getenv("APP_NAMESPACE")
appNamespace := getnamespaceEnv("APP_NAMESPACE", "default")
appNamespace := getNamespaceEnv("APP_NAMESPACE", "default")
//openEBS installation namespace
openebsNamespace := getopenebsEnv("OPENEBS_NAMESPACE", "openebs")
openebsNamespace := getOpenebsEnv("OPENEBS_NAMESPACE", "openebs")

flag.StringVar(&kubeconfig, "kubeconfig", "", "path to the kubeconfig file")
flag.Parse()
Expand All @@ -180,13 +178,13 @@ func main() {
os.Exit(1)
}
// This function gets the kubernetes version
kubernetesVersion, err := version.GetkubernetesVersion(config)
kubernetesVersion, err := version.GetKubernetesVersion(config)
if err != nil {
log.Info("Unable to get Kubernetes Version : ", err)
//kubernetesVersion = "N/A"
}
// This function gets the openebs version
openebsVersion, err := version.GetopenebsVersion(config, openebsNamespace)
openebsVersion, err := version.GetOpenebsVersion(config, openebsNamespace)
if err != nil {
log.Info("Unable to get OpenEBS Version : ", err)
//openebsVersion = "N/A"
Expand Down
2 changes: 1 addition & 1 deletion pkg/chaosmetrics/scrapecr.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func statusConv(expstatus string) (numeric float64) {
- TODO: Update the chaosresult to carry verdict alone. Status & Verdict are redundant
*/

// GetChaosMetrics returns chaos metrics for a given chaosengine
// GetLitmusChaosMetrics returns chaos metrics for a given chaosengine
func GetLitmusChaosMetrics(cfg *rest.Config, cEngine string, ns string) (totalExpCount, totalPassedExp, totalFailedExp float64, rMap map[string]float64, err error) {

v1alpha1.AddToScheme(scheme.Scheme)
Expand Down
4 changes: 2 additions & 2 deletions pkg/version/kubernetesVersion.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"k8s.io/client-go/rest"
)

// GetkubernetesVersion function gets kubernetes Version
func GetkubernetesVersion(cfg *rest.Config) (string, error) {
// GetKubernetesVersion function gets kubernetes Version
func GetKubernetesVersion(cfg *rest.Config) (string, error) {
// function to get Kubernetes Version
clientSet, err := discovery.NewDiscoveryClientForConfig(cfg)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/version/openebsVersion.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

var openebsVersion string

// GetopenebsVersion function fetchs the OpenEBS version
func GetopenebsVersion(cfg *rest.Config, namespace string) (string, error) {
// GetOpenebsVersion function fetchs the OpenEBS version
func GetOpenebsVersion(cfg *rest.Config, namespace string) (string, error) {
clientSet, err := kubernetes.NewForConfig(cfg)
if err != nil {
log.Info("Unable to create the required ClientSet")
Expand Down

0 comments on commit 308d8e9

Please sign in to comment.