Skip to content

Commit

Permalink
Release v0.6.16 (#1268)
Browse files Browse the repository at this point in the history
* feat(nhctl): add ui

* feat(api): supports for ldap

* feat(nhctl): list applications

* start devmode

* move dev start out of dev

* feat(nhctl): add view logs ui

* feat(nhctl): add debuger adapter dev config

* using vcluster for testcase

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

* feature(nhctl): optimize code

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

* fix(api): override with host kubeconfig cluster

Signed-off-by: yuyicai <yuyicai@hotmail.com>
Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

* feat(workflow): change build script for syncthing-osx-arm

* feature(nhctl): using dev space detail to get kubeconfig

* feature(nhctl): remove reset

* feat: recover port-forward use labels

* feature(nhctl): remove apply for temporary

* feat: update for go module

* feat(api): fix for test search

* feat(nhctl): fail when tiemout while kubeconfig check

* feature(nhctl): update vcluster version from 0.4.5 --> 0.5.2

* feature(nhctl): get vcluster account info from env

* feat(nhctl): support specify dev container name

* feat(nhctl): optmize for kubeconfig check

* fix(nhctl): fix the bugs with same container/dev-container name

* fix(nhctl): fix system:anonymous issues with wrong config factory

* feat(nhctl): supports display syncthing gui host

* add testcase for parse app name from annotation

* feat(nhctl): supports multiple cluster for same svc

* feat(workflow): push arm64-linux to coding-repo

* feat(nhctl): supports enter dev pod directly when using dev terminal

* add sleep time for parsing app from annotation

* feat(nhctl): add dev terminal

* Feature/optimize list ns (#1210)

* fix parse app from annotation

* Hotfix(nhctl): still add . to Kind.Version.Group while group is empty

* optimize list ns

* npe

* finish optimize list ns

Co-authored-by: p_caiwfeng <p_caiwfeng@tencent.com>

* feat(nhctl): fix for nid obtaining

* feat(nhctl): supports recursion application resolve via annotations

* feat(nhctl): optimize resource mapping gvk-2-gvr

* merge(nhctl): merge from dev

* add port-forward

* feat(nhctl): add informer for rs

* feat(nhctl): change rollingupdate to recreate

* feat(nhctl): optimize vpn logic (#1226)

* optimize vpn logic

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

* optimize vpn logic

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

* optimize vpn logic

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

* optimize tips

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

* using sigle patch to improve performance

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

Co-authored-by: p_caiwfeng <p_caiwfeng@tencent.com>

* hotfix(nhclt): fix vpn CIDR issue (#1225)

* fix vpn CIDR issue

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

* optimize get CIDR logic

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

* fix import not correct

Co-authored-by: p_caiwfeng <p_caiwfeng@tencent.com>

* feat(nhctl): add [duplicate dev mode] in cli

* feat(nhctl): add [install application] in cli

* feat(nhctl): fix exec pod when first enter devmode

* feat(nhctl): fix adaptor for nid associate

* feat(nhctl): fix profile is empty after dev associate

* feat(nhctl): add [View Profile & View DB Data]

* feat(nhctl): remove rawConfig

* feat(nhctl): recover daemon_status.go

* feat(nhctl): remove [config template]

* feat(nhctl): remove NocalhostSvc in common

* feat(nhctl): remove NocalhostApp in common

* feat(nhctl): optimize daemon client wait for stream logic (#1240)

* optimize daemon client wait for stream logic

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

* feat(nhctl): in case of NPE

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

Co-authored-by: p_caiwfeng <p_caiwfeng@tencent.com>

* feat(nhctl): add [Uninstall Application] in ui

* feat(nhctl): fix merge err

* fix vpn status issue

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

* feat(nhctl): fix some mac address issue

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

* fix get mac address logic

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

* feat(nhctl): not need to check permission if vpn elevate is failed

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

* fix(nhctl): fix tpl err

* fix(nhctl): fix sync err

* detect conflict tun device and disable it

* feat(nhctl): VPN support CRD (#1246)

* VPN support CRD

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

* feat(nhctl): support port-forward

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

* feat(nhctl): remove detect conflict route temporary

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

Co-authored-by: p_caiwfeng <p_caiwfeng@tencent.com>

* fix associate queryer npe (#1247)

Signed-off-by: p_caiwfeng <p_caiwfeng@tencent.com>

Co-authored-by: p_caiwfeng <p_caiwfeng@tencent.com>

* use github action to create vcluster

* feat(nhctl): use GitHub workflow to create vCluster

* fix npe

* fix get pne (#1248)

Co-authored-by: p_caiwfeng <p_caiwfeng@tencent.com>

* fix(nhctl): fix sudo daemon server

* fix(nhctl): fix sudo daemon server

* fix(nhctl): fix sudo daemon server

* fix zombie process

Signed-off-by: thinkhp <thinkhp@126.com>

* optimize logic

* feat(nhctl): reset when end devmode failed (#1236)

Co-authored-by: name <name>

* associate add nid parameter

* fix typo

* Revert "Fix sudo daemon err"

* fix command-get associate dir not immediate issue (#1267)

* fix command-get associate dir not immediate issue

* flush cache

* flush cache

Co-authored-by: p_caiwfeng <p_caiwfeng@tencent.com>

* fix can not found route pod while reverse resources (#1266)

Co-authored-by: p_caiwfeng <p_caiwfeng@tencent.com>

* fix #1269:nhctl get some workload develop_status is none when enter dup mode

Signed-off-by: thinkhp <thinkhp@126.com>

Co-authored-by: name <name>
Co-authored-by: anurnomeru <anurnomeru@163.com>
Co-authored-by: p_caiwfeng <p_caiwfeng@tencent.com>
Co-authored-by: yuyicai <yuyicai@hotmail.com>
Co-authored-by: xinxinh <2011150377@email.szu.edu.cn>
Co-authored-by: thinkhp <thinkhp@126.com>
  • Loading branch information
6 people committed Mar 25, 2022
1 parent c99ef87 commit 8cbfcc2
Show file tree
Hide file tree
Showing 457 changed files with 55,402 additions and 4,146 deletions.
1 change: 1 addition & 0 deletions .github/workflows/nhctl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ jobs:
./build.sh artifact mac-arm64 dev ${GITHUB_SHA}
go run build.go -nocalhostVersion=dev -nocalhostCommitId="${GITHUB_SHA}" -goarch amd64 zip
go run build.go -nocalhostVersion=dev -nocalhostCommitId="${GITHUB_SHA}" -goos=windows -goarch amd64 zip
go run build.go -gocmd ./xgo.sh -nocalhostVersion=dev -nocalhostCommitId="${GITHUB_SHA}" -goarch arm64 zip
- name: Push to Coding Articact
working-directory: ./syncthing-source
Expand Down
44 changes: 24 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
release-nhctl:
needs: [build-syncthing-macos-windows, build-syncthing-linux]
needs: [ build-syncthing-macos-windows, build-syncthing-linux ]
name: Release nhctl
runs-on: macos-latest
environment:
Expand Down Expand Up @@ -201,20 +201,24 @@ jobs:
OSX_BINARY: 'nhctl-darwin-amd64'
OSX_ARM64_BINARY: 'nhctl-darwin-arm64'
LINUX_BINARY: 'nhctl-linux-amd64'
LINUX_ARM_BINARY: 'nhctl-linux-arm64'
run: |
cd build
curl -T ${WINDOWS_BINARY} -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://nocalhost-generic.pkg.coding.net/nocalhost/nhctl/${WINDOWS_BINARY}?version=${GITHUB_SHA}"
curl -T ${OSX_BINARY} -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://nocalhost-generic.pkg.coding.net/nocalhost/nhctl/${OSX_BINARY}?version=${GITHUB_SHA}"
curl -T ${OSX_ARM64_BINARY} -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://nocalhost-generic.pkg.coding.net/nocalhost/nhctl/${OSX_ARM64_BINARY}?version=${GITHUB_SHA}"
curl -T ${LINUX_BINARY} -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://nocalhost-generic.pkg.coding.net/nocalhost/nhctl/${LINUX_BINARY}?version=${GITHUB_SHA}"
curl -T ${LINUX_ARM_BINARY} -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://nocalhost-generic.pkg.coding.net/nocalhost/nhctl/${LINUX_ARM_BINARY}?version=${GITHUB_SHA}"
curl -T ${WINDOWS_BINARY} -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://nocalhost-generic.pkg.coding.net/nocalhost/nhctl/${WINDOWS_BINARY}?version=latest"
curl -T ${OSX_BINARY} -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://nocalhost-generic.pkg.coding.net/nocalhost/nhctl/${OSX_BINARY}?version=latest"
curl -T ${OSX_ARM64_BINARY} -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://nocalhost-generic.pkg.coding.net/nocalhost/nhctl/${OSX_ARM64_BINARY}?version=latest"
curl -T ${LINUX_BINARY} -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://nocalhost-generic.pkg.coding.net/nocalhost/nhctl/${LINUX_BINARY}?version=latest"
curl -T ${LINUX_ARM_BINARY} -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://nocalhost-generic.pkg.coding.net/nocalhost/nhctl/${LINUX_ARM_BINARY}?version=latest"
curl -T ${WINDOWS_BINARY} -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://nocalhost-generic.pkg.coding.net/nocalhost/nhctl/${WINDOWS_BINARY}?version=${{ env.RELEASE_VERSION }}"
curl -T ${OSX_BINARY} -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://nocalhost-generic.pkg.coding.net/nocalhost/nhctl/${OSX_BINARY}?version=${{ env.RELEASE_VERSION }}"
curl -T ${OSX_ARM64_BINARY} -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://nocalhost-generic.pkg.coding.net/nocalhost/nhctl/${OSX_ARM64_BINARY}?version=${{ env.RELEASE_VERSION }}"
curl -T ${LINUX_BINARY} -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://nocalhost-generic.pkg.coding.net/nocalhost/nhctl/${LINUX_BINARY}?version=${{ env.RELEASE_VERSION }}"
curl -T ${LINUX_ARM_BINARY} -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://nocalhost-generic.pkg.coding.net/nocalhost/nhctl/${LINUX_ARM_BINARY}?version=${{ env.RELEASE_VERSION }}"
- name: Update Homebrew tap
if: "!contains(github.ref,'rc')"
Expand Down Expand Up @@ -244,24 +248,24 @@ jobs:
runs-on: ubuntu-latest
steps:

# - name: Update changelog
# run: |
# git clone -b dev https://github.com/nocalhost/nocalhost.github.io.git
# cd nocalhost.github.io
# git checkout -b release/${{ env.RELEASE_VERSION }} || true
# git checkout release/${{ env.RELEASE_VERSION }} || true
# cd docs/changelogs
# git config user.email "nocalhost@nocalhost.dev"
# git config user.name "nocalhost"
# time=${{ env.RELEASE_VERSION }}" ("$(date "+%Y-%m-%d")")"
# echo $time
# sed -i "s/{{Next}}/$time/g" *.md
# head *.md
# cd ../../
# git add .
# git commit -m "update changelog"
# git remote set-url origin https://${{ secrets.GPR_USER }}:${{ secrets.GPR_PASS }}@github.com/nocalhost/nocalhost.github.io.git
# git push origin release/${{ env.RELEASE_VERSION }} -f
# - name: Update changelog
# run: |
# git clone -b dev https://github.com/nocalhost/nocalhost.github.io.git
# cd nocalhost.github.io
# git checkout -b release/${{ env.RELEASE_VERSION }} || true
# git checkout release/${{ env.RELEASE_VERSION }} || true
# cd docs/changelogs
# git config user.email "nocalhost@nocalhost.dev"
# git config user.name "nocalhost"
# time=${{ env.RELEASE_VERSION }}" ("$(date "+%Y-%m-%d")")"
# echo $time
# sed -i "s/{{Next}}/$time/g" *.md
# head *.md
# cd ../../
# git add .
# git commit -m "update changelog"
# git remote set-url origin https://${{ secrets.GPR_USER }}:${{ secrets.GPR_PASS }}@github.com/nocalhost/nocalhost.github.io.git
# git push origin release/${{ env.RELEASE_VERSION }} -f

- name: Set up Go 1.x
uses: actions/setup-go@v2
Expand Down Expand Up @@ -496,7 +500,7 @@ jobs:
release-helm-chart:
name: Release Nocalhost Helm Chart
needs: [release-nhctl, release-docker-image]
needs: [ release-nhctl, release-docker-image ]
runs-on: ubuntu-latest
steps:
- name: Check out code
Expand Down
137 changes: 18 additions & 119 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,16 @@ jobs:
wait "DescribeArtifactProperties" "public" "nocalhost-api" $COMMIT_ID
echo 'wait for nocalhost-dep'
wait "DescribeArtifactProperties" "public" "nocalhost-dep" $COMMIT_ID
linux:
runs-on: ubuntu-latest
test:
runs-on: ${{ matrix.os }}
needs: [ "image" ]
strategy:
matrix:
os: [
ubuntu-latest,
macos-latest,
windows-latest,
]
steps:
- uses: actions/checkout@master
timeout-minutes: 10
Expand All @@ -83,85 +90,15 @@ jobs:
uses: Azure/setup-kubectl@v1
- name: Helm tool installer
uses: Azure/setup-helm@v1
- name: Testing
run: |
export TAG="${{ env.RELEASE_VERSION }}"
export COMMIT_ID=${GITHUB_SHA}
export TKE_SECRET_ID=${{ secrets.TKE_SECRET_ID }}
export TKE_SECRET_KEY=${{ secrets.TKE_SECRET_KEY }}
export TIMEOUT_WEBHOOK=${{ secrets.TIMEOUT_WEBHOOK }}
export TESTCASE_WEBHOOK=${{ secrets.TESTCASE_WEBHOOK }}
export HELM_REPO_USERNAME=${{ secrets.CODING_ARTIFACTS_USER }}
export HELM_REPO_PASSWORD=${{ secrets.CODING_ARTIFACTS_PASS }}
export DISABLE_SPINNER=true
cd test
go build
./test
macos:
runs-on: macos-latest
needs: [ "image" ]
steps:
- uses: actions/checkout@master
timeout-minutes: 10
- uses: actions/setup-go@v2
with:
go-version: '1.16.7'
- run: go version
- name: git tag
if: ${{ github.event.workflow_run.conclusion == 'success' }}
timeout-minutes: 10
run: |
git fetch --prune --unshallow --tags
TAG=$(git tag -l --sort=v:refname | tail -2 | xargs)
echo $TAG
echo "RELEASE_VERSION=${TAG}" >> $GITHUB_ENV
shell: bash
- name: Kubectl tool installer
uses: Azure/setup-kubectl@v1
- name: Helm tool installer
uses: Azure/setup-helm@v1
- name: Testing
shell: bash
run: |
export TAG="${{ env.RELEASE_VERSION }}"
export COMMIT_ID=${GITHUB_SHA}
export TKE_SECRET_ID=${{ secrets.TKE_SECRET_ID }}
export TKE_SECRET_KEY=${{ secrets.TKE_SECRET_KEY }}
export TIMEOUT_WEBHOOK=${{ secrets.TIMEOUT_WEBHOOK }}
export TESTCASE_WEBHOOK=${{ secrets.TESTCASE_WEBHOOK }}
export HELM_REPO_USERNAME=${{ secrets.CODING_ARTIFACTS_USER }}
export HELM_REPO_PASSWORD=${{ secrets.CODING_ARTIFACTS_PASS }}
export DISABLE_SPINNER=true
cd test
go build
./test
windows:
runs-on: windows-latest
needs: [ "image" ]
steps:
- uses: actions/checkout@master
timeout-minutes: 10
- uses: actions/setup-go@v2
- uses: zhangjian10/nocalhost-server-cli@latest
with:
go-version: '1.16.7'
- run: go version
- name: git tag
if: ${{ github.event.workflow_run.conclusion == 'success' }}
timeout-minutes: 10
run: |
git fetch --prune --unshallow --tags
TAG=$(git tag -l --sort=v:refname | tail -2 | xargs)
echo $TAG
echo "RELEASE_VERSION=${TAG}" >> $GITHUB_ENV
shell: bash
- name: Kubectl tool installer
uses: Azure/setup-kubectl@v1
- name: Helm tool installer
uses: Azure/setup-helm@v1
host: ${{ secrets.NOCALHOST_VCLUSTER_HOST_FOR_TEST }}
email: ${{ secrets.NOCALHOST_VCLUSTER_EMAIL_FOR_TEST }}
password: ${{ secrets.NOCALHOST_VCLUSTER_PASSWORD_FOR_TEST }}
action: devSpace.create
- name: Testing
shell: bash
run: |
echo ${{ env.RELEASE_VERSION }}
export TAG="${{ env.RELEASE_VERSION }}"
export COMMIT_ID=${GITHUB_SHA}
export TKE_SECRET_ID=${{ secrets.TKE_SECRET_ID }}
Expand All @@ -170,48 +107,10 @@ jobs:
export TESTCASE_WEBHOOK=${{ secrets.TESTCASE_WEBHOOK }}
export HELM_REPO_USERNAME=${{ secrets.CODING_ARTIFACTS_USER }}
export HELM_REPO_PASSWORD=${{ secrets.CODING_ARTIFACTS_PASS }}
export NOCALHOST_VCLUSTER_HOST_FOR_TEST=${{ secrets.NOCALHOST_VCLUSTER_HOST_FOR_TEST }}
export NOCALHOST_VCLUSTER_EMAIL_FOR_TEST=${{ secrets.NOCALHOST_VCLUSTER_EMAIL_FOR_TEST }}
export NOCALHOST_VCLUSTER_PASSWORD_FOR_TEST=${{ secrets.NOCALHOST_VCLUSTER_PASSWORD_FOR_TEST }}
export DISABLE_SPINNER=true
cd test
go build
./test
# minikube-linux:
# runs-on: ubuntu-latest
# needs: [ "image" ]
# steps:
# - uses: actions/checkout@master
# timeout-minutes: 10
# - uses: actions/setup-go@v2
# with:
# go-version: '1.16.7'
# - run: go version
# - name: git tag
# timeout-minutes: 10
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
# run: |
# git fetch --prune --unshallow --tags
# TAG=$(git tag -l --sort=v:refname | tail -2 | xargs)
# echo $TAG
# echo "RELEASE_VERSION=${TAG}" >> $GITHUB_ENV
# shell: bash
# - name: Setup Minikube
# timeout-minutes: 30
# uses: medyagh/setup-minikube@master
# - name: Sleep 180 seconds waiting for minikube ready
# run: sleep 180
# - name: Kubernetes info
# timeout-minutes: 5
# run: |
# kubectl cluster-info
# kubectl get pods -n kube-system
# cat ~/.kube/config
# ls -lah ~/.kube/config
# - name: Testing
# run: |
# export TAG="${{ env.RELEASE_VERSION }}"
# export COMMIT_ID=${GITHUB_SHA}
# export KUBECONFIG_PATH=/home/runner/.kube/config
# export TESTCASE_WEBHOOK=${{ secrets.TESTCASE_WEBHOOK }}
# cd test
# go build
# ./test
./test
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ In order to give you a better understanding of Nocalhost, it is recommended that

### IDE Supports

Nocalhost provides easy-to-use IDE extensions for JetBrains and VSCode. These extensions will enable developer to develop and debug cloud-based application in their local machine.
Nocalhost provides easy-to-use IDE extension for JetBrains and VSCode. These extension will enable developer to develop and debug cloud-based application in their local machine.

## Start cloud-native application development in one click

Expand Down
6 changes: 4 additions & 2 deletions cmd/nhctl/cmds/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package cmds
import (
"github.com/pkg/errors"
"github.com/spf13/cobra"
"nocalhost/cmd/nhctl/cmds/common"
"nocalhost/internal/nhctl/app"
"nocalhost/pkg/nhctl/clientgoutils"
"nocalhost/pkg/nhctl/log"
Expand All @@ -31,10 +32,11 @@ var applyCmd = &cobra.Command{
applicationName := args[0]
path := args[1]

initApp(applicationName)
nocalhostApp, err := common.InitApp(applicationName)
must(err)
manifests := clientgoutils.LoadValidManifest([]string{path})

err := nocalhostApp.GetClient().Apply(
err = nocalhostApp.GetClient().Apply(
manifests, false,
app.StandardNocalhostMetas(nocalhostApp.Name, nocalhostApp.NameSpace), "",
)
Expand Down
3 changes: 2 additions & 1 deletion cmd/nhctl/cmds/check_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"fmt"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"nocalhost/cmd/nhctl/cmds/common"
"nocalhost/internal/nhctl/daemon_client"

//"github.com/syncthing/syncthing/lib/discover"
Expand Down Expand Up @@ -37,7 +38,7 @@ var checkClusterCmd = &cobra.Command{
fmt.Println(string(bys))
}()

err := checkClusterAvailable(kubeConfig)
err := checkClusterAvailable(common.KubeConfig)
if err != nil {
jsonResp.Code = 201
jsonResp.Info = err.Error()
Expand Down
24 changes: 24 additions & 0 deletions cmd/nhctl/cmds/cli.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
* This source code is licensed under the Apache License Version 2.0.
*/

package cmds

import (
"github.com/spf13/cobra"
"nocalhost/internal/nhctl/ui"
)

func init() {
rootCmd.AddCommand(cli2Command)
}

var cli2Command = &cobra.Command{
Use: "cli",
Short: "",
Long: ``,
Run: func(cmd *cobra.Command, args []string) {
ui.RunTviewApplication()
},
}
12 changes: 12 additions & 0 deletions cmd/nhctl/cmds/cli_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
* This source code is licensed under the Apache License Version 2.0.
*/

package cmds

import "testing"

func TestRunTviewApplication(t *testing.T) {
//RunTviewApplication()
}
Loading

0 comments on commit 8cbfcc2

Please sign in to comment.