Skip to content

Commit

Permalink
chore: update project configuration and file headers
Browse files Browse the repository at this point in the history
- Change the company name and website in the license header
- Add a new staticcheck rule in the golangci.yml file
- Remove the color package import in the cmd/app/list.go file

Signed-off-by: ysicing <[email protected]>
  • Loading branch information
ysicing committed Jul 17, 2024
1 parent aa96cec commit fa48974
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .go-header.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2021-2023 北京渠成软件有限公司(Beijing Qucheng Software Co., Ltd. www.qucheng.com) All rights reserved.
Copyright (c) 2021-2024 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net) All rights reserved.
Use of this source code is covered by the following dual licenses:
(1) Z PUBLIC LICENSE 1.2 (ZPL 1.2)
(2) Affero General Public License 3.0 (AGPL 3.0)
Expand Down
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ issues:
- linters:
- goheader
text: "rights reserved"
- linters:
- staticcheck
text: "SA1019: common.ZenTaoOldOSSType is deprecated"
exclude-dirs:
- hack/bin
- testdata$
Expand Down
33 changes: 0 additions & 33 deletions cmd/app/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ import (
"fmt"

"github.com/cockroachdb/errors"
"github.com/ergoapi/util/color"
"github.com/manifoldco/promptui"
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/labels"

"github.com/easysoft/qcadmin/internal/pkg/k8s"
"github.com/easysoft/qcadmin/internal/pkg/util/factory"
"github.com/easysoft/qcadmin/internal/pkg/util/helm"
"github.com/easysoft/qcadmin/internal/pkg/util/kutil"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down Expand Up @@ -58,37 +56,6 @@ func NewCmdAppList(f factory.Factory) *cobra.Command {
}
it, _, _ := selectApp.Run()
log.Infof("select app: %s", release[it].Name)

selectInfo := promptui.Select{
Label: "select action: meta get url info, svc get container service message",
Items: []string{"meta", "svc"},
}
_, infoAction, _ := selectInfo.Run()
if infoAction == "meta" {
values, err := hc.GetAllValues(release[it].Name)
if err != nil {
return err
}
host := getMapValue(getMap(getMap(values, "global"), "ingress"), "host")
if len(host) != 0 {
if kutil.IsLegalDomain(host) {
host = fmt.Sprintf("https://%s", host)
} else {
host = fmt.Sprintf("http://%s", host)
}
}
auth := getMap(values, "auth")
if auth != nil {
authUsername := getMapValue(auth, "username")
authPassword := getMapValue(auth, "password")
log.Debugf("authUsername: %s, authPassword: %s", authUsername, authPassword)
log.Infof("app meta:\n\t username: %s\n\t password: %s\n\t url: %s", color.SBlue(authUsername), color.SBlue(authPassword), color.SBlue(host))
} else {
log.Infof("app meta:\n\t url: %s", color.SBlue(host))
}
return nil
}

k8sClient, err := k8s.NewSimpleClient()
if err != nil {
log.Errorf("k8s client err: %v", err)
Expand Down
8 changes: 4 additions & 4 deletions cmd/app/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ func NewCmdAppRestart(f factory.Factory) *cobra.Command {
log := f.GetLog()
var useip bool
app := &cobra.Command{
Use: "restart",
Short: "restart app",
Args: cobra.ExactArgs(1),
Example: `z app`,
Use: "restart",
Short: "restart app",
Args: cobra.ExactArgs(1),
Example: `z app`,
RunE: func(cmd *cobra.Command, args []string) error {
url := args[0]
apidebug := log.GetLevel() == logrus.DebugLevel
Expand Down
Empty file modified hack/manifests/scripts/etcd-snapshot.sh
100644 → 100755
Empty file.
Empty file modified hack/manifests/scripts/kubectl-restart.sh
100644 → 100755
Empty file.
4 changes: 4 additions & 0 deletions hack/manifests/scripts/upgrade-ingress.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

z helm repo update
z helm upgrade -i ingress install/nginx-ingress-controller -n quickon-system

0 comments on commit fa48974

Please sign in to comment.