Skip to content

Commit

Permalink
Fix work dir nested yurthub/yurthub
Browse files Browse the repository at this point in the history
  • Loading branch information
luc99hen committed Sep 6, 2023
1 parent 2ed7f0f commit 02bc52f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/yurthub/certificate/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var (
apiServerClientCertNotReadyError = errors.New("APIServer client certificate")
caCertIsNotReadyError = errors.New("ca.crt file")

DefaultRootDir = "/var/lib"
DefaultWorkDir = filepath.Join("/var/lib", projectinfo.GetHubName())
)

type yurtHubCertManager struct {
Expand All @@ -58,10 +58,12 @@ type yurtHubCertManager struct {
func NewYurtHubCertManager(options *options.YurtHubOptions, remoteServers []*url.URL) (hubCert.YurtCertificateManager, error) {
var clientCertManager hubCert.YurtClientCertificateManager
var err error
var workDir string

workDir := filepath.Join(options.RootDir, projectinfo.GetHubName())
if len(options.RootDir) == 0 {
workDir = filepath.Join(DefaultRootDir, projectinfo.GetHubName())
workDir = DefaultWorkDir
} else {
workDir = options.RootDir
}

if options.BootstrapMode == "kubeletcertificate" {
Expand Down

0 comments on commit 02bc52f

Please sign in to comment.