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

cluster: add option for tmpdir #2505

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/cluster/command/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ it will check the new instances `,
cmd.Flags().BoolVar(&opt.ApplyFix, "apply", false, "Try to fix failed checks")
cmd.Flags().BoolVar(&opt.ExistCluster, "cluster", false, "Check existing cluster, the input is a cluster name.")
cmd.Flags().Uint64Var(&gOpt.APITimeout, "api-timeout", 10, "Timeout in seconds when querying PD APIs.")
cmd.Flags().StringVarP(&opt.TempDir, "tempdir", "t", "/tmp/tiup", "The temporary directory.")

return cmd
}
6 changes: 4 additions & 2 deletions pkg/cluster/manager/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ type CheckOptions struct {
IdentityFile string // path to the private key file
UsePassword bool // use password instead of identity file for ssh connection
Opr *operator.CheckOptions
ApplyFix bool // try to apply fixes of failed checks
ExistCluster bool // check an exist cluster
ApplyFix bool // try to apply fixes of failed checks
ExistCluster bool // check an exist cluster
TempDir string // tempdir
}

// CheckCluster check cluster before deploying or upgrading
Expand Down Expand Up @@ -188,6 +189,7 @@ func checkSystemInfo(
applyFixTasks []*task.StepDisplay
downloadTasks []*task.StepDisplay
)
task.CheckToolsPathDir = opt.TempDir
logger := ctx.Value(logprinter.ContextKeyLogger).(*logprinter.Logger)
insightVer := ""

Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/task/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var (
)

// place the check utilities are stored
const (
var (
CheckToolsPathDir = "/tmp/tiup"
)

Expand Down
Loading