Skip to content
This repository has been archived by the owner on Feb 5, 2021. It is now read-only.

Commit

Permalink
Refactor code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
madhukaw authored and isurulucky committed Feb 25, 2019
1 parent cac0dfd commit 0647a16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions components/cli/pkg/commands/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ func createGcp() error {
// Backup artifacts folder
artiFactsBackupExist, errBackupDir := util.FileExists(filepath.Join(util.UserHomeDir(), constants.CELLERY_HOME, constants.GCP, constants.ARTIFACTS_OLD))
if errBackupDir == nil {
if artiFactsBackupExist{
if artiFactsBackupExist {
if err := os.RemoveAll(filepath.Join(util.UserHomeDir(), constants.CELLERY_HOME, constants.GCP, constants.ARTIFACTS)); err != nil {
fmt.Printf("Error replacing artifacts filel: %v", err)
}
Expand All @@ -432,9 +432,9 @@ func createGcp() error {
util.CopyDir(filepath.Join(util.UserHomeDir(), constants.CELLERY_HOME, constants.GCP, constants.ARTIFACTS), filepath.Join(util.UserHomeDir(), constants.CELLERY_HOME, constants.GCP, constants.ARTIFACTS_OLD))

validateGcpConfigFile([]string{filepath.Join(util.UserHomeDir(), constants.CELLERY_HOME, constants.GCP, constants.ARTIFACTS, constants.K8S_ARTIFACTS, constants.GLOBAL_APIM, constants.CONF, constants.DATA_SOURCES, constants.MASTER_DATA_SOURCES_XML),
filepath.Join(util.UserHomeDir(), constants.CELLERY_HOME, constants.GCP, constants.ARTIFACTS, constants.K8S_ARTIFACTS, constants.OBSERVABILITY, constants.SP, constants.CONF, constants.DEPLOYMENT_YAML),
filepath.Join(util.UserHomeDir(), constants.CELLERY_HOME, constants.GCP, constants.ARTIFACTS, constants.K8S_ARTIFACTS, constants.GLOBAL_APIM, constants.ARTIFACTS_PERSISTENT_VOLUME_YAML),
filepath.Join(util.UserHomeDir(), constants.CELLERY_HOME, constants.GCP, constants.ARTIFACTS, constants.K8S_ARTIFACTS, constants.MYSQL, constants.DB_SCRIPTS, constants.INIT_SQL)})
filepath.Join(util.UserHomeDir(), constants.CELLERY_HOME, constants.GCP, constants.ARTIFACTS, constants.K8S_ARTIFACTS, constants.OBSERVABILITY, constants.SP, constants.CONF, constants.DEPLOYMENT_YAML),
filepath.Join(util.UserHomeDir(), constants.CELLERY_HOME, constants.GCP, constants.ARTIFACTS, constants.K8S_ARTIFACTS, constants.GLOBAL_APIM, constants.ARTIFACTS_PERSISTENT_VOLUME_YAML),
filepath.Join(util.UserHomeDir(), constants.CELLERY_HOME, constants.GCP, constants.ARTIFACTS, constants.K8S_ARTIFACTS, constants.MYSQL, constants.DB_SCRIPTS, constants.INIT_SQL)})

// Get the GCP cluster data
projectName, accountName, region, zone = getGcpData()
Expand Down Expand Up @@ -968,9 +968,9 @@ func deployCelleryRuntime() error {
}

func validateGcpConfigFile(configFiles []string) error {
for i := 0; i < len(configFiles) ; i++ {
for i := 0; i < len(configFiles); i++ {
fileExist, fileExistError := util.FileExists(configFiles[i])
if fileExistError != nil || !fileExist {
if fileExistError != nil || !fileExist {
fmt.Printf("Cannot find file : %v", configFiles[i])
os.Exit(1)
}
Expand Down
2 changes: 1 addition & 1 deletion components/cli/pkg/constants/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ const KUBECTL = "kubectl"
const CREATE = "create"
const APPLY = "apply"
const CONFIG_MAP = "configmap"
const KUBECTL_FLAG = "-f"
const KUBECTL_FLAG = "-f"

0 comments on commit 0647a16

Please sign in to comment.