Skip to content

Commit bb8b05c

Browse files
committed
remove post_script support
1 parent a0074c0 commit bb8b05c

2 files changed

Lines changed: 0 additions & 28 deletions

File tree

defaults.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ nodes: 3
66
k8s_version: 1.31.8
77
px_version: 3.3.1.1
88
stop_after: 6
9-
post_script: show-ip
109
quiet: false
1110
tags: "project=pxdeploy"
1211

px-deploy.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ type Config struct {
4949
K8s_Version string
5050
Px_Version string
5151
Stop_After string
52-
Post_Script string
5352
DryRun bool
5453
NoSync bool
5554
IgnoreVersion bool
@@ -720,16 +719,6 @@ func validate_config(config *Config) []string {
720719
errormsg = append(errormsg, "Script '"+s+"' is not valid Bash")
721720
}
722721
}
723-
if config.Post_Script != "" {
724-
if _, err := os.Stat("scripts/" + config.Post_Script); os.IsNotExist(err) {
725-
errormsg = append(errormsg, "Postscript '"+config.Post_Script+"' does not exist")
726-
}
727-
cmd := exec.Command("bash", "-n", "scripts/"+config.Post_Script)
728-
err := cmd.Run()
729-
if err != nil {
730-
errormsg = append(errormsg, "Postscript '"+config.Post_Script+"' is not valid Bash")
731-
}
732-
}
733722

734723
if config.Platform == "ocp4" {
735724
checkvar := []string{"ocp4_domain", "ocp4_pull_secret"}
@@ -1876,22 +1865,6 @@ func write_nodescripts(config Config) {
18761865
}
18771866
}
18781867

1879-
// add post_script if defined
1880-
if config.Post_Script != "" {
1881-
content, err := os.ReadFile("/px-deploy/.px-deploy/scripts/" + config.Post_Script)
1882-
if err == nil {
1883-
tf_post_script = append(tf_post_script, "(\n"...)
1884-
tf_post_script = append(tf_post_script, "echo \"Started $(date)\"\n"...)
1885-
tf_post_script = append(tf_post_script, "echo \""+config.Post_Script+"_start,$(date +%s)\" >>/var/log/px-deploy/script_tracking\n"...)
1886-
tf_post_script = append(tf_post_script, content...)
1887-
tf_post_script = append(tf_post_script, "\necho \"Finished $(date)\"\n"...)
1888-
tf_post_script = append(tf_post_script, "echo \""+config.Post_Script+"_stop,$(date +%s)\" >>/var/log/px-deploy/script_tracking\n"...)
1889-
tf_post_script = append(tf_post_script, "\n) >&/var/log/px-deploy/"+config.Post_Script+"\n"...)
1890-
}
1891-
} else {
1892-
tf_post_script = nil
1893-
}
1894-
18951868
// loop clusters (masters and nodes) to build tfvars and master/node scripts
18961869
for c := 1; c <= Clusters; c++ {
18971870
masternum := strconv.Itoa(c)

0 commit comments

Comments
 (0)