From 2422953c616d53cb48dfabf9069d4b5fb5e6d279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BC=98=E7=94=9F?= Date: Mon, 18 Jul 2022 17:48:26 +0800 Subject: [PATCH] fix(dir): fix dir perm (#41) fix(dir): fix dir perm --- VERSION | 2 +- cmd/boot/boot.go | 3 +++ common/const.go | 2 ++ hack/manifests/plugins/plugins.json | 4 ++-- hack/scripts/get.edge.sh | 8 ++++++++ hack/scripts/get.sh | 8 ++++++++ 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index b0f3d96f..66c4c226 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.8 +1.0.9 diff --git a/cmd/boot/boot.go b/cmd/boot/boot.go index b9de8806..5ac8268c 100644 --- a/cmd/boot/boot.go +++ b/cmd/boot/boot.go @@ -31,6 +31,9 @@ func initRootDirectory() error { return errors.Errorf("failed to mkdir %s, err: %s", dir, err) } } + if err := os.MkdirAll(common.DefaultQuickonDir, common.FileMode0777); err != nil { + return errors.Errorf("failed to mkdir %s, err: %s", common.DefaultQuickonDir, err) + } return nil } diff --git a/common/const.go b/common/const.go index e5399ce5..0078ed8d 100644 --- a/common/const.go +++ b/common/const.go @@ -9,6 +9,7 @@ package common import "time" const ( + FileMode0777 = 0o777 FileMode0755 = 0o755 FileMode0644 = 0o644 FileMode0600 = 0o600 @@ -21,6 +22,7 @@ const ( DefaultBinDir = ".qc/bin" DefaultCfgDir = ".qc/config" DefaultCacheDir = ".qc/cache" + DefaultQuickonDir = "/opt/quickon/backup" ) const ( diff --git a/hack/manifests/plugins/plugins.json b/hack/manifests/plugins/plugins.json index 192ec5e2..20fe6438 100644 --- a/hack/manifests/plugins/plugins.json +++ b/hack/manifests/plugins/plugins.json @@ -69,9 +69,9 @@ { "name": "cne-operator", "description": "渠成云原生应用交付平台控制器", - "version": "1.1.1", + "version": "1.1.2", "home": "https://www.qucheng.com", - "appversion": "1.1.1", + "appversion": "1.1.2", "path": "cne-operator", "tool": "helm", "builtin": true diff --git a/hack/scripts/get.edge.sh b/hack/scripts/get.edge.sh index 36c0968c..56bc0dae 100755 --- a/hack/scripts/get.edge.sh +++ b/hack/scripts/get.edge.sh @@ -66,6 +66,13 @@ setup_tmp() { trap cleanup INT EXIT } +setup_quickon() { + [ -d "/opt/quickon/backup" ] || ( + mkdir -p /opt/quickon/backup + chmod 777 /opt/quickon/backup + ) +} + # --- use desired qcadmin version if defined or find version from channel --- get_release_version() { VERSION="edge" @@ -142,6 +149,7 @@ download_and_verify() { setup_verify_arch verify_downloader curl || verify_downloader wget || fatal 'Can not find curl or wget for downloading files' setup_tmp + setup_quickon get_release_version # Skip download if qcadmin binary exists, support upgrade download_binary diff --git a/hack/scripts/get.sh b/hack/scripts/get.sh index 577c638c..59bb2c07 100755 --- a/hack/scripts/get.sh +++ b/hack/scripts/get.sh @@ -66,6 +66,13 @@ setup_tmp() { trap cleanup INT EXIT } +setup_quickon() { + [ -d "/opt/quickon/backup" ] || ( + mkdir -p /opt/quickon/backup + chmod 777 /opt/quickon/backup + ) +} + # --- use desired qcadmin version if defined or find version from channel --- get_release_version() { VERSION="stable" @@ -142,6 +149,7 @@ download_and_verify() { setup_verify_arch verify_downloader curl || verify_downloader wget || fatal 'Can not find curl or wget for downloading files' setup_tmp + setup_quickon get_release_version # Skip download if qcadmin binary exists, support upgrade download_binary