diff --git a/.github/workflows/test-mock.yml b/.github/workflows/test-mock.yml index 13d3c2d..4c211d7 100644 --- a/.github/workflows/test-mock.yml +++ b/.github/workflows/test-mock.yml @@ -4,6 +4,7 @@ on: paths: - '.github/workflows/test-mock.yml' - 'cli/**' + - 'logger/**' - 'scripts/**' - 'go.mod' - 'go.sum' @@ -12,13 +13,19 @@ on: push: paths: - 'scripts/**' + - 'logger/**' - 'cli/**' - '.github/workflows/test-mock.yml' - 'go.mod' - 'go.sum' branches: [ main ] + jobs: - ksctl-cli-windows: + ksctl-cli: + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + if: | ( github.event.label.name == 'pr/lgtm' || @@ -27,273 +34,202 @@ jobs: github.event_name == 'push' && github.ref == 'refs/heads/main' ) - runs-on: windows-latest + runs-on: ${{ matrix.os }} env: KSCTL_FAKE_FLAG_ENABLED: "1" steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.4 - name: Set up Go uses: actions/setup-go@v4 with: - go-version: 1.21.0 + go-version: 1.22.3 - - name: build ksctl + - name: build ksctl windows + if: ${{ matrix.os == 'windows-latest' }} run: | + Set-PSDebug -Trace 2 cd .\scripts .\builder.ps1 - cd C:\Users\runneradmin\AppData\Local\ksctl - .\ksctl.exe version + echo "KSCTL_BIN=$env:LOCALAPPDATA\ksctl\ksctl.exe" >> $env:GITHUB_ENV - - name: civo create - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' + - name: build ksctl linux + if: ${{ matrix.os == 'ubuntu-latest' }} run: | - .\ksctl.exe create civo -n demo -r LON1 --nodeSizeMP "g4s.kube.small" --version 1.27.1 --verbose -1 -s local --approve - .\ksctl.exe create ha-civo -n ha-demo --nodeSizeDS "fake.small" --version 1.27.1 --nodeSizeLB "fake.small" --nodeSizeCP "fake.small" --nodeSizeWP "fake.small" -s local -r LON1 --verbose -1 --approve + set -x + make install_linux + echo "KSCTL_BIN=ksctl" >> "${GITHUB_ENV}" - - name: azure create - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' + - name: build ksctl macos + if: ${{ matrix.os == 'macos-latest' }} run: | - .\ksctl.exe create azure -n demo -r fake --nodeSizeMP "fake" -s local --version 1.27.1 --verbose -1 --approve - .\ksctl.exe create ha-azure -n ha-demo --nodeSizeDS "fake" --version 1.27.1 --nodeSizeLB "fake" --nodeSizeCP "fake" --nodeSizeWP "fake" -r fake --verbose -1 -s local --approve + set -x + make install_macos_intel + echo "KSCTL_BIN=ksctl" >> "${GITHUB_ENV}" - - name: aws create - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' + - name: version run: | - # .\ksctl.exe create aws -n demo -r fake --nodeSizeMP "fake" --version 1.27.1 -s local --verbose -1 --approve - .\ksctl.exe create ha-aws -n ha-demo --nodeSizeDS "fake" --version 1.27.1 --nodeSizeLB "fake" --nodeSizeCP "fake" --nodeSizeWP "fake" -r fake --verbose -1 -s local --approve + ${{ env.KSCTL_BIN }} version - - name: local create - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' + - name: civo create run: | - .\ksctl.exe create local -n demolocal --version 1.27.1 --verbose -1 -s local --approve + ${{ env.KSCTL_BIN }} create civo -n demo -r LON1 --nodeSizeMP "g4s.kube.small" --version 1.27.1 --verbose -1 -s store-local --yes - - name: civo get - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' - run: | - .\ksctl.exe get -s local -p civo + ${{env.KSCTL_BIN}} create ha-civo -n ha-demo-k3s --nodeSizeDS "fake.small" --version 1.27.1 --nodeSizeLB "fake.small" --nodeSizeCP "fake.small" --nodeSizeWP "fake.small" -s store-local -r LON1 --verbose -1 --yes --bootstrap k3s - - name: azure get - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' - run: | - .\ksctl.exe get -s local -p azure + ${{env.KSCTL_BIN}} create ha-civo -n ha-demo-kubeadm --nodeSizeDS "fake.small" --version 1.28 --nodeSizeLB "fake.small" --nodeSizeCP "fake.small" --nodeSizeWP "fake.small" -s store-local -r LON1 --verbose -1 --yes --bootstrap kubeadm - - name: aws get - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' + - name: azure create run: | - .\ksctl.exe get -s local -p aws + ${{env.KSCTL_BIN}} create azure -n demo -r fake --nodeSizeMP "fake" -s store-local --version 1.27.1 --verbose -1 --yes - - name: get all - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' - run: | - .\ksctl.exe get -s local + ${{env.KSCTL_BIN}} create ha-azure -n ha-demo-k3s --nodeSizeDS "fake" --version 1.27.1 --nodeSizeLB "fake" --nodeSizeCP "fake" --nodeSizeWP "fake" -r fake --verbose -1 -s store-local --yes --bootstrap k3s - - name: civo switch - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' - run: | - .\ksctl.exe switch -p civo -n demo -s local -r LON1 - .\ksctl.exe switch -p ha-civo -n ha-demo -s local -r LON1 + ${{env.KSCTL_BIN}} create ha-azure -n ha-demo-kubeadm --nodeSizeDS "fake" --version 1.28 --nodeSizeLB "fake" --nodeSizeCP "fake" --nodeSizeWP "fake" -r fake --verbose -1 -s store-local --yes --bootstrap kubeadm - - name: aws switch - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' + - name: aws create run: | - # .\ksctl.exe switch -p aws -n demo -s local -r fake - .\ksctl.exe switch -p ha-aws -n ha-demo -s local -r fake + # ${{env.KSCTL_BIN}} create aws -n demo -r fake --nodeSizeMP "fake" --version 1.27.1 -s store-local --verbose -1 --yes + + ${{env.KSCTL_BIN}} create ha-aws -n ha-demo-k3s --nodeSizeDS "fake" --version 1.27.1 --nodeSizeLB "fake" --nodeSizeCP "fake" --nodeSizeWP "fake" -r fake --verbose -1 -s store-local --yes --bootstrap k3s - - name: azure switch - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' - run: | - .\ksctl.exe switch -p azure -n demo -s local -r fake - .\ksctl.exe switch -p ha-azure -n ha-demo -s local -r fake + ${{env.KSCTL_BIN}} create ha-aws -n ha-demo-kubeadm --nodeSizeDS "fake" --version 1.28 --nodeSizeLB "fake" --nodeSizeCP "fake" --nodeSizeWP "fake" -r fake --verbose -1 -s store-local --yes --bootstrap kubeadm - - name: civo scale up and down - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' + - name: local create run: | - .\ksctl.exe delete ha-civo del-nodes -n ha-demo --noWP 0 -r LON1 -s local --approve -v -1 - .\ksctl.exe create ha-civo add-nodes -n ha-demo --noWP 1 --version 1.27.1 --nodeSizeWP "fake.small" -s local -r LON1 -v -1 --approve + ${{env.KSCTL_BIN}} create local -n demolocal --version 1.27.1 --verbose -1 -s store-local --yes - - name: azure scale up and down - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' - run: | - .\ksctl.exe delete ha-azure del-nodes -n ha-demo --noWP 0 -r fake -s local --approve -v -1 - .\ksctl.exe create ha-azure add-nodes -n ha-demo --noWP 1 --version 1.27.1 --nodeSizeWP "fake" -s local -r fake -v -1 --approve - - name: aws scale up and down - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' + - name: local create mongodb + if: ${{ matrix.os == 'ubuntu-latest' }} run: | - .\ksctl.exe delete ha-aws del-nodes -n ha-demo --noWP 0 -r fake -s local --approve -v -1 - .\ksctl.exe create ha-aws add-nodes -n ha-demo --noWP 1 --version 1.27.1 --nodeSizeWP "fake" -s local -r fake -v -1 --approve + unset KSCTL_FAKE_FLAG_ENABLED + docker run -d \ + --name mongodb \ + -p 27017:27017 \ + -e MONGO_INITDB_ROOT_USERNAME=root \ + -e MONGO_INITDB_ROOT_PASSWORD=1234 \ + mongo + export MONGODB_URI="mongodb://root:1234@127.0.0.1:27017" + ${{env.KSCTL_BIN}} create local -n demolocal-extmongo -s external-store-mongodb --verbose -1 --yes - - name: civo delete - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' + - name: civo get run: | - .\ksctl.exe delete civo -n demo -r LON1 -s local -v -1 --approve - .\ksctl.exe delete ha-civo -n ha-demo -r LON1 -s local -v -1 --approve - + ${{env.KSCTL_BIN}} get -s store-local -p civo - - name: azure delete - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' + - name: azure get run: | - .\ksctl.exe delete azure -n demo -r fake -s local -v -1 --approve - .\ksctl.exe delete ha-azure -n ha-demo -r fake -s local -v -1 --approve + ${{env.KSCTL_BIN}} get -s store-local -p azure - - name: aws delete - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' + - name: aws get run: | - # .\ksctl.exe delete aws -n demo -r fake -s local -v -1 --approve - .\ksctl.exe delete ha-aws -n ha-demo -r fake -s local -v -1 --approve + ${{env.KSCTL_BIN}} get -s store-local -p aws - - name: local delete - working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' + - name: local get mongo + if: ${{ matrix.os == 'ubuntu-latest' }} run: | - .\ksctl.exe delete local -n demolocal -s local -v -1 --approve + unset KSCTL_FAKE_FLAG_ENABLED + export MONGODB_URI="mongodb://root:1234@127.0.0.1:27017" + ${{env.KSCTL_BIN}} get -p local -s external-store-mongodb - ksctl-cli-unix: - strategy: - matrix: - os: [macos-latest, ubuntu-latest] - - if: | - ( - github.event.label.name == 'pr/lgtm' || - contains(github.event.pull_request.labels.*.name, 'pr/lgtm') - ) || ( - github.event_name == 'push' && - github.ref == 'refs/heads/main' - ) - runs-on: ${{ matrix.os }} - env: - KSCTL_FAKE_FLAG_ENABLED: "1" - PS4: '+\[\033[0;33m\](\[\033[0;36m\]${BASH_SOURCE##*/}:${LINENO}\[\033[0;33m\])\[\033[0m\] ' - steps: - - name: Checkout - uses: actions/checkout@v3 + - name: get all + run: | + ${{env.KSCTL_BIN}} get -s store-local - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: 1.21.0 - - name: build ksctl linux + - name: all mongodb if: ${{ matrix.os == 'ubuntu-latest' }} run: | - set -xe - make install_linux - ksctl version + unset KSCTL_FAKE_FLAG_ENABLED + export MONGODB_URI="mongodb://root:1234@127.0.0.1:27017" + ${{env.KSCTL_BIN}} get -s external-store-mongodb - - name: build ksctl macos - if: ${{ matrix.os == 'macos-latest' }} - run: | - set -xe - make install_macos_intel - ksctl version - - - name: civo create + - name: civo switch run: | - set -xe - ksctl create civo -n demo -r LON1 --nodeSizeMP "g4s.kube.small" --version 1.27.1 -s local --verbose -1 --approve - ksctl create ha-civo -n ha-demo --nodeSizeDS "fake.small" -s local --version 1.27.1 --nodeSizeLB "fake.small" --nodeSizeCP "fake.small" --nodeSizeWP "fake.small" -r LON1 --verbose -1 --approve + ${{env.KSCTL_BIN}} switch -p civo -n demo -s store-local -r LON1 + ${{env.KSCTL_BIN}} switch -p ha-civo -n ha-demo-k3s -s store-local -r LON1 + ${{env.KSCTL_BIN}} switch -p ha-civo -n ha-demo-kubeadm -s store-local -r LON1 - - name: azure create + - name: aws switch run: | - set -xe - ksctl create azure -n demo -r fake --nodeSizeMP "fake" -s local --version 1.27.1 --verbose -1 --approve - ksctl create ha-azure -n ha-demo --nodeSizeDS "fake" -s local --nodeSizeLB "fake" --version 1.27.1 --nodeSizeCP "fake" --nodeSizeWP "fake" -r fake --verbose -1 --approve + # ${{env.KSCTL_BIN}} switch -p aws -n demo -s store-local -r fake + ${{env.KSCTL_BIN}} switch -p ha-aws -n ha-demo-k3s -s store-local -r fake + ${{env.KSCTL_BIN}} switch -p ha-aws -n ha-demo-kubeadm -s store-local -r fake - - name: aws create + - name: azure switch run: | - set -xe - # ksctl create aws -n demo -r fake --nodeSizeMP "fake" -s local --version 1.27.1 --verbose -1 --approve - ksctl create ha-aws -n ha-demo --nodeSizeDS "fake" -s local --nodeSizeLB "fake" --version 1.27.1 --nodeSizeCP "fake" --nodeSizeWP "fake" -r fake --verbose -1 --approve + ${{env.KSCTL_BIN}} switch -p azure -n demo -s store-local -r fake + ${{env.KSCTL_BIN}} switch -p ha-azure -n ha-demo-k3s -s store-local -r fake + ${{env.KSCTL_BIN}} switch -p ha-azure -n ha-demo-kubeadm -s store-local -r fake - - name: local create + - name: local switch run: | - set -xe - ksctl create local -n demolocal -s local --verbose -1 --approve + ${{env.KSCTL_BIN}} switch -p local -n demolocal -s store-local - - name: civo get + - name: local switch mongodb + if: ${{ matrix.os == 'ubuntu-latest' }} run: | - set -xe - ksctl get -p civo -s local + unset KSCTL_FAKE_FLAG_ENABLED + export MONGODB_URI="mongodb://root:1234@127.0.0.1:27017" + ${{env.KSCTL_BIN}} switch -p local -n demolocal-extmongo -s external-store-mongodb - - name: azure get + - name: civo scale up and down run: | - set -xe - ksctl get -p azure -s local + ${{env.KSCTL_BIN}} delete ha-civo del-nodes -n ha-demo-k3s --noWP 0 -r LON1 -s store-local --yes -v -1 --bootstrap k3s - - name: aws get - run: | - set -xe - ksctl get -p aws -s local + ${{env.KSCTL_BIN}} create ha-civo add-nodes -n ha-demo-k3s --noWP 1 --version 1.27.1 --nodeSizeWP "fake.small" -s store-local -r LON1 -v -1 --yes --bootstrap k3s - - name: all - run: | - set -xe - ksctl get -s local + ${{env.KSCTL_BIN}} delete ha-civo del-nodes -n ha-demo-kubeadm --noWP 0 -r LON1 -s store-local --yes -v -1 --bootstrap kubeadm - - name: civo switch - run: | - set -xe - ksctl switch -p civo -n demo -s local -r LON1 - ksctl switch -p ha-civo -n ha-demo -s local -r LON1 + ${{env.KSCTL_BIN}} create ha-civo add-nodes -n ha-demo-kubeadm --noWP 1 --version 1.28 --nodeSizeWP "fake.small" -s store-local -r LON1 -v -1 --yes --bootstrap kubeadm - - name: azure switch + - name: azure scale up and down run: | - set -xe - ksctl switch -p azure -n demo -s local -r fake - ksctl switch -p ha-azure -n ha-demo -s local -r fake + ${{env.KSCTL_BIN}} delete ha-azure del-nodes -n ha-demo-k3s --noWP 0 -r fake -s store-local --yes -v -1 --bootstrap k3s - - name: aws switch - run: | - set -xe - # ksctl switch -p aws -n demo -s local -r fake - ksctl switch -p ha-aws -n ha-demo -s local -r fake + ${{env.KSCTL_BIN}} create ha-azure add-nodes -n ha-demo-k3s --noWP 1 --version 1.27.1 --nodeSizeWP "fake" -s store-local -r fake -v -1 --yes --bootstrap k3s - - name: civo scale up and down - run: | - set -xe - ksctl delete ha-civo del-nodes -n ha-demo --noWP 0 -r LON1 -s local --approve -v -1 - ksctl create ha-civo add-nodes -n ha-demo --noWP 1 --version 1.27.1 --nodeSizeWP "fake.small" -s local -r LON1 -v -1 --approve + ${{env.KSCTL_BIN}} delete ha-azure del-nodes -n ha-demo-kubeadm --noWP 0 -r fake -s store-local --yes -v -1 --bootstrap kubeadm - - name: azure scale up and down - run: | - set -xe - ksctl delete ha-azure del-nodes -n ha-demo --noWP 0 -s local -r fake --approve -v -1 - ksctl create ha-azure add-nodes -n ha-demo --noWP 1 --version 1.27.1 --nodeSizeWP "fake" -s local -r fake -v -1 --approve + ${{env.KSCTL_BIN}} create ha-azure add-nodes -n ha-demo-kubeadm --noWP 1 --version 1.28 --nodeSizeWP "fake" -s store-local -r fake -v -1 --yes --bootstrap kubeadm - name: aws scale up and down run: | - set -xe - ksctl delete ha-aws del-nodes -n ha-demo --noWP 0 -s local -r fake --approve -v -1 - ksctl create ha-aws add-nodes -n ha-demo --noWP 1 --version 1.27.1 --nodeSizeWP "fake" -s local -r fake -v -1 --approve + ${{env.KSCTL_BIN}} delete ha-aws del-nodes -n ha-demo-k3s --noWP 0 -r fake -s store-local --yes -v -1 --bootstrap k3s + + ${{env.KSCTL_BIN}} create ha-aws add-nodes -n ha-demo-k3s --noWP 1 --version 1.27.1 --nodeSizeWP "fake" -s store-local -r fake -v -1 --yes --bootstrap k3s + + ${{env.KSCTL_BIN}} delete ha-aws del-nodes -n ha-demo-kubeadm --noWP 0 -r fake -s store-local --yes -v -1 --bootstrap kubeadm + + ${{env.KSCTL_BIN}} create ha-aws add-nodes -n ha-demo-kubeadm --noWP 1 --version 1.28 --nodeSizeWP "fake" -s store-local -r fake -v -1 --yes --bootstrap kubeadm - name: civo delete run: | - set -xe - ksctl delete civo -n demo -r LON1 -s local -v -1 --approve - ksctl delete ha-civo -n ha-demo -r LON1 -s local -v -1 --approve + ${{env.KSCTL_BIN}} delete civo -n demo -r LON1 -s store-local -v -1 --yes + ${{env.KSCTL_BIN}} delete ha-civo -n ha-demo-k3s -r LON1 -s store-local -v -1 --yes + ${{env.KSCTL_BIN}} delete ha-civo -n ha-demo-kubeadm -r LON1 -s store-local -v -1 --yes - name: azure delete run: | - set -xe - ksctl delete azure -n demo -r fake -s local -v -1 --approve - ksctl delete ha-azure -n ha-demo -r fake -s local -v -1 --approve + ${{env.KSCTL_BIN}} delete azure -n demo -r fake -s store-local -v -1 --yes + ${{env.KSCTL_BIN}} delete ha-azure -n ha-demo-k3s -r fake -s store-local -v -1 --yes + ${{env.KSCTL_BIN}} delete ha-azure -n ha-demo-kubeadm -r fake -s store-local -v -1 --yes - name: aws delete run: | - set -xe - # ksctl delete aws -n demo -r fake -s local -v -1 --approve - ksctl delete ha-aws -n ha-demo -r fake -s local -v -1 --approve + # ${{env.KSCTL_BIN}} delete aws -n demo -r fake -s store-local -v -1 --yes + ${{env.KSCTL_BIN}} delete ha-aws -n ha-demo-k3s -r fake -s store-local -v -1 --yes + ${{env.KSCTL_BIN}} delete ha-aws -n ha-demo-kubeadm -r fake -s store-local -v -1 --yes - name: local delete run: | - set -xe - ksctl delete local -n demolocal -v -1 -s local --approve + ${{env.KSCTL_BIN}} delete local -n demolocal -s store-local -v -1 --yes - - name: storage provider + - name: local delete mongodb + if: ${{ matrix.os == 'ubuntu-latest' }} run: | - set -xe - ksctl create local -n demolocal -s local -v -1 --approve - ksctl create local -n demolocal -s external-mongo -v -1 --approve || echo "Expected to fail :) due to missing env vars" - ksctl create local -n demolocal -s local123 -v -1 --approve || echo "Expected to fail :) due to invalid provider name" + unset KSCTL_FAKE_FLAG_ENABLED + export MONGODB_URI="mongodb://root:1234@127.0.0.1:27017" + ${{env.KSCTL_BIN}} delete local -n demolocal-extmongo -v -1 -s external-store-mongodb --yes + diff --git a/.github/workflows/testLogger.yaml b/.github/workflows/testLogger.yaml new file mode 100644 index 0000000..d2b8979 --- /dev/null +++ b/.github/workflows/testLogger.yaml @@ -0,0 +1,29 @@ +name: Testing Logger +on: + push: + paths: + - 'logger/**' + - 'go.mod' + - 'go.sum' + branches: [ main ] + pull_request: + paths: + - 'logger/**' + - 'go.mod' + - 'go.sum' + branches: [ main ] + +jobs: + unit-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 1.21.0 + - run: go version + - name: testing + working-directory: logger + run: | + go test -v ./... diff --git a/.goreleaser.yaml b/.goreleaser.yaml index dfc435c..5035d6c 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -11,8 +11,8 @@ builds: - amd64 - arm64 ldflags: - - -s -w -X "github.com/kubesimplify/ksctl-cli/cli/cmd.BuildDate={{.Env.DATE}}" - - -s -w -X "github.com/kubesimplify/ksctl-cli/cli/cmd.Version={{.Env.VERSION}}" + - -s -w -X "github.com/ksctl/cli/cli/cmd.BuildDate={{.Env.DATE}}" + - -s -w -X "github.com/ksctl/cli/cli/cmd.Version={{.Env.VERSION}}" env: - CGO_ENABLED=0 diff --git a/Makefile b/Makefile index 517bcc8..1d00920 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ lint: golangci-lint ## Run golangci-lint linter & yamllint $(GOLANGCI_LINT) run && echo -e "\n=========\n\033[91m✔ PASSED\033[0m\n=========\n" || echo -e "\n=========\n\033[91m✖ FAILED\033[0m\n=========\n" -##@ Dependencies (Controller) +##@ Dependencies ## Location to install dependencies to LOCALBIN ?= /tmp/bin diff --git a/cli/cmd/addNodesHAAws.go b/cli/cmd/addNodesHAAws.go index 0b6d75d..e9706bd 100644 --- a/cli/cmd/addNodesHAAws.go +++ b/cli/cmd/addNodesHAAws.go @@ -1,12 +1,12 @@ package cmd -// authors Dipankar - import ( - "context" "os" - "github.com/ksctl/ksctl/pkg/helpers" + "github.com/fatih/color" + "github.com/ksctl/cli/logger" + "github.com/ksctl/ksctl/pkg/controllers" + "github.com/ksctl/ksctl/pkg/types" "github.com/spf13/cobra" @@ -14,18 +14,18 @@ import ( ) var addMoreWorkerNodesHAAws = &cobra.Command{ + Deprecated: color.HiYellowString("This will be removed in future releases once autoscaling is stable"), + Example: ` +ksctl create ha-aws add-nodes -n demo -r ap-south-1 -s store-local --noWP 3 --nodeSizeWP t2.medium --bootstrap kubeadm # Here the noWP is the desired count of workernodes + `, Use: "add-nodes", - Short: "Use to add more worker nodes in HA aws k3s cluster", - Long: `It is used to add nodes to worker nodes in cluster with the given name from user. For example: - -ksctl create-cluster ha-azure add-nodes -`, + Short: "Use to add more worker nodes in self-managed Highly-Available cluster on Aws", + Long: "It is used to add nodes to worker nodes in cluster with the given name from user.", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout cli.Client.Metadata.Provider = consts.CloudAws SetDefaults(consts.CloudAws, consts.ClusterTypeHa) @@ -37,23 +37,29 @@ ksctl create-cluster ha-azure add-nodes cli.Client.Metadata.IsHA = true cli.Client.Metadata.K8sDistro = consts.KsctlKubernetes(distro) cli.Client.Metadata.K8sVersion = k8sVer + cli.Client.Metadata.StateLocation = consts.KsctlStore(storage) - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Initialize Storage Driver", "Reason", err) + if err := createApproval(ctx, log, cmd.Flags().Lookup("yes").Changed); err != nil { + log.Error(ctx, "createApproval", "Reason", err) os.Exit(1) } - if err := createApproval(cmd.Flags().Lookup("approve").Changed); err != nil { - log.Error(err.Error()) + m, err := controllers.NewManagerClusterSelfManaged( + ctx, + log, + &cli.Client, + ) + if err != nil { + log.Error(ctx, "Failed to init manager", "Reason", err) os.Exit(1) } - err := controller.AddWorkerPlaneNode(&cli.Client) + err = m.AddWorkerPlaneNodes() if err != nil { - log.Error("Failed to scale up", "Reason", err) + log.Error(ctx, "Failed to scale up", "Reason", err) os.Exit(1) } - log.Success("Scale up successful") + log.Success(ctx, "Scale up successful") }, } diff --git a/cli/cmd/addNodesHAAzure.go b/cli/cmd/addNodesHAAzure.go index 83ef183..ee88e99 100644 --- a/cli/cmd/addNodesHAAzure.go +++ b/cli/cmd/addNodesHAAzure.go @@ -1,12 +1,13 @@ package cmd -// authors Dipankar - import ( - "context" "os" - "github.com/ksctl/ksctl/pkg/helpers" + "github.com/fatih/color" + + "github.com/ksctl/cli/logger" + "github.com/ksctl/ksctl/pkg/controllers" + "github.com/ksctl/ksctl/pkg/types" "github.com/spf13/cobra" @@ -14,18 +15,18 @@ import ( ) var addMoreWorkerNodesHAAzure = &cobra.Command{ + Deprecated: color.HiYellowString("This will be removed in future releases once autoscaling is stable"), + Example: ` +ksctl create ha-azure add-nodes -n demo -r eastus -s store-local --noWP 3 --nodeSizeWP Standard_F2s --bootstrap kubeadm # Here the noWP is the desired count of workernodes + `, Use: "add-nodes", - Short: "Use to add more worker nodes in HA azure k3s cluster", - Long: `It is used to add nodes to worker nodes in cluster with the given name from user. For example: - -ksctl create-cluster ha-azure add-nodes -`, + Short: "Use to add more worker nodes in self-managed Highly-Available cluster on Azure", + Long: "It is used to add nodes to worker nodes in cluster with the given name from user", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout cli.Client.Metadata.Provider = consts.CloudAzure SetDefaults(consts.CloudAzure, consts.ClusterTypeHa) @@ -37,23 +38,29 @@ ksctl create-cluster ha-azure add-nodes cli.Client.Metadata.IsHA = true cli.Client.Metadata.K8sDistro = consts.KsctlKubernetes(distro) cli.Client.Metadata.K8sVersion = k8sVer + cli.Client.Metadata.StateLocation = consts.KsctlStore(storage) - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Inialize Storage Driver", "Reason", err) + if err := createApproval(ctx, log, cmd.Flags().Lookup("yes").Changed); err != nil { + log.Error(ctx, "createApproval", "Reason", err) os.Exit(1) } - if err := createApproval(cmd.Flags().Lookup("approve").Changed); err != nil { - log.Error(err.Error()) + m, err := controllers.NewManagerClusterSelfManaged( + ctx, + log, + &cli.Client, + ) + if err != nil { + log.Error(ctx, "Failed to init manager", "Reason", err) os.Exit(1) } - err := controller.AddWorkerPlaneNode(&cli.Client) + err = m.AddWorkerPlaneNodes() if err != nil { - log.Error("Failed to scale up", "Reason", err) + log.Error(ctx, "Failed to scale up", "Reason", err) os.Exit(1) } - log.Success("Scale up successful") + log.Success(ctx, "Scale up successful") }, } diff --git a/cli/cmd/addNodesHACivo.go b/cli/cmd/addNodesHACivo.go index 62f412c..bc33c6b 100644 --- a/cli/cmd/addNodesHACivo.go +++ b/cli/cmd/addNodesHACivo.go @@ -1,30 +1,32 @@ package cmd -// authors Dipankar - import ( - "context" "os" - "github.com/ksctl/ksctl/pkg/helpers" + "github.com/fatih/color" + + "github.com/ksctl/ksctl/pkg/controllers" + "github.com/ksctl/ksctl/pkg/logger" + "github.com/ksctl/ksctl/pkg/types" "github.com/ksctl/ksctl/pkg/helpers/consts" "github.com/spf13/cobra" ) var addMoreWorkerNodesHACivo = &cobra.Command{ + Deprecated: color.HiYellowString("This will be removed in future releases once autoscaling is stable"), + Example: ` +ksctl create ha-civo add-nodes -n demo -r LON1 -s store-local --noWP 3 --nodeSizeWP g3.medium --bootstrap kubeadm # Here the noWP is the desired count of workernodes + `, Use: "add-nodes", - Short: "Use to add more worker nodes in HA CIVO k3s cluster", - Long: `It is used to add nodes to worker nodes in cluster with the given name from user. For example: - -ksctl create-cluster ha-civo add-nodes -`, + Short: "Use to add more worker nodes in self-managed Highly-Available cluster on Civo", + Long: "It is used to add nodes to worker nodes in cluster with the given name from user.", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout + var log types.LoggerFactory = logger.NewGeneralLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) + cli.Client.Metadata.Provider = consts.CloudCivo SetDefaults(consts.CloudCivo, consts.ClusterTypeHa) @@ -36,23 +38,29 @@ ksctl create-cluster ha-civo add-nodes cli.Client.Metadata.K8sDistro = consts.KsctlKubernetes(distro) cli.Client.Metadata.K8sVersion = k8sVer cli.Client.Metadata.IsHA = true + cli.Client.Metadata.StateLocation = consts.KsctlStore(storage) - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Inialize Storage Driver", "Reason", err) + if err := createApproval(ctx, log, cmd.Flags().Lookup("yes").Changed); err != nil { + log.Error(ctx, "createApproval", "Reason", err) os.Exit(1) } - if err := createApproval(cmd.Flags().Lookup("approve").Changed); err != nil { - log.Error(err.Error()) + m, err := controllers.NewManagerClusterSelfManaged( + ctx, + log, + &cli.Client, + ) + if err != nil { + log.Error(ctx, "Failed to init manager", "Reason", err) os.Exit(1) } - err := controller.AddWorkerPlaneNode(&cli.Client) + err = m.AddWorkerPlaneNodes() if err != nil { - log.Error("Failed to scale up", "Reason", err) + log.Error(ctx, "Failed to scale up", "Reason", err) os.Exit(1) } - log.Success("Scale up successful") + log.Success(ctx, "Scale up successful") }, } diff --git a/cli/cmd/createCluster.go b/cli/cmd/createCluster.go index 3f6d727..97ff558 100644 --- a/cli/cmd/createCluster.go +++ b/cli/cmd/createCluster.go @@ -1,178 +1,143 @@ package cmd -// authors Dipankar Das - import ( - "context" "os" - "github.com/ksctl/ksctl/pkg/helpers" - + "github.com/ksctl/cli/logger" "github.com/ksctl/ksctl/pkg/helpers/consts" + "github.com/ksctl/ksctl/pkg/types" "github.com/spf13/cobra" ) -// createClusterCmd represents the createCluster command var createClusterCmd = &cobra.Command{ - Use: "create-cluster", + Use: "create-cluster", + Example: ` +ksctl create --help + `, Short: "Use to create a cluster", Aliases: []string{"create"}, - Long: `It is used to create cluster with the given name from user. For example: - -ksctl create-cluster ["azure", "gcp", "aws", "local"] -`, -} - -var createClusterHAAws = &cobra.Command{ - Use: "ha-aws", - Short: "Use to create a EKS cluster in AWS", - Long: `It is used to create cluster with the given name from user. For example: - -ksctl create-cluster ha-aws -`, - Run: func(cmd *cobra.Command, args []string) { - verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) - - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout - cli.Client.Metadata.Provider = consts.CloudAws - - SetDefaults(consts.CloudAws, consts.ClusterTypeHa) - - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Initialize Storage Driver", "Reason", err) - os.Exit(1) - } - createHA(cmd.Flags().Lookup("approve").Changed) - }, + Long: "It is used to create cluster with the given name from user", } var createClusterAzure = &cobra.Command{ - Use: "azure", + Use: "azure", + Example: ` +ksctl create-cluster azure -n demo -r eastus -s store-local --nodeSizeMP Standard_DS2_v2 --noMP 3 +`, Short: "Use to create a AKS cluster in Azure", - Long: `It is used to create cluster with the given name from user. For example: - - ksctl create-cluster azure - `, + Long: "It is used to create cluster with the given name from user", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout cli.Client.Metadata.Provider = consts.CloudAzure SetDefaults(consts.CloudAzure, consts.ClusterTypeMang) - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Initialize Storage Driver", "Reason", err) - os.Exit(1) - } - - createManaged(cmd.Flags().Lookup("approve").Changed) + createManaged(ctx, log, cmd.Flags().Lookup("yes").Changed) }, } var createClusterCivo = &cobra.Command{ - Use: "civo", - Short: "Use to create a CIVO k3s cluster", - Long: `It is used to create cluster with the given name from user. For example: - -ksctl create-cluster civo + Use: "civo", + Example: ` +ksctl create-cluster civo --name demo --region LON1 --storage store-local --nodeSizeMP g4s.kube.small --noMP 3 `, + Short: "Use to create a Civo managed k3s cluster", + Long: "It is used to create cluster with the given name from user", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout cli.Client.Metadata.Provider = consts.CloudCivo SetDefaults(consts.CloudCivo, consts.ClusterTypeMang) - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Initialize Storage Driver", "Reason", err) - os.Exit(1) - } - - createManaged(cmd.Flags().Lookup("approve").Changed) + createManaged(ctx, log, cmd.Flags().Lookup("yes").Changed) }, } var createClusterLocal = &cobra.Command{ - Use: "local", - Short: "Use to create a LOCAL cluster in Docker", - Long: `It is used to create cluster with the given name from user. For example: - -ksctl create-cluster local + Use: "local", + Example: ` +ksctl create-cluster local --name demo --storage store-local --noMP 3 `, + Short: "Use to create a kind cluster", + Long: "It is used to create cluster with the given name from user", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout cli.Client.Metadata.Provider = consts.CloudLocal SetDefaults(consts.CloudLocal, consts.ClusterTypeMang) - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Initialize Storage Driver", "Reason", err) - os.Exit(1) - } + createManaged(ctx, log, cmd.Flags().Lookup("yes").Changed) + }, +} + +var createClusterHAAws = &cobra.Command{ + Use: "ha-aws", + Example: ` +ksctl create-cluster ha-aws -n demo -r us-east-1 --bootstrap k3s -s store-local --nodeSizeCP t2.medium --nodeSizeWP t2.medium --nodeSizeLB t2.micro --nodeSizeDS t2.small --noWP 1 --noCP 3 --noDS 3 +`, + Short: "Use to create a self-managed Highly Available cluster on AWS", + Long: "It is used to create cluster with the given name from user.", + Run: func(cmd *cobra.Command, args []string) { + verbosity, _ := cmd.Flags().GetInt("verbose") + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) + + cli.Client.Metadata.Provider = consts.CloudAws + + SetDefaults(consts.CloudAws, consts.ClusterTypeHa) - createManaged(cmd.Flags().Lookup("approve").Changed) + createHA(ctx, log, cmd.Flags().Lookup("yes").Changed) }, } var createClusterHACivo = &cobra.Command{ - Use: "ha-civo", - Short: "Use to create a HA CIVO k3s cluster", - Long: `It is used to create cluster with the given name from user. For example: - -ksctl create-cluster ha-civo + Use: "ha-civo", + Example: ` +ksctl create-cluster ha-civo --name demo --region LON1 --bootstrap k3s --storage store-local --nodeSizeCP g3.small --nodeSizeWP g3.medium --nodeSizeLB g3.small --nodeSizeDS g3.small --noWP 1 --noCP 3 --noDS 3 +ksctl create-cluster ha-civo --name demo --region LON1 --bootstrap kubeadm --storage store-local --nodeSizeCP g3.medium --nodeSizeWP g3.large --nodeSizeLB g3.small --nodeSizeDS g3.small --noWP 1 --noCP 3 --noDS 3 `, + Short: "Use to create a self-managed Highly Available cluster on Civo", + Long: "It is used to create cluster with the given name from user", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout cli.Client.Metadata.Provider = consts.CloudCivo SetDefaults(consts.CloudCivo, consts.ClusterTypeHa) - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Inialize Storage Driver", "Reason", err) - os.Exit(1) - } - createHA(cmd.Flags().Lookup("approve").Changed) + createHA(ctx, log, cmd.Flags().Lookup("yes").Changed) }, } var createClusterHAAzure = &cobra.Command{ - Use: "ha-azure", - Short: "Use to create a HA k3s cluster in Azure", - Long: `It is used to create cluster with the given name from user. For example: - - ksctl create-cluster ha-azure - `, + Use: "ha-azure", + Example: ` +ksctl create-cluster ha-azure --name demo --region eastus --bootstrap k3s --storage store-local --nodeSizeCP Standard_F2s --nodeSizeWP Standard_F2s --nodeSizeLB Standard_F2s --nodeSizeDS Standard_F2s --noWP 1 --noCP 3 --noDS 3 +ksctl create-cluster ha-azure --name demo --region eastus --bootstrap kubeadm --storage store-local --nodeSizeCP Standard_F2s --nodeSizeWP Standard_F4s --nodeSizeLB Standard_F2s --nodeSizeDS Standard_F2s --noWP 1 --noCP 3 --noDS 3 +`, + Short: "Use to create a self-managed Highly-Available cluster on Azure", + Long: "It is used to create cluster with the given name from user", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout cli.Client.Metadata.Provider = consts.CloudAzure SetDefaults(consts.CloudAzure, consts.ClusterTypeHa) - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Initialize Storage Driver", "Reason", err) - os.Exit(1) - } - createHA(cmd.Flags().Lookup("approve").Changed) + createHA(ctx, log, cmd.Flags().Lookup("yes").Changed) }, } diff --git a/cli/cmd/credentials.go b/cli/cmd/credentials.go index bce8f07..41f0984 100644 --- a/cli/cmd/credentials.go +++ b/cli/cmd/credentials.go @@ -1,38 +1,33 @@ -// authors Dipankar package cmd import ( - "context" "fmt" "os" - "github.com/ksctl/ksctl/pkg/helpers" + "github.com/ksctl/cli/logger" + "github.com/ksctl/ksctl/pkg/controllers" + "github.com/ksctl/ksctl/pkg/types" "github.com/ksctl/ksctl/pkg/helpers/consts" "github.com/spf13/cobra" ) -// initCmd represents the init command var credCmd = &cobra.Command{ Use: "cred", Short: "Login to your Cloud-provider Credentials", - Long: `login to your cloud provider credentials -`, + Long: "login to your cloud provider credentials", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + if len(storage) == 0 { storage = string(consts.StoreLocal) } + cli.Client.Metadata.StateLocation = consts.KsctlStore(storage) - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Inialize Storage Driver", "Reason", err) - os.Exit(1) - } - SetRequiredFeatureFlags(cmd) + SetRequiredFeatureFlags(ctx, log, cmd) - log.Print(` + log.Print(ctx, ` 1> AWS (EKS) 2> Azure (AKS) 3> Civo (K3s) @@ -47,14 +42,23 @@ var credCmd = &cobra.Command{ if provider, ok := cloud[choice]; ok { cli.Client.Metadata.Provider = consts.KsctlCloud(provider) } else { - log.Error("invalid provider") + log.Error(ctx, "invalid provider") + } + m, err := controllers.NewManagerClusterKsctl( + ctx, + log, + &cli.Client, + ) + if err != nil { + log.Error(ctx, "Failed to initialize", "Reason", err) + os.Exit(1) } - if err := controller.Credentials(&cli.Client); err != nil { - log.Error("Failed to added the credential", "Reason", err) + if err := m.Credentials(); err != nil { + log.Error(ctx, "Failed to added the credential", "Reason", err) os.Exit(1) } - log.Success("Credentials added successfully") + log.Success(ctx, "Credentials added successfully") }, } diff --git a/cli/cmd/deleteCluster.go b/cli/cmd/deleteCluster.go index 7a068d2..8403217 100644 --- a/cli/cmd/deleteCluster.go +++ b/cli/cmd/deleteCluster.go @@ -1,181 +1,140 @@ package cmd -// authors Dipankar Das - import ( - "context" "os" - "github.com/ksctl/ksctl/pkg/helpers" + "github.com/ksctl/cli/logger" "github.com/ksctl/ksctl/pkg/helpers/consts" + "github.com/ksctl/ksctl/pkg/types" "github.com/spf13/cobra" ) -// deleteClusterCmd represents the deleteCluster command var deleteClusterCmd = &cobra.Command{ - Use: "delete-cluster", + Use: "delete-cluster", + Example: ` +ksctl delete --help + `, Short: "Use to delete a cluster", Aliases: []string{"delete"}, - Long: `It is used to delete cluster of given provider. For example: + Long: "It is used to delete cluster of given provider", +} -ksctl delete-cluster ["aws","azure", "ha-", "civo", "local"] +var deleteClusterLocal = &cobra.Command{ + Use: "local", + Example: ` +ksctl delete local --name demo --storage store-local `, -} + Short: "Use to delete a kind cluster", + Long: "It is used to delete cluster of given provider", + Run: func(cmd *cobra.Command, args []string) { + verbosity, _ := cmd.Flags().GetInt("verbose") + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) -var deleteClusterAzure = &cobra.Command{ - Use: "azure", - Short: "Use to create a azure managed cluster", - Long: `It is used to create cluster with the given name from user. For example: + cli.Client.Metadata.Provider = consts.CloudLocal + + SetDefaults(consts.CloudLocal, consts.ClusterTypeMang) -ksctl create-cluster azure + deleteManaged(ctx, log, cmd.Flags().Lookup("yes").Changed) + }, +} +var deleteClusterAzure = &cobra.Command{ + Use: "azure", + Example: ` +ksctl delete azure --name demo --region eastus --storage store-local `, + Short: "Use to deletes a AKS cluster", + Long: "It is used to delete cluster of given provider", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout cli.Client.Metadata.Provider = consts.CloudAzure SetDefaults(consts.CloudAzure, consts.ClusterTypeMang) - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Inialize Storage Driver", "Reason", err) - os.Exit(1) - } - - deleteManaged(cmd.Flags().Lookup("approve").Changed) + deleteManaged(ctx, log, cmd.Flags().Lookup("yes").Changed) }, } var deleteClusterCivo = &cobra.Command{ - Use: "civo", - Short: "Use to delete a CIVO cluster", - Long: `It is used to delete cluster of given provider. For example: - -ksctl delete-cluster civo + Use: "civo", + Example: ` +ksctl delete civo --name demo --region LON1 --storage store-local `, + Short: "Use to delete a Civo managed k3s cluster", + Long: "It is used to delete cluster of given provider", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout cli.Client.Metadata.Provider = consts.CloudCivo SetDefaults(consts.CloudCivo, consts.ClusterTypeMang) - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Inialize Storage Driver", "Reason", err) - os.Exit(1) - } - - deleteManaged(cmd.Flags().Lookup("approve").Changed) - + deleteManaged(ctx, log, cmd.Flags().Lookup("yes").Changed) }, } var deleteClusterHAAws = &cobra.Command{ - Use: "ha-aws", - Short: "Use to delete a HA k3s cluster in Azure", - Long: `It is used to delete cluster with the given name from user. For example: - - ksctl delete-cluster ha-aws - `, + Use: "ha-aws", + Example: ` +ksctl delete ha-aws --name demo --region us-east-1 --storage store-local +`, + Short: "Use to delete a self-managed Highly Available cluster on AWS", + Long: "It is used to delete cluster of given provider", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout cli.Client.Metadata.Provider = consts.CloudAws SetDefaults(consts.CloudAws, consts.ClusterTypeHa) - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Inialize Storage Driver", "Reason", err) - os.Exit(1) - } - - deleteHA(cmd.Flags().Lookup("approve").Changed) + deleteHA(ctx, log, cmd.Flags().Lookup("yes").Changed) }, } var deleteClusterHAAzure = &cobra.Command{ - Use: "ha-azure", - Short: "Use to delete a HA k3s cluster in Azure", - Long: `It is used to delete cluster with the given name from user. For example: - - ksctl delete-cluster ha-azure - `, + Use: "ha-azure", + Example: ` +ksctl delete ha-azure --name demo --region eastus --storage store-local +`, + Short: "Use to delete a self-managed Highly Available cluster on Azure", + Long: "It is used to delete cluster of given provider", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout cli.Client.Metadata.Provider = consts.CloudAzure SetDefaults(consts.CloudAzure, consts.ClusterTypeHa) - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Inialize Storage Driver", "Reason", err) - os.Exit(1) - } - - deleteHA(cmd.Flags().Lookup("approve").Changed) + deleteHA(ctx, log, cmd.Flags().Lookup("yes").Changed) }, } var deleteClusterHACivo = &cobra.Command{ - Use: "ha-civo", - Short: "Use to delete a HA CIVO k3s cluster", - Long: `It is used to delete cluster with the given name from user. For example: - -ksctl delete-cluster ha-civo + Use: "ha-civo", + Example: ` +ksctl delete ha-civo --name demo --region LON1 --storage store-local `, + Short: "Use to delete a self-managed Highly Available cluster on Civo", + Long: "It is used to delete cluster of given provider", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout cli.Client.Metadata.Provider = consts.CloudCivo SetDefaults(consts.CloudCivo, consts.ClusterTypeHa) - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Inialize Storage Driver", "Reason", err) - os.Exit(1) - } - - deleteHA(cmd.Flags().Lookup("approve").Changed) - }, -} - -var deleteClusterLocal = &cobra.Command{ - Use: "local", - Short: "Use to delete a LOCAL cluster", - Long: `It is used to delete cluster of given provider. For example: - -ksctl delete-cluster local -`, - Run: func(cmd *cobra.Command, args []string) { - verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) - - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout - cli.Client.Metadata.Provider = consts.CloudLocal - - SetDefaults(consts.CloudLocal, consts.ClusterTypeMang) - - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Inialize Storage Driver", "Reason", err) - os.Exit(1) - } - - deleteManaged(cmd.Flags().Lookup("approve").Changed) + deleteHA(ctx, log, cmd.Flags().Lookup("yes").Changed) }, } diff --git a/cli/cmd/deleteNodesHAAws.go b/cli/cmd/deleteNodesHAAws.go index 240ac6a..41d0aac 100644 --- a/cli/cmd/deleteNodesHAAws.go +++ b/cli/cmd/deleteNodesHAAws.go @@ -1,30 +1,30 @@ package cmd -// authors Dipankar - import ( - "context" "os" - "github.com/ksctl/ksctl/pkg/helpers" + "github.com/fatih/color" + "github.com/ksctl/cli/logger" + "github.com/ksctl/ksctl/pkg/controllers" + "github.com/ksctl/ksctl/pkg/types" "github.com/ksctl/ksctl/pkg/helpers/consts" "github.com/spf13/cobra" ) var deleteNodesHAAws = &cobra.Command{ - Use: "del-nodes", - Short: "Use to delete a HA aws k3s cluster", - Long: `It is used to delete cluster with the given name from user. For example: - -ksctl delete-cluster ha-aws delete-nodes -`, + Deprecated: color.HiYellowString("This will be removed in future releases once autoscaling is stable"), + Use: "del-nodes", + Example: ` +ksctl delete ha-aws del-nodes -n demo -r us-east-1 -s store-local --noWP 1 --bootstrap kubeadm # Here the noWP is the desired count of workernodes + `, + Short: "Use to remove worker nodes in self-managed Highly-Available cluster on Aws", + Long: "It is used to delete cluster with the given name from user", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout cli.Client.Metadata.Provider = consts.CloudAws cli.Client.Metadata.IsHA = true @@ -34,23 +34,29 @@ ksctl delete-cluster ha-aws delete-nodes cli.Client.Metadata.ClusterName = clusterName cli.Client.Metadata.Region = region cli.Client.Metadata.K8sDistro = consts.KsctlKubernetes(distro) + cli.Client.Metadata.StateLocation = consts.KsctlStore(storage) - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Initialize Storage Driver", "Reason", err) + if err := deleteApproval(ctx, log, cmd.Flags().Lookup("yes").Changed); err != nil { + log.Error(ctx, "deleteApproval", "Reason", err) os.Exit(1) } - if err := deleteApproval(cmd.Flags().Lookup("approve").Changed); err != nil { - log.Error(err.Error()) + m, err := controllers.NewManagerClusterSelfManaged( + ctx, + log, + &cli.Client, + ) + if err != nil { + log.Error(ctx, "Failed to init manager", "Reason", err) os.Exit(1) } - err := controller.DelWorkerPlaneNode(&cli.Client) + err = m.DelWorkerPlaneNodes() if err != nil { - log.Error("Failed to scale down", "Reason", err) + log.Error(ctx, "Failed to scale down", "Reason", err) os.Exit(1) } - log.Success("Scale down successful") + log.Success(ctx, "Scale down successful") }, } diff --git a/cli/cmd/deleteNodesHAAzure.go b/cli/cmd/deleteNodesHAAzure.go index 964bd40..52e9ffb 100644 --- a/cli/cmd/deleteNodesHAAzure.go +++ b/cli/cmd/deleteNodesHAAzure.go @@ -1,30 +1,30 @@ package cmd -// authors Dipankar - import ( - "context" "os" - "github.com/ksctl/ksctl/pkg/helpers" + "github.com/fatih/color" + "github.com/ksctl/cli/logger" + "github.com/ksctl/ksctl/pkg/controllers" + "github.com/ksctl/ksctl/pkg/types" "github.com/ksctl/ksctl/pkg/helpers/consts" "github.com/spf13/cobra" ) var deleteNodesHAAzure = &cobra.Command{ - Use: "del-nodes", - Short: "Use to delete a HA azure k3s cluster", - Long: `It is used to delete cluster with the given name from user. For example: - -ksctl delete-cluster ha-azure delete-nodes -`, + Deprecated: color.HiYellowString("This will be removed in future releases once autoscaling is stable"), + Use: "del-nodes", + Example: ` +ksctl delete ha-azure del-nodes -n demo -r eastus -s store-local --noWP 1 --bootstrap kubeadm # Here the noWP is the desired count of workernodes + `, + Short: "Use to remove worker nodes in self-managed Highly-Available cluster on Azure", + Long: "It is used to delete cluster with the given name from user", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout cli.Client.Metadata.Provider = consts.CloudAzure cli.Client.Metadata.IsHA = true @@ -34,23 +34,29 @@ ksctl delete-cluster ha-azure delete-nodes cli.Client.Metadata.ClusterName = clusterName cli.Client.Metadata.Region = region cli.Client.Metadata.K8sDistro = consts.KsctlKubernetes(distro) + cli.Client.Metadata.StateLocation = consts.KsctlStore(storage) - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Inialize Storage Driver", "Reason", err) + if err := deleteApproval(ctx, log, cmd.Flags().Lookup("yes").Changed); err != nil { + log.Error(ctx, "deleteApproval", "Reason", err) os.Exit(1) } - if err := deleteApproval(cmd.Flags().Lookup("approve").Changed); err != nil { - log.Error(err.Error()) + m, err := controllers.NewManagerClusterSelfManaged( + ctx, + log, + &cli.Client, + ) + if err != nil { + log.Error(ctx, "Failed to init manager", "Reason", err) os.Exit(1) } - err := controller.DelWorkerPlaneNode(&cli.Client) + err = m.DelWorkerPlaneNodes() if err != nil { - log.Error("Failed to scale down", "Reason", err) + log.Error(ctx, "Failed to scale down", "Reason", err) os.Exit(1) } - log.Success("Scale down successful") + log.Success(ctx, "Scale down successful") }, } diff --git a/cli/cmd/deleteNodesHACivo.go b/cli/cmd/deleteNodesHACivo.go index f6bc6a9..417b77c 100644 --- a/cli/cmd/deleteNodesHACivo.go +++ b/cli/cmd/deleteNodesHACivo.go @@ -1,30 +1,30 @@ package cmd -// authors Dipankar - import ( - "context" "os" - "github.com/ksctl/ksctl/pkg/helpers" + "github.com/fatih/color" + "github.com/ksctl/cli/logger" + "github.com/ksctl/ksctl/pkg/controllers" + "github.com/ksctl/ksctl/pkg/types" "github.com/ksctl/ksctl/pkg/helpers/consts" "github.com/spf13/cobra" ) var deleteNodesHACivo = &cobra.Command{ - Use: "del-nodes", - Short: "Use to delete a HA CIVO k3s cluster", - Long: `It is used to delete cluster with the given name from user. For example: - -ksctl delete-cluster ha-civo delete-nodes -`, + Deprecated: color.HiYellowString("This will be removed in future releases once autoscaling is stable"), + Use: "del-nodes", + Example: ` +ksctl delete ha-civo del-nodes -n demo -r LON1 -s store-local --noWP 1 --bootstrap kubeadm # Here the noWP is the desired count of workernodes + `, + Short: "Use to remove worker nodes in self-managed Highly-Available cluster on Civo", + Long: "It is used to delete cluster with the given name from user", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - SetRequiredFeatureFlags(cmd) + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + SetRequiredFeatureFlags(ctx, log, cmd) - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout cli.Client.Metadata.Provider = consts.CloudCivo cli.Client.Metadata.IsHA = true SetDefaults(consts.CloudCivo, consts.ClusterTypeHa) @@ -32,22 +32,29 @@ ksctl delete-cluster ha-civo delete-nodes cli.Client.Metadata.ClusterName = clusterName cli.Client.Metadata.Region = region cli.Client.Metadata.K8sDistro = consts.KsctlKubernetes(distro) + cli.Client.Metadata.StateLocation = consts.KsctlStore(storage) - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Inialize Storage Driver", "Reason", err) + if err := deleteApproval(ctx, log, cmd.Flags().Lookup("yes").Changed); err != nil { + log.Error(ctx, "deleteApproval", "Reason", err) os.Exit(1) } - if err := deleteApproval(cmd.Flags().Lookup("approve").Changed); err != nil { - log.Error(err.Error()) + m, err := controllers.NewManagerClusterSelfManaged( + ctx, + log, + &cli.Client, + ) + if err != nil { + log.Error(ctx, "Failed to init manager", "Reason", err) os.Exit(1) } - err := controller.DelWorkerPlaneNode(&cli.Client) + + err = m.DelWorkerPlaneNodes() if err != nil { - log.Error("Failed to scale down", "Reason", err) + log.Error(ctx, "Failed to scale down", "Reason", err) os.Exit(1) } - log.Success("Scale down successful") + log.Success(ctx, "Scale down successful") }, } diff --git a/cli/cmd/featureFlags.go b/cli/cmd/featureFlags.go index dbb5ceb..45fe716 100644 --- a/cli/cmd/featureFlags.go +++ b/cli/cmd/featureFlags.go @@ -1,11 +1,11 @@ package cmd -// authors Dipankar import ( - "os" + "context" "strings" "github.com/ksctl/ksctl/pkg/helpers/consts" + "github.com/ksctl/ksctl/pkg/types" "github.com/spf13/cobra" ) @@ -17,10 +17,10 @@ func featureFlag(f *cobra.Command) { f.Flags().StringP("feature-flags", "", "", `Experimental Features: Supported values with comma seperated: [autoscale]`) } -func SetRequiredFeatureFlags(cmd *cobra.Command) { +func SetRequiredFeatureFlags(ctx context.Context, log types.LoggerFactory, cmd *cobra.Command) { rawFeatures, err := cmd.Flags().GetString("feature-flags") if err != nil { - log.Error(err.Error()) + log.Error(ctx, "Error in setting feature flags", "Reason", err) return } features := strings.Split(rawFeatures, ",") @@ -28,10 +28,12 @@ func SetRequiredFeatureFlags(cmd *cobra.Command) { for _, feature := range features { switch consts.KsctlSpecialFlags(feature) { - case ksctl_feature_auto_scale: - if err := os.Setenv(string(consts.KsctlFeatureFlagHaAutoscale), "true"); err != nil { - log.Error("Unable to set the ha autoscale feature") - } + // case ksctl_feature_auto_scale: + // if err := os.Setenv(string(consts.KsctlFeatureFlagHaAutoscale), "true"); err != nil { + // log.Error("Unable to set the ha autoscale feature") + // } + default: + return } } } diff --git a/cli/cmd/flags.go b/cli/cmd/flags.go index 05a999f..8fcebd2 100644 --- a/cli/cmd/flags.go +++ b/cli/cmd/flags.go @@ -1,6 +1,5 @@ package cmd -// authors Dipankar import "github.com/spf13/cobra" func verboseFlags() { @@ -32,27 +31,27 @@ func verboseFlags() { getClusterCmd.Flags().IntP("verbose", "v", 0, msgVerbose) switchCluster.Flags().IntP("verbose", "v", 0, msgVerbose) - createClusterAzure.Flags().BoolP("approve", "", true, msgApproval) - createClusterCivo.Flags().BoolP("approve", "", true, msgApproval) - createClusterLocal.Flags().BoolP("approve", "", true, msgApproval) - createClusterHACivo.Flags().BoolP("approve", "", true, msgApproval) - createClusterHAAzure.Flags().BoolP("approve", "", true, msgApproval) - createClusterHAAws.Flags().BoolP("approve", "", true, msgApproval) + createClusterAzure.Flags().BoolP("yes", "y", true, msgApproval) + createClusterCivo.Flags().BoolP("yes", "y", true, msgApproval) + createClusterLocal.Flags().BoolP("yes", "y", true, msgApproval) + createClusterHACivo.Flags().BoolP("yes", "y", true, msgApproval) + createClusterHAAzure.Flags().BoolP("yes", "y", true, msgApproval) + createClusterHAAws.Flags().BoolP("yes", "y", true, msgApproval) - deleteClusterLocal.Flags().BoolP("approve", "", true, msgApproval) - deleteClusterAzure.Flags().BoolP("approve", "", true, msgApproval) - deleteClusterCivo.Flags().BoolP("approve", "", true, msgApproval) - deleteClusterHAAzure.Flags().BoolP("approve", "", true, msgApproval) - deleteClusterHACivo.Flags().BoolP("approve", "", true, msgApproval) - deleteClusterHAAws.Flags().BoolP("approve", "", true, msgApproval) + deleteClusterLocal.Flags().BoolP("yes", "y", true, msgApproval) + deleteClusterAzure.Flags().BoolP("yes", "y", true, msgApproval) + deleteClusterCivo.Flags().BoolP("yes", "y", true, msgApproval) + deleteClusterHAAzure.Flags().BoolP("yes", "y", true, msgApproval) + deleteClusterHACivo.Flags().BoolP("yes", "y", true, msgApproval) + deleteClusterHAAws.Flags().BoolP("yes", "y", true, msgApproval) - addMoreWorkerNodesHAAzure.Flags().BoolP("approve", "", true, msgApproval) - addMoreWorkerNodesHACivo.Flags().BoolP("approve", "", true, msgApproval) - addMoreWorkerNodesHAAws.Flags().BoolP("approve", "", true, msgApproval) + addMoreWorkerNodesHAAzure.Flags().BoolP("yes", "y", true, msgApproval) + addMoreWorkerNodesHACivo.Flags().BoolP("yes", "y", true, msgApproval) + addMoreWorkerNodesHAAws.Flags().BoolP("yes", "y", true, msgApproval) - deleteNodesHAAzure.Flags().BoolP("approve", "", true, msgApproval) - deleteNodesHACivo.Flags().BoolP("approve", "", true, msgApproval) - deleteNodesHAAws.Flags().BoolP("approve", "", true, msgApproval) + deleteNodesHAAzure.Flags().BoolP("yes", "y", true, msgApproval) + deleteNodesHACivo.Flags().BoolP("yes", "y", true, msgApproval) + deleteNodesHAAws.Flags().BoolP("yes", "y", true, msgApproval) } func storageFlag(f *cobra.Command) { @@ -95,7 +94,7 @@ func cniFlag(f *cobra.Command) { } func distroFlag(f *cobra.Command) { - f.Flags().StringVarP(&distro, "distribution", "", "", "Kubernetes Distribution") + f.Flags().StringVarP(&distro, "bootstrap", "", "", "Kubernetes Bootstrap") } func k8sVerFlag(f *cobra.Command) { diff --git a/cli/cmd/getCluster.go b/cli/cmd/getCluster.go index 8d5dadd..b23d376 100644 --- a/cli/cmd/getCluster.go +++ b/cli/cmd/getCluster.go @@ -1,16 +1,11 @@ package cmd -/* -Kubesimplify -authors Dipankar - Anurag Kumar -*/ - import ( - "context" "os" - "github.com/ksctl/ksctl/pkg/helpers" + "github.com/ksctl/cli/logger" + "github.com/ksctl/ksctl/pkg/controllers" + "github.com/ksctl/ksctl/pkg/types" "github.com/ksctl/ksctl/pkg/helpers/consts" @@ -23,39 +18,47 @@ type printer struct { Provider string `json:"provider"` } -// viewClusterCmd represents the viewCluster command var getClusterCmd = &cobra.Command{ Use: "get-clusters", - Aliases: []string{"get"}, - Short: "Use to get clusters", + Aliases: []string{"get", "list"}, + Example: ` +ksctl get --provider all --storage store-local +`, + Short: "Use to get clusters", Long: `It is used to view clusters. For example: ksctl get-clusters `, Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + if len(storage) == 0 { storage = string(consts.StoreLocal) } - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Initialize Storage Driver", "Reason", err) - os.Exit(1) - } - if len(provider) == 0 { provider = "all" } - SetRequiredFeatureFlags(cmd) + SetRequiredFeatureFlags(ctx, log, cmd) cli.Client.Metadata.Provider = consts.KsctlCloud(provider) + cli.Client.Metadata.StateLocation = consts.KsctlStore(storage) + + m, err := controllers.NewManagerClusterKsctl( + ctx, + log, + &cli.Client, + ) + if err != nil { + log.Error(ctx, "failed to init", "Reason", err) + os.Exit(1) + } - err := controller.GetCluster(&cli.Client) + err = m.GetCluster() if err != nil { - log.Error("Get cluster failed", "Reason", err) + log.Error(ctx, "Get cluster failed", "Reason", err) os.Exit(1) } - log.Success("Get cluster successfull") + log.Success(ctx, "Get cluster successfull") }, } diff --git a/cli/cmd/root.go b/cli/cmd/root.go index 2be7a78..4546d01 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -1,22 +1,13 @@ -/* -Kubesimplify -authors Dipankar - Anurag Kumar - Avinesh Tripathi -*/ - package cmd import ( + "context" "os" "time" - "github.com/ksctl/ksctl/pkg/resources/controllers" - - controlPkg "github.com/ksctl/ksctl/pkg/controllers" + "github.com/ksctl/cli/logger" "github.com/ksctl/ksctl/pkg/helpers/consts" - "github.com/ksctl/ksctl/pkg/logger" - "github.com/ksctl/ksctl/pkg/resources" + "github.com/ksctl/ksctl/pkg/types" "github.com/spf13/cobra" ) @@ -45,17 +36,16 @@ var ( type CobraCmd struct { ClusterName string Region string - Client resources.KsctlClient + Client types.KsctlClient Version string } var ( - cli *CobraCmd - controller controllers.Controller - log resources.LoggerFactory + cli *CobraCmd + logCli types.LoggerFactory + ctx context.Context ) -// rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ Use: "ksctl", Short: "CLI tool for managing multiple K8s clusters", @@ -74,14 +64,26 @@ from local clusters to cloud provider specific clusters.`, // Run: func(cmd *cobra.Command, args []string) {}, } -// Execute adds all child commands to the root command and sets flags appropriately. -// This is called by main.main(). It only needs to happen once to the rootCmd. func Execute() { + ctx = context.WithValue( + context.Background(), + consts.KsctlModuleNameKey, + "cli", + ) + ctx = context.WithValue( + ctx, "USERID", "cli", + ) + if _, ok := os.LookupEnv("KSCTL_FAKE_FLAG_ENABLED"); ok { + ctx = context.WithValue( + ctx, + consts.KsctlTestFlagKey, + "true", + ) + } + cli = new(CobraCmd) - controller = controlPkg.GenKsctlController() - log = logger.NewDefaultLogger(0, os.Stdout) - log.SetPackageName("cli") + logCli = logger.NewLogger(0, os.Stdout) cloud = map[int]string{ 1: string(consts.CloudAws), @@ -92,10 +94,10 @@ func Execute() { timer := time.Now() err := rootCmd.Execute() - defer log.Print("Time Took", "⏰", time.Since(timer).String()) + defer logCli.Print(ctx, "Time Took", "time", time.Since(timer).String()) if err != nil { - log.Error("Initialization of cli failed", "Reason", err) + logCli.Error(ctx, "Initialization of cli failed", "Reason", err) os.Exit(1) } } diff --git a/cli/cmd/switchCluster.go b/cli/cmd/switchCluster.go index 73df37c..a26e180 100644 --- a/cli/cmd/switchCluster.go +++ b/cli/cmd/switchCluster.go @@ -1,41 +1,46 @@ package cmd -// authors Dipankar - import ( - "context" "os" - "github.com/ksctl/ksctl/pkg/helpers" + "github.com/ksctl/cli/logger" + "github.com/ksctl/ksctl/pkg/controllers" + "github.com/ksctl/ksctl/pkg/types" "github.com/ksctl/ksctl/pkg/helpers/consts" "github.com/spf13/cobra" ) var switchCluster = &cobra.Command{ - Use: "switch-cluster", + Use: "switch-cluster", + Example: ` +ksctl switch-context --provider civo --name --region +ksctl switch-context --provider local --name +ksctl switch-context --provider azure --name --region +ksctl switch-context --provider ha-civo --name --region +ksctl switch-context --provider ha-azure --name --region +ksctl switch-context --provider ha-aws --name --region + + For Storage specific + +ksctl switch-context -s store-local -p civo -n -r +ksctl switch-context -s external-store-mongodb -p civo -n -r +`, Aliases: []string{"switch"}, Short: "Use to switch between clusters", - Long: `It is used to switch cluster with the given ClusterName from user. For example: - -ksctl switch-context -p -n -r -`, + Long: "It is used to switch cluster with the given ClusterName from user.", Run: func(cmd *cobra.Command, args []string) { verbosity, _ := cmd.Flags().GetInt("verbose") - cli.Client.Metadata.LogVerbosity = verbosity - cli.Client.Metadata.LogWritter = os.Stdout + var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout) + if len(storage) == 0 { storage = string(consts.StoreLocal) } - - if err := safeInitializeStorageLoggerFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName())); err != nil { - log.Error("Failed Inialize Storage Driver", "Reason", err) - os.Exit(1) - } - SetRequiredFeatureFlags(cmd) + SetRequiredFeatureFlags(ctx, log, cmd) cli.Client.Metadata.ClusterName = clusterName cli.Client.Metadata.Region = region + cli.Client.Metadata.StateLocation = consts.KsctlStore(storage) switch provider { case string(consts.CloudLocal): @@ -60,13 +65,22 @@ ksctl switch-context -p -n import ( "context" "encoding/json" @@ -8,11 +7,12 @@ import ( "os" "strings" - control_pkg "github.com/ksctl/ksctl/pkg/controllers" + "github.com/ksctl/ksctl/pkg/controllers" "github.com/ksctl/ksctl/pkg/helpers/consts" + "github.com/ksctl/ksctl/pkg/types" ) -func createManaged(approval bool) { +func createManaged(ctx context.Context, log types.LoggerFactory, approval bool) { cli.Client.Metadata.ManagedNodeType = nodeSizeMP cli.Client.Metadata.NoMP = noMP @@ -20,23 +20,35 @@ func createManaged(approval bool) { cli.Client.Metadata.K8sDistro = consts.KsctlKubernetes(distro) cli.Client.Metadata.K8sVersion = k8sVer cli.Client.Metadata.Region = region + cli.Client.Metadata.StateLocation = consts.KsctlStore(storage) cli.Client.Metadata.CNIPlugin = cni - cli.Client.Metadata.Applications = apps - if err := createApproval(approval); err != nil { - log.Error(err.Error()) + if len(apps) != 0 { + cli.Client.Metadata.Applications = strings.Split(apps, ",") + } + if err := createApproval(ctx, log, approval); err != nil { + log.Error(ctx, "createApproval", "Reason", err) + os.Exit(1) + } + m, err := controllers.NewManagerClusterManaged( + ctx, + log, + &cli.Client, + ) + if err != nil { + log.Error(ctx, "Failed to create self-managed HA cluster", "Reason", err) os.Exit(1) } - err := controller.CreateManagedCluster(&cli.Client) + err = m.CreateCluster() if err != nil { - log.Error("Failed to create managed cluster", "Reason", err) + log.Error(ctx, "Failed to create managed cluster", "Reason", err) os.Exit(1) } - log.Success("Created the managed cluster successfully") + log.Success(ctx, "Created the managed cluster successfully") } -func createHA(approval bool) { +func createHA(ctx context.Context, log types.LoggerFactory, approval bool) { cli.Client.Metadata.IsHA = true cli.Client.Metadata.ClusterName = clusterName @@ -47,6 +59,7 @@ func createHA(approval bool) { cli.Client.Metadata.NoCP = noCP cli.Client.Metadata.NoWP = noWP cli.Client.Metadata.NoDS = noDS + cli.Client.Metadata.StateLocation = consts.KsctlStore(storage) cli.Client.Metadata.LoadBalancerNodeType = nodeSizeLB cli.Client.Metadata.ControlPlaneNodeType = nodeSizeCP @@ -54,56 +67,90 @@ func createHA(approval bool) { cli.Client.Metadata.DataStoreNodeType = nodeSizeDS cli.Client.Metadata.CNIPlugin = cni - cli.Client.Metadata.Applications = apps + if len(apps) != 0 { + cli.Client.Metadata.Applications = strings.Split(apps, ",") + } - if err := createApproval(approval); err != nil { - log.Error(err.Error()) + if err := createApproval(ctx, log, approval); err != nil { + log.Error(ctx, "createApproval", "Reason", err) + os.Exit(1) + } + m, err := controllers.NewManagerClusterSelfManaged( + ctx, + log, + &cli.Client, + ) + if err != nil { + log.Error(ctx, "Failed to create self-managed HA cluster", "Reason", err) os.Exit(1) } - err := controller.CreateHACluster(&cli.Client) + + err = m.CreateCluster() if err != nil { - log.Error("Failed to create self-managed HA cluster", "Reason", err) + log.Error(ctx, "Failed to create self-managed HA cluster", "Reason", err) os.Exit(1) } - log.Success("Created the self-managed HA cluster successfully") + log.Success(ctx, "Created the self-managed HA cluster successfully") } -func deleteManaged(approval bool) { +func deleteManaged(ctx context.Context, log types.LoggerFactory, approval bool) { cli.Client.Metadata.ClusterName = clusterName cli.Client.Metadata.K8sDistro = consts.KsctlKubernetes(distro) cli.Client.Metadata.Region = region + cli.Client.Metadata.StateLocation = consts.KsctlStore(storage) - if err := deleteApproval(approval); err != nil { - log.Error(err.Error()) + if err := deleteApproval(ctx, log, approval); err != nil { + log.Error(ctx, "deleteApproval", "Reason", err) os.Exit(1) } - err := controller.DeleteManagedCluster(&cli.Client) + + m, err := controllers.NewManagerClusterManaged( + ctx, + log, + &cli.Client, + ) if err != nil { - log.Error("Failed to delete managed cluster", "Reason", err) + log.Error(ctx, "Failed to create self-managed HA cluster", "Reason", err) os.Exit(1) } - log.Success("Deleted the managed cluster successfully") + err = m.DeleteCluster() + if err != nil { + log.Error(ctx, "Failed to delete managed cluster", "Reason", err) + os.Exit(1) + } + log.Success(ctx, "Deleted the managed cluster successfully") } -func deleteHA(approval bool) { +func deleteHA(ctx context.Context, log types.LoggerFactory, approval bool) { cli.Client.Metadata.IsHA = true cli.Client.Metadata.ClusterName = clusterName cli.Client.Metadata.K8sDistro = consts.KsctlKubernetes(distro) cli.Client.Metadata.Region = region + cli.Client.Metadata.StateLocation = consts.KsctlStore(storage) - if err := deleteApproval(approval); err != nil { - log.Error(err.Error()) + if err := deleteApproval(ctx, log, approval); err != nil { + log.Error(ctx, "deleteApproval", "Reason", err) + os.Exit(1) + } + m, err := controllers.NewManagerClusterSelfManaged( + ctx, + log, + &cli.Client, + ) + if err != nil { + log.Error(ctx, "Failed to create self-managed HA cluster", "Reason", err) os.Exit(1) } - err := controller.DeleteHACluster(&cli.Client) + + err = m.DeleteCluster() if err != nil { - log.Error("Failed to delete self-managed HA cluster", "Reason", err) + log.Error(ctx, "Failed to delete self-managed HA cluster", "Reason", err) os.Exit(1) } - log.Success("Deleted the self-managed HA cluster successfully") + log.Success(ctx, "Deleted the self-managed HA cluster successfully") } func getRequestPayload() ([]byte, error) { @@ -114,18 +161,18 @@ func getRequestPayload() ([]byte, error) { return a, nil } -func deleteApproval(showMsg bool) error { +func deleteApproval(ctx context.Context, log types.LoggerFactory, showMsg bool) error { a, err := getRequestPayload() if err != nil { return err } - log.Box("Input in Json", string(a)) + log.Box(ctx, "Input in Json", string(a)) if !showMsg { - log.Box("Warning 🚨", "THIS IS A DESTRUCTIVE STEP MAKE SURE IF YOU WANT TO DELETE THE CLUSTER") + log.Box(ctx, "Warning 🚨", "THIS IS A DESTRUCTIVE STEP MAKE SURE IF YOU WANT TO DELETE THE CLUSTER") - log.Print("Enter your choice to continue..[y/N]") + log.Print(ctx, "Enter your choice to continue..[y/N]") choice := "n" unsafe := false fmt.Scanf("%s", &choice) @@ -136,24 +183,24 @@ func deleteApproval(showMsg bool) error { } if !unsafe { - return log.NewError("approval cancelled") + return log.NewError(ctx, "approval cancelled by user") } } return nil } -func createApproval(showMsg bool) error { +func createApproval(ctx context.Context, log types.LoggerFactory, showMsg bool) error { a, err := getRequestPayload() if err != nil { return err } - log.Box("Input in Json", string(a)) + log.Box(ctx, "Input in Json", string(a)) if !showMsg { - log.Box("Warning 🚨", "THIS IS A CREATION STEP MAKE SURE IF YOU WANT TO CREATE THE CLUSTER") + log.Box(ctx, "Warning 🚨", "THIS IS A CREATION STEP MAKE SURE IF YOU WANT TO CREATE THE CLUSTER") - log.Print("Enter your choice to continue..[y/N]") + log.Print(ctx, "Enter your choice to continue..[y/N]") choice := "n" unsafe := false fmt.Scanf("%s", &choice) @@ -164,7 +211,7 @@ func createApproval(showMsg bool) error { } if !unsafe { - return log.NewError("approval cancelled") + return log.NewError(ctx, "approval cancelled by user") } } return nil @@ -318,8 +365,6 @@ func SetDefaults(provider consts.KsctlCloud, clusterType consts.KsctlClusterType if len(storage) == 0 { storage = string(consts.StoreLocal) } - // also check for the cni plugin as in the future relase it will be required - // for installing ksctl agents into the cluster case string(consts.CloudCivo) + string(consts.ClusterTypeHa): if len(nodeSizeCP) == 0 { @@ -374,23 +419,6 @@ func SetDefaults(provider consts.KsctlCloud, clusterType consts.KsctlClusterType } } -func safeInitializeStorageLoggerFactory(ctx context.Context) error { - defer func() { - if r := recover(); r != nil { - log.Error("Recovered in safeInitializeStorageLoggerFactory", r) - } - }() - - switch storage { - case string(consts.StoreExtMongo), string(consts.StoreLocal): - cli.Client.Metadata.StateLocation = consts.KsctlStore(storage) - default: - return log.NewError("not a valid storage option. Valid Options %v\n", [...]string{"external-mongo", "local"}) - } - - return control_pkg.InitializeStorageFactory(ctx, &cli.Client) -} - func argsFlags() { // Managed Azure clusterNameFlag(createClusterAzure) diff --git a/cli/cmd/version.go b/cli/cmd/version.go index 8efc5ab..53f2baf 100644 --- a/cli/cmd/version.go +++ b/cli/cmd/version.go @@ -1,6 +1,5 @@ package cmd -// authors Dipankar import ( "fmt" @@ -8,13 +7,13 @@ import ( ) const ksctl = ` - _     _  _ -| | __ ___  ___ | |_ | | -| |/ // __| / __|| __|| | -|  < \__ \| (__ | |_ | | -|_|\_\|___/ \___| \__||_| -       - + _ _ _ + | | | | | | + | | _____ ___| |_| | + | |/ / __|/ __| __| | + | <\__ \ (__| |_| | + |_|\_\___/\___|\__|_| + ` // change this using ldflags diff --git a/cli/main.go b/cli/main.go index fbfbce8..b15203f 100644 --- a/cli/main.go +++ b/cli/main.go @@ -1,7 +1,5 @@ package main -// authors Dipankar Das - import "github.com/ksctl/cli/cli/cmd" func main() { diff --git a/go.mod b/go.mod index 5ae69de..c0198fd 100644 --- a/go.mod +++ b/go.mod @@ -1,104 +1,108 @@ module github.com/ksctl/cli -go 1.21.0 +go 1.22.0 require ( - github.com/ksctl/ksctl v1.1.4 + github.com/Delta456/box-cli-maker/v2 v2.3.0 + github.com/fatih/color v1.17.0 + github.com/ksctl/ksctl v1.2.0 + github.com/rodaine/table v1.2.0 github.com/spf13/cobra v1.8.0 ) require ( github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 // indirect - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 // indirect - github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 // indirect - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.5.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.7.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.8.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions v1.3.0 // indirect - github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 // indirect - github.com/BurntSushi/toml v1.3.2 // indirect - github.com/Delta456/box-cli-maker/v2 v2.3.0 // indirect + github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect + github.com/BurntSushi/toml v1.4.0 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/Masterminds/squirrel v1.5.4 // indirect - github.com/Microsoft/hcsshim v0.11.4 // indirect - github.com/alessio/shellescape v1.4.1 // indirect - github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect - github.com/aws/aws-sdk-go-v2 v1.25.0 // indirect - github.com/aws/aws-sdk-go-v2/config v1.27.0 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.17.0 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0 // indirect + github.com/Microsoft/hcsshim v0.12.3 // indirect + github.com/alessio/shellescape v1.4.2 // indirect + github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect + github.com/aws/aws-sdk-go-v2 v1.27.0 // indirect + github.com/aws/aws-sdk-go-v2/config v1.27.16 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.16 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect - github.com/aws/aws-sdk-go-v2/service/ec2 v1.148.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.19.0 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 // indirect - github.com/aws/smithy-go v1.20.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ec2 v1.162.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.3 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.28.10 // indirect + github.com/aws/smithy-go v1.20.2 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/chai2010/gettext-go v1.0.2 // indirect - github.com/civo/civogo v0.3.58 // indirect - github.com/containerd/containerd v1.7.11 // indirect + github.com/blang/semver/v4 v4.0.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/chai2010/gettext-go v1.0.3 // indirect + github.com/civo/civogo v0.3.70 // indirect + github.com/containerd/containerd v1.7.17 // indirect github.com/containerd/log v0.1.0 // indirect - github.com/cyphar/filepath-securejoin v0.2.4 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/docker/cli v24.0.6+incompatible // indirect - github.com/docker/distribution v2.8.2+incompatible // indirect - github.com/docker/docker v24.0.7+incompatible // indirect - github.com/docker/docker-credential-helpers v0.7.0 // indirect - github.com/docker/go-connections v0.4.0 // indirect + github.com/cyphar/filepath-securejoin v0.2.5 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/distribution/reference v0.6.0 // indirect + github.com/docker/cli v26.1.3+incompatible // indirect + github.com/docker/distribution v2.8.3+incompatible // indirect + github.com/docker/docker v26.1.3+incompatible // indirect + github.com/docker/docker-credential-helpers v0.8.2 // indirect + github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-metrics v0.0.1 // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/emicklei/go-restful/v3 v3.11.0 // indirect - github.com/evanphx/json-patch v5.7.0+incompatible // indirect - github.com/evanphx/json-patch/v5 v5.6.0 // indirect - github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect - github.com/fatih/color v1.16.0 // indirect - github.com/felixge/httpsnoop v1.0.3 // indirect - github.com/go-errors/errors v1.4.2 // indirect + github.com/emicklei/go-restful/v3 v3.12.1 // indirect + github.com/evanphx/json-patch v5.9.0+incompatible // indirect + github.com/evanphx/json-patch/v5 v5.9.0 // indirect + github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/go-errors/errors v1.5.1 // indirect github.com/go-gorp/gorp/v3 v3.1.0 // indirect - github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-openapi/jsonpointer v0.19.6 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/gobwas/glob v0.2.3 // indirect - github.com/goccy/go-json v0.10.2 // indirect + github.com/goccy/go-json v0.10.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.1 // indirect - github.com/google/btree v1.0.1 // indirect + github.com/golang-jwt/jwt/v5 v5.2.1 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/btree v1.1.2 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect + github.com/google/safetext v0.0.0-20240104143208-7a7d9b3d812f // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/google/uuid v1.5.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/gookit/color v1.5.4 // indirect - github.com/gorilla/mux v1.8.0 // indirect + github.com/gorilla/mux v1.8.1 // indirect + github.com/gorilla/websocket v1.5.1 // indirect github.com/gosuri/uitable v0.0.4 // indirect - github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect + github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/huandu/xstrings v1.4.0 // indirect - github.com/imdario/mergo v0.3.13 // indirect + github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/jmoiron/sqlx v1.3.5 // indirect + github.com/jmoiron/sqlx v1.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.16.0 // indirect + github.com/klauspost/compress v1.17.8 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect @@ -118,27 +122,28 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect - github.com/montanaflynn/stats v0.7.0 // indirect + github.com/montanaflynn/stats v0.7.1 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/muesli/reflow v0.3.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc5 // indirect + github.com/opencontainers/image-spec v1.1.0 // indirect + github.com/pborman/uuid v1.2.1 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.16.0 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect - github.com/rivo/uniseg v0.2.0 // indirect - github.com/rodaine/table v1.1.1 // indirect - github.com/rubenv/sql-migrate v1.5.2 // indirect + github.com/prometheus/client_golang v1.19.1 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.53.0 // indirect + github.com/prometheus/procfs v0.15.0 // indirect + github.com/rivo/uniseg v0.4.7 // indirect + github.com/rubenv/sql-migrate v1.6.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/shopspring/decimal v1.3.1 // indirect + github.com/shopspring/decimal v1.4.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/cast v1.6.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.2 // indirect @@ -148,45 +153,47 @@ require ( github.com/xeipuuv/gojsonschema v1.2.0 // indirect github.com/xlab/treeprint v1.2.0 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect - github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect - go.mongodb.org/mongo-driver v1.14.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect - go.opentelemetry.io/otel v1.19.0 // indirect - go.opentelemetry.io/otel/metric v1.19.0 // indirect - go.opentelemetry.io/otel/trace v1.19.0 // indirect - go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect - golang.org/x/crypto v0.19.0 // indirect - golang.org/x/net v0.20.0 // indirect - golang.org/x/oauth2 v0.10.0 // indirect - golang.org/x/sync v0.5.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/term v0.17.0 // indirect - golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.3.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect - google.golang.org/grpc v1.58.3 // indirect - google.golang.org/protobuf v1.31.0 // indirect + github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76 // indirect + go.mongodb.org/mongo-driver v1.15.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect + go.opentelemetry.io/otel v1.27.0 // indirect + go.opentelemetry.io/otel/metric v1.27.0 // indirect + go.opentelemetry.io/otel/trace v1.27.0 // indirect + go.starlark.net v0.0.0-20240520160348-046347dcd104 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/oauth2 v0.20.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/term v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect + golang.org/x/time v0.5.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect + google.golang.org/grpc v1.64.0 // indirect + google.golang.org/protobuf v1.34.1 // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - helm.sh/helm/v3 v3.13.2 // indirect - k8s.io/api v0.28.4 // indirect - k8s.io/apiextensions-apiserver v0.28.4 // indirect - k8s.io/apimachinery v0.28.4 // indirect - k8s.io/apiserver v0.28.4 // indirect - k8s.io/cli-runtime v0.28.3 // indirect - k8s.io/client-go v0.28.4 // indirect - k8s.io/component-base v0.28.4 // indirect - k8s.io/klog/v2 v2.110.1 // indirect - k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect - k8s.io/kubectl v0.28.3 // indirect - k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect - oras.land/oras-go v1.2.4 // indirect + helm.sh/helm/v3 v3.15.1 // indirect + k8s.io/api v0.30.1 // indirect + k8s.io/apiextensions-apiserver v0.30.1 // indirect + k8s.io/apimachinery v0.30.1 // indirect + k8s.io/apiserver v0.30.1 // indirect + k8s.io/cli-runtime v0.30.1 // indirect + k8s.io/client-go v0.30.1 // indirect + k8s.io/component-base v0.30.1 // indirect + k8s.io/klog/v2 v2.120.1 // indirect + k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a // indirect + k8s.io/kubectl v0.30.1 // indirect + k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 // indirect + oras.land/oras-go v1.2.5 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/kind v0.22.0 // indirect - sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect - sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 // indirect + sigs.k8s.io/kind v0.23.0 // indirect + sigs.k8s.io/kustomize/api v0.17.2 // indirect + sigs.k8s.io/kustomize/kyaml v0.17.1 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index 26fe1b0..12d7c51 100644 --- a/go.sum +++ b/go.sum @@ -1,16 +1,27 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 h1:c4k2FIYIh4xtwqrQwV0Ct1v5+ehlNXj5NI/MWVsiTkQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2/go.mod h1:5FDJtLEO/GxwNgUxbwrY3LP0pEoThTQJtk2oysdXHxM= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 h1:E+OJmp2tPvt1W+amx48v1eqbjDYsgN+RzP4q16yV5eM= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1/go.mod h1:a6xsAQUZg+VsS3TJ05SRp524Hs4pZ/AeFSr5ENf0Yjo= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 h1:sO0/P7g68FrryJzljemN+6GTssUXdANk6aJ7T1ZxnsQ= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1/go.mod h1:h8hyGFDsU5HMivxiS2iYFZsgDbU9OnnJ163x5UGVKYo= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 h1:FDif4R1+UUR+00q6wquyX90K7A8dN+R5E8GEadoP7sU= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2/go.mod h1:aiYBYui4BJ/BJCAIKs92XiPyQfTaBWqvHujDwKb6CBU= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 h1:LqbJ/WzJUwBf8UiaSzgX7aMclParm9/5Vgp+TY51uBQ= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2/go.mod h1:yInRyqWXAuaPrgI7p70+lDDgh3mlBohis29jGMISnmc= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0 h1:jBQA3cKT4L2rWMpgE7Yt3Hwh2aUj8KXjIGLxjHeYNNo= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0/go.mod h1:4OG6tQ9EOP/MT0NMjDlRzWoVFxfu9rN9B2X+tlSVktg= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.5.0 h1:MxA59PGoCFb+vCwRQi3PhQEwHj4+r2dhuv9HG+vM7iM= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.5.0/go.mod h1:uYt4CfhkJA9o0FN7jfE5minm/i4nUE4MjGUJkzB6Zs8= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0 h1:LkHbJbgF3YyvC53aqYGR+wWQDn2Rdp9AQdGndf9QvY4= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0/go.mod h1:QyiQdW4f4/BIfB8ZutZ2s+28RAgfa/pT+zS++ZHyM1I= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.7.0 h1:g65N4m1sAjm0BkjIJYtp5qnJlkoFtd6oqfa27KO9fI4= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.7.0/go.mod h1:noQIdW75SiQFB3mSFJBr4iRRH83S9skaFiBv4C0uEs0= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.8.0 h1:0nGmzwBv5ougvzfGPCO2ljFRHvun57KpNrVCMrlk0ns= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.8.0/go.mod h1:gYq8wyDgv6JLhGbAU6gg8amCPgQWRE+aCvrV2gyzdfs= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.0.0 h1:lMW1lD/17LUA5z1XTURo7LcVG2ICBPlyMHjIUrcFZNQ= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.0.0/go.mod h1:ceIuwmxDWptoW3eCqSXlnPsZFKh4X+R38dWPv7GS9Vs= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= @@ -25,12 +36,18 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions v1.3.0/go.mod h1:TpiwjwnW/khS0LKs4vW5UmmT9OWcxaveS8U7+tlknzo= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/Delta456/box-cli-maker/v2 v2.3.0 h1:rGdoK/Qt3shdT1uqRMGgPqrhtisGD7PamTW8vY5MyCA= @@ -50,6 +67,8 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w= +github.com/Microsoft/hcsshim v0.12.3 h1:LS9NXqXhMoqNCplK1ApmVSfB4UnVLRDWRapB6EIlxE0= +github.com/Microsoft/hcsshim v0.12.3/go.mod h1:Iyl1WVpZzr+UkzjekHZbV8o5Z9ZkxNGx6CtY2Qg/JVQ= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d h1:UrqY+r/OJnIp5u0s1SbQ8dVfLCZJsnvazdBP5hS4iRs= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= @@ -57,43 +76,75 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0= github.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= +github.com/alessio/shellescape v1.4.2 h1:MHPfaU+ddJ0/bYWpgIeUnQUqKrlJ1S7BfEYPM4uEoM0= +github.com/alessio/shellescape v1.4.2/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY= github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aws/aws-sdk-go-v2 v1.25.0 h1:sv7+1JVJxOu/dD/sz/csHX7jFqmP001TIY7aytBWDSQ= github.com/aws/aws-sdk-go-v2 v1.25.0/go.mod h1:G104G1Aho5WqF+SR3mDIobTABQzpYV0WxMsKxlMggOA= +github.com/aws/aws-sdk-go-v2 v1.27.0 h1:7bZWKoXhzI+mMR/HjdMx8ZCC5+6fY0lS5tr0bbgiLlo= +github.com/aws/aws-sdk-go-v2 v1.27.0/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= github.com/aws/aws-sdk-go-v2/config v1.27.0 h1:J5sdGCAHuWKIXLeXiqr8II/adSvetkx0qdZwdbXXpb0= github.com/aws/aws-sdk-go-v2/config v1.27.0/go.mod h1:cfh8v69nuSUohNFMbIISP2fhmblGmYEOKs5V53HiHnk= +github.com/aws/aws-sdk-go-v2/config v1.27.16 h1:knpCuH7laFVGYTNd99Ns5t+8PuRjDn4HnnZK48csipM= +github.com/aws/aws-sdk-go-v2/config v1.27.16/go.mod h1:vutqgRhDUktwSge3hrC3nkuirzkJ4E/mLj5GvI0BQas= github.com/aws/aws-sdk-go-v2/credentials v1.17.0 h1:lMW2x6sKBsiAJrpi1doOXqWFyEPoE886DTb1X0wb7So= github.com/aws/aws-sdk-go-v2/credentials v1.17.0/go.mod h1:uT41FIH8cCIxOdUYIL0PYyHlL1NoneDuDSCwg5VE/5o= +github.com/aws/aws-sdk-go-v2/credentials v1.17.16 h1:7d2QxY83uYl0l58ceyiSpxg9bSbStqBC6BeEeHEchwo= +github.com/aws/aws-sdk-go-v2/credentials v1.17.16/go.mod h1:Ae6li/6Yc6eMzysRL2BXlPYvnrLLBg3D11/AmOjw50k= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0 h1:xWCwjjvVz2ojYTP4kBKUuUh9ZrXfcAXpflhOUUeXg1k= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.0/go.mod h1:j3fACuqXg4oMTQOR2yY7m0NmJY0yBK4L4sLsRXq1Ins= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3 h1:dQLK4TjtnlRGb0czOht2CevZ5l6RSyRWAnKeGd7VAFE= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3/go.mod h1:TL79f2P6+8Q7dTsILpiVST+AL9lkF6PPGI167Ny0Cjw= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0 h1:NPs/EqVO+ajwOoq56EfcGKa3L3ruWuazkIw1BqxwOPw= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.0/go.mod h1:D+duLy2ylgatV+yTlQ8JTuLfDD0BnFvnQRc+o6tbZ4M= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7 h1:lf/8VTF2cM+N4SLzaYJERKEWAXq8MOMpZfU6wEPWsPk= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7/go.mod h1:4SjkU7QiqK2M9oozyMzfZ/23LmUY+h3oFqhdeP5OMiI= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0 h1:ks7KGMVUMoDzcxNWUlEdI+/lokMFD136EL6DWmUOV80= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.0/go.mod h1:hL6BWM/d/qz113fVitZjbXR0E+RCTU1+x+1Idyn5NgE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7 h1:4OYVp0705xu8yjdyoWix0r9wPIRXnIzzOoUpQVHIJ/g= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7/go.mod h1:vd7ESTEvI76T2Na050gODNmNU7+OyKrIKroYTu4ABiI= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= github.com/aws/aws-sdk-go-v2/service/ec2 v1.148.0 h1:7imiXQvuqyUEu6wdcn6xRjR3zIJjDuAnS2e1S3ND+C0= github.com/aws/aws-sdk-go-v2/service/ec2 v1.148.0/go.mod h1:ntWksNNQcXImRQMdxab74tp+H94neF/TwQJ9Ndxb04k= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.162.0 h1:A1YMX7uMzXhfIEL9zc5049oQgSaH4ZeXx/sOth0dk/I= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.162.0/go.mod h1:iJ2sQeUTkjNp3nL7kE/Bav0xXYhtiRCRP5ZXk4jFhCQ= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0 h1:a33HuFlO0KsveiP90IUJh8Xr/cx9US2PqkSroaLc+o8= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.0/go.mod h1:SxIkWpByiGbhbHYTo9CMTUnx2G4p4ZQMrDPcRRy//1c= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0 h1:SHN/umDLTmFTmYfI+gkanz6da3vK8Kvj/5wkqnTHbuA= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.0/go.mod h1:l8gPU5RYGOFHJqWEpPMoRTP0VoaWQSkJdKo+hwWnnDA= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9 h1:Wx0rlZoEJR7JwlSZcHnEa7CNjrSIyVxMFWGAaXy4fJY= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9/go.mod h1:aVMHdE0aHO3v+f/iw01fmXV/5DbfQ3Bi9nN7nd9bE9Y= github.com/aws/aws-sdk-go-v2/service/sso v1.19.0 h1:u6OkVDxtBPnxPkZ9/63ynEe+8kHbtS5IfaC4PzVxzWM= github.com/aws/aws-sdk-go-v2/service/sso v1.19.0/go.mod h1:YqbU3RS/pkDVu+v+Nwxvn0i1WB0HkNWEePWbmODEbbs= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.9 h1:aD7AGQhvPuAxlSUfo0CWU7s6FpkbyykMhGYMvlqTjVs= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.9/go.mod h1:c1qtZUWtygI6ZdvKppzCSXsDOq5I4luJPZ0Ud3juFCA= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0 h1:6DL0qu5+315wbsAEEmzK+P9leRwNbkp+lGjPC+CEvb8= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.22.0/go.mod h1:olUAyg+FaoFaL/zFaeQQONjOZ9HXoxgvI/c7mQTYz7M= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.3 h1:Pav5q3cA260Zqez42T9UhIlsd9QeypszRPwC9LdSSsQ= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.3/go.mod h1:9lmoVDVLz/yUZwLaQ676TK02fhCu4+PgRSmMaKR1ozk= github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 h1:cjTRjh700H36MQ8M0LnDn33W3JmwC77mdxIIyPWCdpM= github.com/aws/aws-sdk-go-v2/service/sts v1.27.0/go.mod h1:nXfOBMWPokIbOY+Gi7a1psWMSvskUCemZzI+SMB7Akc= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.10 h1:69tpbPED7jKPyzMcrwSvhWcJ9bPnZsZs18NT40JwM0g= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.10/go.mod h1:0Aqn1MnEuitqfsCNyKsdKLhDUOr4txD/g19EfiUqgws= github.com/aws/smithy-go v1.20.0 h1:6+kZsCXZwKxZS9RfISnPc4EXlHoyAkm2hPuM8X2BrrQ= github.com/aws/smithy-go v1.20.0/go.mod h1:uo5RKksAl4PzhqaAbjd4rLgFoq5koTsQKYuGe7dklGc= +github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q= +github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bshuster-repo/logrus-logstash-hook v1.0.0 h1:e+C0SB5R1pu//O4MQ3f9cFuPGoOVeF2fE4Og9otCc70= github.com/bshuster-repo/logrus-logstash-hook v1.0.0/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd h1:rFt+Y/IK1aEZkEHchZRSq9OQbsSzIT/OrI8YFFmRIng= @@ -105,18 +156,26 @@ github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3k github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk= github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= +github.com/chai2010/gettext-go v1.0.3 h1:9liNh8t+u26xl5ddmWLmsOsdNLwkdRTg5AG+JnTiM80= +github.com/chai2010/gettext-go v1.0.3/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/civo/civogo v0.3.58 h1:FikCbwAKB5ovD8+NmSi7rzYBSpC4nUpGVpCyngEkTo4= github.com/civo/civogo v0.3.58/go.mod h1:54lv/FOf7gh6wE9ZwVdw4yBehk8V1CvU9aWa4v6dvW0= +github.com/civo/civogo v0.3.70 h1:QPuFm5EmpkScbdFo5/6grcG2xcvd/lgdolOtENT04Ac= +github.com/civo/civogo v0.3.70/go.mod h1:7UCYX+qeeJbrG55E1huv+0ySxcHTqq/26FcHLVelQJM= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= github.com/containerd/containerd v1.7.11 h1:lfGKw3eU35sjV0aG2eYZTiwFEY1pCzxdzicHP3SZILw= github.com/containerd/containerd v1.7.11/go.mod h1:5UluHxHTX2rdvYuZ5OJTC5m/KJNs0Zs9wVoJm9zf5ZE= +github.com/containerd/containerd v1.7.17 h1:KjNnn0+tAVQHAoaWRjmdak9WlvnFR/8rU1CHHy8Rm2A= +github.com/containerd/containerd v1.7.17/go.mod h1:vK+hhT4TIv2uejlcDlbVIc8+h/BqtKLIyNrtCZol8lI= github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= @@ -128,23 +187,39 @@ github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= +github.com/cyphar/filepath-securejoin v0.2.5 h1:6iR5tXJ/e6tJZzzdMc1km3Sa7RRIVBKAK32O2s7AYfo= +github.com/cyphar/filepath-securejoin v0.2.5/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2 h1:aBfCb7iqHmDEIp6fBvC/hQUddQfg+3qdYjwzaiP9Hnc= github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2/go.mod h1:WHNsWjnIn2V1LYOrME7e8KxSeKunYHsxEm4am0BUtcI= +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/cli v24.0.6+incompatible h1:fF+XCQCgJjjQNIMjzaSmiKJSCcfcXb3TWTcc7GAneOY= github.com/docker/cli v24.0.6+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v26.1.3+incompatible h1:bUpXT/N0kDE3VUHI2r5VMsYQgi38kYuoC0oL9yt3lqc= +github.com/docker/cli v26.1.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= +github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v26.1.3+incompatible h1:lLCzRbrVZrljpVNobJu1J2FHk8V0s4BawoZippkc+xo= +github.com/docker/docker v26.1.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= +github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo= +github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= +github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= @@ -157,19 +232,31 @@ github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3 github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= +github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v5.9.0+incompatible h1:fBXyNpNMuTTDdquAq/uisOr2lShz4oaXpDTX2bLe7ls= +github.com/evanphx/json-patch v5.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= +github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= +github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwCFad8crR9dcMQWvV9Hvulu6hwUh4tWPJnM= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= +github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f h1:Wl78ApPPB2Wvf/TIe2xdyJxTlb6obmF18d8QdkxNDu4= +github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f/go.mod h1:OSYXu++VVOHnXeitef/D8n/6y4QV8uLHSFXX4NeXMGc= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/foxcpp/go-mockdns v1.0.0 h1:7jBqxd3WDWwi/6WhDvacvH1XsN3rOLXyHM1uhvIx6FI= github.com/foxcpp/go-mockdns v1.0.0/go.mod h1:lgRN6+KxQBawyIghpnl5CezHFGS9VLzvtVlwxvzXTQ4= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= @@ -178,6 +265,8 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk= +github.com/go-errors/errors v1.5.1/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gorp/gorp/v3 v3.1.0 h1:ItKF/Vbuj31dmV4jxA1qblpSwkl9g1typ24xoe70IGs= github.com/go-gorp/gorp/v3 v3.1.0/go.mod h1:dLEjIyyRNiXvNZ8PSmzpt1GsWAUK8kjVhEpjH8TixEw= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -190,17 +279,26 @@ github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbV github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= @@ -215,11 +313,15 @@ github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= +github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -238,12 +340,18 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.8.2 h1:H5XSIre1MB5NbPYFp+i1NBbb5qN1W8Y8YAQoAYbkm8k= github.com/gomodule/redigo v1.8.2/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= +github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= @@ -270,13 +378,18 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJY github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 h1:SJ+NtwL6QaZ21U+IrK7d0gGgpjGGvd2kz+FzTHVzdqI= github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2/go.mod h1:Tv1PlzqC9t8wNnpPdctvtSUOPUUg4SHeE6vR1Ir2hmg= +github.com/google/safetext v0.0.0-20240104143208-7a7d9b3d812f h1:o2yGZLlsOj5H5uvtQNEdi6DeA0GbUP3lm0gWW5RvY0s= +github.com/google/safetext v0.0.0-20240104143208-7a7d9b3d812f/go.mod h1:H3K1Iu/utuCfa10JO+GsmKUYSWi7ug57Rk6GaDRHaaQ= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gookit/color v1.5.2/go.mod h1:w8h4bGiHeeBpvQVePTutdbERIUf3oJE5lZ8HM0UgXyg= github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0= github.com/gookit/color v1.5.4/go.mod h1:pZJOeOS8DM43rXbp4AZo1n9zCU2qjpcRko0b6/QJi9w= @@ -286,11 +399,17 @@ github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= +github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/gosuri/uitable v0.0.4 h1:IG2xLKRvErL3uhY6e1BylFzG+aJiwQviDDTfOKeKTpY= github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= +github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -307,6 +426,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1: github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= +github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= @@ -317,6 +438,8 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= +github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o= +github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -330,6 +453,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= +github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -344,6 +469,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/ksctl/ksctl v1.1.4 h1:ptPbZ46rU1Trpw5+oKgXVtQyXYrL+8kATLW+0Ud6sRs= github.com/ksctl/ksctl v1.1.4/go.mod h1:nnzX02/62FkElM8rHvrM3W8USCOgcAtnf3p81U2FvQ4= +github.com/ksctl/ksctl v1.2.0 h1:idefORYpq+nfPUV3gB8bs9QHVd0kp5RMcYOR1BE3zUQ= +github.com/ksctl/ksctl v1.2.0/go.mod h1:rKTOLhhSx8yPzmM3QwBCT0R4Xv4zlIF6ZnWp8xfCuao= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw= @@ -376,6 +503,7 @@ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.15 h1:vfoHhTN1af61xCRSWzFIWzx2YskyMTwHLrExkBOjvxI= github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= @@ -409,6 +537,8 @@ github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/ github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= github.com/montanaflynn/stats v0.7.0 h1:r3y12KyNxj/Sb/iOE46ws+3mS1+MZca1wlHQFPsY/JU= github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= +github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE= +github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= @@ -417,6 +547,7 @@ github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8m github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -437,6 +568,7 @@ github.com/onsi/ginkgo/v2 v2.9.0/go.mod h1:4xkjoL/tZv4SMWeww56BU5kAt19mVB47gTWxm github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo= github.com/onsi/ginkgo/v2 v2.9.4 h1:xR7vG4IXt5RWx6FfIjyAtsoMAtnc3C/rFXBBd2AjZwE= github.com/onsi/ginkgo/v2 v2.9.4/go.mod h1:gCQYp2Q+kSoIj7ykSVb9nskRSsR6PUj4AiLywzIhbKM= +github.com/onsi/ginkgo/v2 v2.17.2 h1:7eMhcy3GimbsA3hEnVKdw/PQM9XN9krpKVXsZdph0/g= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= @@ -456,6 +588,10 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= +github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= +github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= +github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw= +github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= @@ -478,30 +614,46 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= +github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.15.0 h1:A82kmvXJq2jTu5YUhSGNlYoxh85zLnKgPz4bMZgI5Ek= +github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rodaine/table v1.1.1 h1:zBliy3b4Oj6JRmncse2Z85WmoQvDrXOYuy0JXCt8Qz8= github.com/rodaine/table v1.1.1/go.mod h1:iqTRptjn+EVcrVBYtNMlJ2wrJZa3MpULUmcXFpfcziA= +github.com/rodaine/table v1.2.0 h1:38HEnwK4mKSHQJIkavVj+bst1TEY7j9zhLMWu4QJrMA= +github.com/rodaine/table v1.2.0/go.mod h1:wejb/q/Yd4T/SVmBSRMr7GCq3KlcZp3gyNYdLSBhkaE= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/rubenv/sql-migrate v1.5.2 h1:bMDqOnrJVV/6JQgQ/MxOpU+AdO8uzYYA/TxFUBzFtS0= github.com/rubenv/sql-migrate v1.5.2/go.mod h1:H38GW8Vqf8F0Su5XignRyaRcbXbJunSWxs+kmzlg0Is= +github.com/rubenv/sql-migrate v1.6.1 h1:bo6/sjsan9HaXAsNxYP/jCEDUGibHp8JmOBw7NTGRos= +github.com/rubenv/sql-migrate v1.6.1/go.mod h1:tPzespupJS0jacLfhbwto/UjSX+8h2FdWB7ar+QlHa0= +github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= +github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= @@ -509,6 +661,8 @@ github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNX github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= +github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= @@ -516,6 +670,8 @@ github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTd github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= @@ -527,15 +683,18 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= @@ -556,6 +715,8 @@ github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavM github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76 h1:tBiBTKHnIjovYoLX/TPkcf+OjqqKGQrPtGT3Foz+Pgo= +github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76/go.mod h1:SQliXeA7Dhkt//vS29v3zpbEwoa+zb2Cn5xj5uO4K5U= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= @@ -568,18 +729,30 @@ github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f h1 github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80= go.mongodb.org/mongo-driver v1.14.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= +go.mongodb.org/mongo-driver v1.15.0 h1:rJCKC8eEliewXjZGf0ddURtl7tTVy1TK3bfl0gkUSLc= +go.mongodb.org/mongo-driver v1.15.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 h1:x8Z78aZx8cOF0+Kkazoc7lwUNMGy0LrzEMxTm4BbTxg= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 h1:9l89oX4ba9kHbBol3Xin3leYJ+252h0zszDtBwyKe2A= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0/go.mod h1:XLZfZboOJWHNKUv7eH0inh0E9VV6eWDFB/9yJyTLPp0= go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= +go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= +go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= +go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= +go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= +go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= go.starlark.net v0.0.0-20230525235612-a134d8f9ddca h1:VdD38733bfYv5tUZwEIskMM93VanwNIi5bIKnDrJdEY= go.starlark.net v0.0.0-20230525235612-a134d8f9ddca/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= +go.starlark.net v0.0.0-20240520160348-046347dcd104 h1:3qhteRISupnJvaWshOmeqEUs2y9oc/+/ePPvDh3Eygg= +go.starlark.net v0.0.0-20240520160348-046347dcd104/go.mod h1:YKMCv9b1WrfWmeqdV5MAuEHWsu5iC+fe6kYl2sQjdI8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -589,6 +762,8 @@ golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561 h1:MDc5xs78ZrZr3HMQugiXOAkSZtfTpbJLDr/lwfgO53E= golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= @@ -605,6 +780,8 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -634,9 +811,13 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= +golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -648,6 +829,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -684,6 +867,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -696,6 +881,8 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -709,9 +896,13 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -739,17 +930,23 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -767,6 +964,8 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -775,6 +974,8 @@ gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= +gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= @@ -795,24 +996,40 @@ gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= helm.sh/helm/v3 v3.13.2 h1:IcO9NgmmpetJODLZhR3f3q+6zzyXVKlRizKFwbi7K8w= helm.sh/helm/v3 v3.13.2/go.mod h1:GIHDwZggaTGbedevTlrQ6DB++LBN6yuQdeGj0HNaDx0= +helm.sh/helm/v3 v3.15.1 h1:22ztacHz4gMqhXNqCQ9NAg6BFWoRUryNLvnkz6OVyw0= +helm.sh/helm/v3 v3.15.1/go.mod h1:fvfoRcB8UKRUV5jrIfOTaN/pG1TPhuqSb56fjYdTKXg= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/api v0.27.1/go.mod h1:z5g/BpAiD+f6AArpqNjkY+cji8ueZDU/WV1jcj5Jk4E= k8s.io/api v0.28.4 h1:8ZBrLjwosLl/NYgv1P7EQLqoO8MGQApnbgH8tu3BMzY= k8s.io/api v0.28.4/go.mod h1:axWTGrY88s/5YE+JSt4uUi6NMM+gur1en2REMR7IRj0= +k8s.io/api v0.30.1 h1:kCm/6mADMdbAxmIh0LBjS54nQBE+U4KmbCfIkF5CpJY= +k8s.io/api v0.30.1/go.mod h1:ddbN2C0+0DIiPntan/bye3SW3PdwLa11/0yqwvuRrJM= k8s.io/apiextensions-apiserver v0.28.4 h1:AZpKY/7wQ8n+ZYDtNHbAJBb+N4AXXJvyZx6ww6yAJvU= k8s.io/apiextensions-apiserver v0.28.4/go.mod h1:pgQIZ1U8eJSMQcENew/0ShUTlePcSGFq6dxSxf2mwPM= +k8s.io/apiextensions-apiserver v0.30.1 h1:4fAJZ9985BmpJG6PkoxVRpXv9vmPUOVzl614xarePws= +k8s.io/apiextensions-apiserver v0.30.1/go.mod h1:R4GuSrlhgq43oRY9sF2IToFh7PVlF1JjfWdoG3pixk4= k8s.io/apimachinery v0.27.1/go.mod h1:5ikh59fK3AJ287GUvpUsryoMFtH9zj/ARfWCo3AyXTM= k8s.io/apimachinery v0.28.4 h1:zOSJe1mc+GxuMnFzD4Z/U1wst50X28ZNsn5bhgIIao8= k8s.io/apimachinery v0.28.4/go.mod h1:wI37ncBvfAoswfq626yPTe6Bz1c22L7uaJ8dho83mgg= +k8s.io/apimachinery v0.30.1 h1:ZQStsEfo4n65yAdlGTfP/uSHMQSoYzU/oeEbkmF7P2U= +k8s.io/apimachinery v0.30.1/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= k8s.io/apiserver v0.28.4 h1:BJXlaQbAU/RXYX2lRz+E1oPe3G3TKlozMMCZWu5GMgg= k8s.io/apiserver v0.28.4/go.mod h1:Idq71oXugKZoVGUUL2wgBCTHbUR+FYTWa4rq9j4n23w= +k8s.io/apiserver v0.30.1 h1:BEWEe8bzS12nMtDKXzCF5Q5ovp6LjjYkSp8qOPk8LZ8= +k8s.io/apiserver v0.30.1/go.mod h1:i87ZnQ+/PGAmSbD/iEKM68bm1D5reX8fO4Ito4B01mo= k8s.io/cli-runtime v0.28.3 h1:lvuJYVkwCqHEvpS6KuTZsUVwPePFjBfSGvuaLl2SxzA= k8s.io/cli-runtime v0.28.3/go.mod h1:jeX37ZPjIcENVuXDDTskG3+FnVuZms5D9omDXS/2Jjc= +k8s.io/cli-runtime v0.30.1 h1:kSBBpfrJGS6lllc24KeniI9JN7ckOOJKnmFYH1RpTOw= +k8s.io/cli-runtime v0.30.1/go.mod h1:zhHgbqI4J00pxb6gM3gJPVf2ysDjhQmQtnTxnMScab8= k8s.io/client-go v0.28.4 h1:Np5ocjlZcTrkyRJ3+T3PkXDpe4UpatQxj85+xjaD2wY= k8s.io/client-go v0.28.4/go.mod h1:0VDZFpgoZfelyP5Wqu0/r/TRYcLYuJ2U1KEeoaPa1N4= +k8s.io/client-go v0.30.1 h1:uC/Ir6A3R46wdkgCV3vbLyNOYyCJ8oZnjtJGKfytl/Q= +k8s.io/client-go v0.30.1/go.mod h1:wrAqLNs2trwiCH/wxxmT/x3hKVH9PuV0GGW0oDoHVqc= k8s.io/component-base v0.28.4 h1:c/iQLWPdUgI90O+T9TeECg8o7N3YJTiuz2sKxILYcYo= k8s.io/component-base v0.28.4/go.mod h1:m9hR0uvqXDybiGL2nf/3Lf0MerAfQXzkfWhUY58JUbU= +k8s.io/component-base v0.30.1 h1:bvAtlPh1UrdaZL20D9+sWxsJljMi0QZ3Lmw+kmZAaxQ= +k8s.io/component-base v0.30.1/go.mod h1:e/X9kDiOebwlI41AvBHuWdqFriSRrX50CdwA9TFaHLI= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= @@ -820,28 +1037,46 @@ k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= +k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= +k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a/go.mod h1:y5VtZWM9sHHc2ZodIH/6SHzXj+TPU5USoA8lcIeKEKY= k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a h1:zD1uj3Jf+mD4zmA7W+goE5TxDkI7OGJjBNBzq5fJtLA= +k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc= k8s.io/kubectl v0.28.3 h1:H1Peu1O3EbN9zHkJCcvhiJ4NUj6lb88sGPO5wrWIM6k= k8s.io/kubectl v0.28.3/go.mod h1:RDAudrth/2wQ3Sg46fbKKl4/g+XImzvbsSRZdP2RiyE= +k8s.io/kubectl v0.30.1 h1:sHFIRI3oP0FFZmBAVEE8ErjnTyXDPkBcvO88mH9RjuY= +k8s.io/kubectl v0.30.1/go.mod h1:7j+L0Cc38RYEcx+WH3y44jRBe1Q1jxdGPKkX0h4iDq0= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCIXHaathvJg1C3ak= +k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= oras.land/oras-go v1.2.4 h1:djpBY2/2Cs1PV87GSJlxv4voajVOMZxqqtq9AB8YNvY= oras.land/oras-go v1.2.4/go.mod h1:DYcGfb3YF1nKjcezfX2SNlDAeQFKSXmf+qrFmrh4324= +oras.land/oras-go v1.2.5 h1:XpYuAwAb0DfQsunIyMfeET92emK8km3W4yEzZvUbsTo= +oras.land/oras-go v1.2.5/go.mod h1:PuAwRShRZCsZb7g8Ar3jKKQR/2A/qN+pkYxIOd/FAoo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kind v0.22.0 h1:z/+yr/azoOfzsfooqRsPw1wjJlqT/ukXP0ShkHwNlsI= sigs.k8s.io/kind v0.22.0/go.mod h1:aBlbxg08cauDgZ612shr017/rZwqd7AS563FvpWKPVs= +sigs.k8s.io/kind v0.23.0 h1:8fyDGWbWTeCcCTwA04v4Nfr45KKxbSPH1WO9K+jVrBg= +sigs.k8s.io/kind v0.23.0/go.mod h1:ZQ1iZuJLh3T+O8fzhdi3VWcFTzsdXtNv2ppsHc8JQ7s= sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 h1:XX3Ajgzov2RKUdc5jW3t5jwY7Bo7dcRm+tFxT+NfgY0= sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3/go.mod h1:9n16EZKMhXBNSiUC5kSdFQJkdH3zbxS/JoO619G1VAY= +sigs.k8s.io/kustomize/api v0.17.2 h1:E7/Fjk7V5fboiuijoZHgs4aHuexi5Y2loXlVOAVAG5g= +sigs.k8s.io/kustomize/api v0.17.2/go.mod h1:UWTz9Ct+MvoeQsHcJ5e+vziRRkwimm3HytpZgIYqye0= sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 h1:W6cLQc5pnqM7vh3b7HvGNfXrJ/xL6BDMS0v1V/HHg5U= sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3/go.mod h1:JWP1Fj0VWGHyw3YUPjXSQnRnrwezrZSrApfX5S0nIag= +sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ= +sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U= sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/logger/general_logging.go b/logger/general_logging.go new file mode 100644 index 0000000..e541390 --- /dev/null +++ b/logger/general_logging.go @@ -0,0 +1,245 @@ +package logger + +import ( + "context" + "fmt" + "io" + "math" + "reflect" + "strings" + "sync" + + box "github.com/Delta456/box-cli-maker/v2" + "github.com/fatih/color" + cloudController "github.com/ksctl/ksctl/pkg/types/controllers/cloud" + "github.com/rodaine/table" + + "time" + + "github.com/ksctl/ksctl/pkg/helpers/consts" +) + +type GeneralLog struct { + mu *sync.Mutex + writter io.Writer + level uint +} + +func (l *GeneralLog) ExternalLogHandler(ctx context.Context, msgType consts.CustomExternalLogLevel, message string) { + l.log(false, false, ctx, msgType, message) +} + +func (l *GeneralLog) ExternalLogHandlerf(ctx context.Context, msgType consts.CustomExternalLogLevel, format string, args ...interface{}) { + l.log(false, false, ctx, msgType, format, args...) +} + +func formGroups(disableContext bool, ctx context.Context, v ...any) (format string, vals []any) { + if len(v) == 0 { + return "\n", nil + } + _format := strings.Builder{} + + defer func() { + format = _format.String() + }() + if !disableContext { + _format.WriteString(color.HiBlackString("component=") + "%s ") + vals = append(vals, getPackageName(ctx)) + } + i := 0 + for ; i+1 < len(v); i += 2 { + if !reflect.TypeOf(v[i+1]).Implements(reflect.TypeOf((*error)(nil)).Elem()) && + (reflect.TypeOf(v[i+1]).Kind() == reflect.Interface || + reflect.TypeOf(v[i+1]).Kind() == reflect.Ptr || + reflect.TypeOf(v[i+1]).Kind() == reflect.Struct) { + _format.WriteString(fmt.Sprintf("%s", v[i]) + "=%#v ") + } else { + _format.WriteString(fmt.Sprintf("%s", v[i]) + "=%v ") + } + + vals = append(vals, v[i+1]) + } + + for ; i < len(v); i++ { + _format.WriteString("!!EXTRA:%v ") + vals = append(vals, v[i]) + } + _format.WriteString("\n") + return +} + +func isLogEnabled(level uint, msgType consts.CustomExternalLogLevel) bool { + if msgType == consts.LogDebug { + return level >= 9 + } + return true +} + +func (l *GeneralLog) logErrorf(disableContext bool, disablePrefix bool, ctx context.Context, msg string, args ...any) error { + l.mu.Lock() + defer l.mu.Unlock() + if !disablePrefix { + prefix := fmt.Sprintf("%s%s ", getTime(l.level), consts.LogError) + msg = prefix + msg + } + format, _args := formGroups(disableContext, ctx, args...) + + var errMsg error + if _args == nil { + errMsg = fmt.Errorf(msg + " " + format) + } else { + errMsg = fmt.Errorf(msg+" "+format, _args...) + } + + return errMsg +} + +func (l *GeneralLog) log(disableContext bool, useGroupFormer bool, ctx context.Context, msgType consts.CustomExternalLogLevel, msg string, args ...any) { + if !isLogEnabled(l.level, msgType) { + return + } + l.mu.Lock() + defer l.mu.Unlock() + prefix := fmt.Sprintf("%s%s ", getTime(l.level), msgType) + + if useGroupFormer { + msg = prefix + msg + format, _args := formGroups(disableContext, ctx, args...) + if _args == nil { + if disableContext && msgType == consts.LogError { + l.boxBox( + "Error", msg+" "+format, "Red") + return + } + fmt.Fprint(l.writter, msg+" "+format) + } else { + if disableContext && msgType == consts.LogError { + l.boxBox( + "Error", fmt.Sprintf(msg+" "+format, _args...), "Red") + return + } + fmt.Fprintf(l.writter, msg+" "+format, _args...) + } + } else { + args = append([]any{getPackageName(ctx)}, args...) + fmt.Fprintf(l.writter, prefix+color.HiBlackString("component=")+"%s "+msg+"\n", args...) + } +} + +func getTime(level uint) string { + t := time.Now() + return color.HiBlackString(fmt.Sprintf("%02d:%02d:%02d ", t.Hour(), t.Minute(), t.Second())) +} + +func NewLogger(verbose int, out io.Writer) *GeneralLog { + + var ve uint + + if verbose < 0 { + ve = 9 + } + + return &GeneralLog{ + writter: out, + level: ve, + mu: new(sync.Mutex), + } +} + +func (l *GeneralLog) Print(ctx context.Context, msg string, args ...any) { + l.log(false, true, ctx, consts.LogInfo, msg, args...) +} + +func (l *GeneralLog) Success(ctx context.Context, msg string, args ...any) { + l.log(false, true, ctx, consts.LogSuccess, msg, args...) +} + +func (l *GeneralLog) Note(ctx context.Context, msg string, args ...any) { + l.log(false, true, ctx, consts.LogNote, msg, args...) +} + +func (l *GeneralLog) Debug(ctx context.Context, msg string, args ...any) { + l.log(false, true, ctx, consts.LogDebug, msg, args...) +} + +func (l *GeneralLog) Error(ctx context.Context, msg string, args ...any) { + l.log(true, true, ctx, consts.LogError, msg, args...) +} + +func (l *GeneralLog) NewError(ctx context.Context, msg string, args ...any) error { + return l.logErrorf(false, true, ctx, msg, args...) +} + +func (l *GeneralLog) Warn(ctx context.Context, msg string, args ...any) { + l.log(false, true, ctx, consts.LogWarning, msg, args...) +} + +func (l *GeneralLog) Table(ctx context.Context, data []cloudController.AllClusterData) { + headerFmt := color.New(color.FgGreen, color.Underline).SprintfFunc() + columnFmt := color.New(color.FgYellow).SprintfFunc() + + tbl := table.New("ClusterName", "Region", "ClusterType", "CloudProvider", "BootStrap", "Mgt Nodes", "Self-Mgt Nodes") + tbl.WithHeaderFormatter(headerFmt).WithFirstColumnFormatter(columnFmt) + + extractVMSizes := func(v []cloudController.VMData) string { + sizes := []string{} + for _, _v := range v { + sizes = append(sizes, _v.VMSize) + } + return strings.Join(sizes, ",") + } + + for _, row := range data { + mgtN, selfMgtN := "null", "null" + if row.ClusterType == "ha" { + selfMgtN = fmt.Sprintf( + "cp: %d{%s}\nwp: %d{%s}\nds: %d{%s}\nlb: 1{%s}\n", + row.NoCP, + extractVMSizes(row.CP), + row.NoWP, + extractVMSizes(row.WP), + row.NoDS, + extractVMSizes(row.DS), + row.LB.VMSize, + ) + } else { + mgtN = fmt.Sprintf("wp: %d{%s}", row.NoMgt, row.Mgt.VMSize) + } + tbl.AddRow(row.Name, + row.Region, + string(row.ClusterType), + string(row.CloudProvider), + string(row.K8sDistro), + mgtN, + selfMgtN, + ) + } + + tbl.Print() +} + +func (l *GeneralLog) boxBox(title, lines string, color string) { + + px := 4 + + if len(title) >= 2*px+len(lines) { + // some maths + px = int(math.Ceil(float64(len(title)-len(lines))/2)) + 1 + } + + Box := box.New(box.Config{ + Px: px, + Py: 2, + Type: "Round", + TitlePos: "Top", + Color: color}) + + Box.Println(title, addLineTerminationForLongStrings(lines)) +} + +func (l *GeneralLog) Box(ctx context.Context, title string, lines string) { + + l.Debug(ctx, "PostUpdate Box", "title", len(title), "lines", len(lines)) + + l.boxBox(title, lines, "Yellow") +} diff --git a/logger/logger_test.go b/logger/logger_test.go new file mode 100644 index 0000000..856a364 --- /dev/null +++ b/logger/logger_test.go @@ -0,0 +1,89 @@ +package logger + +import ( + "context" + "fmt" + "os" + "strings" + "testing" + + "github.com/ksctl/ksctl/pkg/helpers/consts" + "github.com/ksctl/ksctl/pkg/types" + "github.com/ksctl/ksctl/pkg/types/controllers/cloud" +) + +var ( + gL types.LoggerFactory + dummyCtx = context.TODO() +) + +func TestMain(m *testing.M) { + gL = NewLogger(-1, os.Stdout) + _ = NewLogger(0, os.Stdout) + exitVal := m.Run() + + os.Exit(exitVal) +} + +func TestHelperToAddLineTerminationForLongStrings(t *testing.T) { + test := fmt.Sprintf("Argo Rollouts (Ver: %s) is a Kubernetes controller and set of CRDs which provide advanced deployment capabilities such as blue-green, canary, canary analysis, experimentation, and progressive delivery features to Kubernetes.", "v1.2.4") + + x := strings.Split(addLineTerminationForLongStrings(test), "\n") + for _, line := range x { + if len(line) > limitCol+1 { + t.Errorf("Line too long: %s, got: %d, expected: %d", line, len(line), limitCol) + } + } +} + +func TestPrinters(t *testing.T) { + + t.Run("Success", func(t *testing.T) { + gL.Success(dummyCtx, "FAKE", "type", "success") + }) + + t.Run("Warn", func(t *testing.T) { + gL.Warn(dummyCtx, "FAKE", "type", "warn") + }) + + t.Run("Error", func(t *testing.T) { + gL.Error(dummyCtx, "FAKE", "type", "error") + }) + + t.Run("Debug", func(t *testing.T) { + gL.Debug(dummyCtx, "FAKE", "type", "debugging") + }) + + t.Run("Note", func(t *testing.T) { + gL.Note(dummyCtx, "FAKE", "type", "note") + }) + + t.Run("Print", func(t *testing.T) { + gL.Print(dummyCtx, "FAKE", "type", "print") + }) + + t.Run("Table", func(t *testing.T) { + gL.Table(dummyCtx, + []cloud.AllClusterData{ + { + Name: "fake-demo", + CloudProvider: "fake", + Region: "fake-reg", + }, + }) + + gL.Table(dummyCtx, nil) + }) + + t.Run("Box", func(t *testing.T) { + gL.Box(dummyCtx, "Abcd", "1") + gL.Box(dummyCtx, "Abcddedefe", "1") + gL.Box(dummyCtx, "KUBECONFIG env var", "/jknc/csdc") + gL.Box(dummyCtx, "KUBECONFIG env var", "jknc") + }) + + t.Run("external", func(t *testing.T) { + gL.ExternalLogHandler(dummyCtx, consts.LogSuccess, "cdcc") + gL.ExternalLogHandlerf(dummyCtx, consts.LogSuccess, "cdcc", "Reason", fmt.Errorf("Error")) + }) +} diff --git a/logger/logging.go b/logger/logging.go new file mode 100644 index 0000000..ed20916 --- /dev/null +++ b/logger/logging.go @@ -0,0 +1,54 @@ +package logger + +import ( + "context" + "strings" + + "github.com/ksctl/ksctl/pkg/helpers/consts" + "github.com/ksctl/ksctl/pkg/helpers/utilities" +) + +func getPackageName(ctx context.Context) string { + if v, ok := ctx.Value(consts.KsctlModuleNameKey).(string); ok { + return v + } else { + return "!!NOT_SET" + } +} + +const ( + limitCol int = 80 +) + +func addLineTerminationForLongStrings(str string) string { + + //arr with endline split + arrStr := strings.Split(str, "\n") + + var helper func(string) string + + helper = func(_str string) string { + + if len(_str) < limitCol { + return _str + } + + x := string(utilities.DeepCopySlice[byte]([]byte(_str[:limitCol]))) + y := string(utilities.DeepCopySlice[byte]([]byte(helper(_str[limitCol:])))) + + // ks + // ^^ + if x[len(x)-1] != ' ' && y[0] != ' ' { + x += "-" + } + + _new := x + "\n" + y + return _new + } + + for idx, line := range arrStr { + arrStr[idx] = helper(line) + } + + return strings.Join(arrStr, "\n") +}