From 4ab41d42f28f899cc453b4d7db165e5ba1600230 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Sat, 19 Oct 2024 15:18:02 +0200 Subject: [PATCH] fix pre-commit and cleanup --- .github/actions/collect-changes/action.yaml | 1 - .../special/customClusterManagers.json5 | 2 +- .github/scripts/cr.sh | 6 +- .github/workflows/charts-release.yaml | 12 +- .github/workflows/clustertool.release.yaml | 1 - .github/workflows/containers.build.yaml | 4 +- .pre-commit-config.yaml | 9 +- charts/incubator/comet/values.yaml | 3 +- charts/incubator/riven/values.yaml | 8 +- charts/incubator/zilean/values.yaml | 3 +- charts/incubator/zurg/values.yaml | 52 +- clustertool/.gitignore | 2 +- clustertool/.vscode/extensions.json | 36 +- clustertool/.vscode/settings.json | 2 +- clustertool/.vscode/tasks.json | 2 +- clustertool/cmd/adv.go | 16 +- clustertool/cmd/adv_bootstrap.go | 14 +- clustertool/cmd/adv_fluxbootstrap.go | 20 +- clustertool/cmd/adv_health.go | 32 +- clustertool/cmd/adv_precommit.go | 26 +- clustertool/cmd/adv_reset.go | 52 +- clustertool/cmd/adv_scaleexport.go | 16 +- clustertool/cmd/adv_scalemigrate.go | 24 +- clustertool/cmd/adv_testcmd.go | 32 +- clustertool/cmd/apply.go | 112 +- clustertool/cmd/charts.go | 16 +- clustertool/cmd/charts_bump.go | 26 +- clustertool/cmd/charts_deps.go | 36 +- clustertool/cmd/charts_genchangelog.go | 56 +- clustertool/cmd/charts_genchartlist.go | 40 +- clustertool/cmd/charts_genmeta.go | 44 +- clustertool/cmd/charts_tagclean.go | 28 +- clustertool/cmd/checkcrypt.go | 26 +- clustertool/cmd/decrypt.go | 22 +- clustertool/cmd/encrypt.go | 22 +- clustertool/cmd/fluxbootstrap.go | 8 +- clustertool/cmd/genconfig.go | 52 +- clustertool/cmd/helmrelease.go | 16 +- clustertool/cmd/helmrelease_install.go | 46 +- clustertool/cmd/helmrelease_upgrade.go | 46 +- clustertool/cmd/info.go | 18 +- clustertool/cmd/init.go | 26 +- clustertool/cmd/root.go | 58 +- clustertool/cmd/upgrade.go | 66 +- clustertool/embed/embed.go | 158 +-- clustertool/embed/embedDarwin_amd64.go | 2 +- clustertool/embed/embedDarwin_arm64.go | 2 +- clustertool/embed/embedLinux_amd64.go | 2 +- clustertool/embed/embedLinux_arm64.go | 2 +- clustertool/embed/embedWindows_amd64.go | 2 +- clustertool/embed/embedWindows_arm64.go | 2 +- clustertool/embed/freebsd_amd64.go | 2 +- clustertool/embed/freebsd_arm64.go | 2 +- .../embed/generic/base/DOTREPLACEgitignore | 4 - .../app/schematic-to-pod.yaml | 2 +- .../kubernetes/core/kyverno-policies/ks.yaml | 2 +- .../core/metallb-config/app/helm-release.yaml | 2 +- .../app/kubernetes.yaml | 2 +- .../app/kustomization.yaml | 2 +- .../app/talos.yaml | 2 +- .../flux-system/flux/bootstrap.yaml.ct | 2 +- .../flux/clustersettings.secret.yaml | 2 +- .../kubernetes/flux-system/flux/flux.yaml | 2 +- .../flux-system/flux/namespace.yaml | 2 +- .../flux-system/flux/upgradesettings.yaml | 2 +- .../cilium/app/bootstrap-values.yaml.ct | 2 +- .../app/bootstrap-values.yaml.ct | 2 +- .../app/helm-release.yaml | 2 +- .../system/kyverno/app/helm-release.yaml | 2 +- .../system/longhorn/app/helm-release.yaml | 4 +- .../system/longhorn/app/namespace.yaml | 2 +- .../longhorn/app/volumeSnapshotClass.yaml | 2 +- .../system/metallb/app/helm-release.yaml | 2 +- .../system/openebs/app/helm-release.yaml | 2 +- .../app/helm-release.yaml | 2 +- .../system/topolvm/app/helm-release.yaml | 6 +- .../system/topolvm/app/namespace.yaml | 2 +- .../topolvm/app/volumeSnapshotClass.yaml | 2 +- .../system/volsync/app/namespace.yaml | 2 +- .../embed/generic/patches/controlplane.yaml | 2 +- .../embed/generic/patches/manifests.yaml | 2 +- .../embed/generic/patches/sopssecret.yaml | 1 - clustertool/embed/generic/patches/worker.yaml | 2 +- .../embed/generic/root/DOTREPLACEgitignore | 2 +- .../embed/generic/root/DOTREPLACEsops.yaml | 2 +- clustertool/embed/generic/root/README.md | 2 +- .../repositories/entries/kustomization.yaml | 2 +- .../generic/root/repositories/flux-entry.yaml | 2 +- .../root/repositories/git/kustomization.yaml | 2 +- .../root/repositories/git/this-repo.yaml | 2 +- .../root/repositories/git/truecharts.yaml | 2 +- .../root/repositories/kustomization.yaml | 2 +- .../root/repositories/oci/flux-manifests.yaml | 2 +- .../root/repositories/oci/kustomization.yaml | 2 +- clustertool/go.mod | 558 ++++----- clustertool/main.go | 128 +- clustertool/partial_builds/partial_build.sh | 4 +- clustertool/partial_builds/precommit/main.go | 14 +- .../pkg/charts/changelog/active_charts.go | 86 +- .../pkg/charts/changelog/changed_data.go | 272 ++--- clustertool/pkg/charts/changelog/changelog.go | 412 +++---- clustertool/pkg/charts/changelog/commit.go | 112 +- clustertool/pkg/charts/changelog/patch.go | 248 ++-- clustertool/pkg/charts/changelog/render.go | 120 +- clustertool/pkg/charts/changelog/utils.go | 216 ++-- .../pkg/charts/chartFile/chart_file.go | 262 ++-- .../pkg/charts/chartFile/chart_file_test.go | 1056 ++++++++--------- clustertool/pkg/charts/chartFile/updater.go | 314 ++--- .../pkg/charts/chartFile/updater_test.go | 406 +++---- clustertool/pkg/charts/deps/deps.go | 278 ++--- .../pkg/charts/helmignore/helmignore.go | 38 +- clustertool/pkg/charts/image/cleanup.go | 224 ++-- clustertool/pkg/charts/image/cleanup_test.go | 518 ++++---- clustertool/pkg/charts/image/image.go | 214 ++-- clustertool/pkg/charts/image/image_test.go | 322 ++--- clustertool/pkg/charts/info/info.go | 80 +- clustertool/pkg/charts/readme/readme.go | 46 +- .../pkg/charts/valuesYaml/addonValues.go | 62 +- .../valuesYaml/externalInterfaceValues.go | 22 +- .../pkg/charts/valuesYaml/ingressValues.go | 52 +- .../pkg/charts/valuesYaml/metricsValues.go | 14 +- .../charts/valuesYaml/networkPolicyValues.go | 62 +- clustertool/pkg/charts/valuesYaml/parse.go | 132 +-- .../charts/valuesYaml/persistenceValues.go | 82 +- .../pkg/charts/valuesYaml/podOptionsValues.go | 20 +- .../pkg/charts/valuesYaml/resourceValues.go | 28 +- .../valuesYaml/securityContextValues.go | 24 +- .../pkg/charts/valuesYaml/serviceValues.go | 30 +- clustertool/pkg/charts/valuesYaml/updater.go | 56 +- .../pkg/charts/valuesYaml/workloadValues.go | 40 +- clustertool/pkg/charts/version/bump.go | 66 +- clustertool/pkg/charts/version/bump_test.go | 138 +-- clustertool/pkg/charts/website/chart_list.go | 172 +-- clustertool/pkg/fluxhandler/bootstrap.go | 184 +-- clustertool/pkg/fluxhandler/helm.go | 860 +++++++------- clustertool/pkg/fluxhandler/helmrelease.go | 298 ++--- clustertool/pkg/fluxhandler/helmrepo.go | 94 +- clustertool/pkg/fluxhandler/kustomizations.go | 224 ++-- clustertool/pkg/fluxhandler/sshsecretgen.go | 330 +++--- clustertool/pkg/gencmd/apply.go | 68 +- clustertool/pkg/gencmd/bootstrap.go | 354 +++--- clustertool/pkg/gencmd/execcmd.go | 224 ++-- clustertool/pkg/gencmd/genconfig.go | 268 ++--- clustertool/pkg/gencmd/health.go | 10 +- clustertool/pkg/gencmd/kubeconfig.go | 10 +- clustertool/pkg/gencmd/reset.go | 64 +- clustertool/pkg/gencmd/upgrade.go | 72 +- clustertool/pkg/helper/copy.go | 170 +-- clustertool/pkg/helper/dns.go | 50 +- clustertool/pkg/helper/envsubst.go | 212 ++-- clustertool/pkg/helper/git.go | 464 ++++---- clustertool/pkg/helper/helper.go | 146 +-- clustertool/pkg/helper/marshaller.go | 12 +- clustertool/pkg/helper/netvalidate.go | 132 +-- clustertool/pkg/helper/prompts.go | 48 +- clustertool/pkg/helper/replace.go | 138 +-- clustertool/pkg/helper/runcmd.go | 74 +- clustertool/pkg/helper/talhelperextract.go | 86 +- clustertool/pkg/helper/time.go | 54 +- clustertool/pkg/helper/var2file.go | 28 +- clustertool/pkg/helper/vars.go | 52 +- clustertool/pkg/helper/walker.go | 54 +- clustertool/pkg/info/info.go | 80 +- clustertool/pkg/initfiles/clusterenv.go | 386 +++--- clustertool/pkg/initfiles/initfiles.go | 672 +++++------ clustertool/pkg/kubectlcmds/apply.go | 328 ++--- clustertool/pkg/kubectlcmds/approvecerts.go | 130 +- clustertool/pkg/kubectlcmds/checkstatus.go | 120 +- clustertool/pkg/nodestatus/health.go | 160 +-- clustertool/pkg/nodestatus/status.go | 114 +- clustertool/pkg/scale/exportapps.go | 94 +- clustertool/pkg/scale/scale2flux.go | 630 +++++----- clustertool/pkg/sops/checkencrypt.go | 378 +++--- clustertool/pkg/sops/decrypt.go | 162 +-- clustertool/pkg/sops/encrypt.go | 170 +-- clustertool/pkg/sops/loadsops.go | 44 +- clustertool/pkg/sops/wrapper.go | 206 ++-- .../pkg/talhelperutil/extractfromtalconfig.go | 64 +- containers/apps/charts-ci/Dockerfile | 26 +- website/.vscode/extensions.json | 2 +- website/.vscode/settings.json | 2 +- website/public/ads.txt | 2 +- website/public/fonts/IBM_Plex_Sans/OFL.txt | 2 +- website/public/svg/favicon.svg | 2 +- website/public/svg/logo.svg | 2 +- website/src/assets/charts.json | 2 +- .../src/content/docs/clustertool/csi/ceph.md | 3 - .../src/content/docs/clustertool/csi/index.md | 7 - .../content/docs/clustertool/csi/openebs.md | 2 - .../content/docs/clustertool/csi/topolvm.md | 6 +- .../docs/clustertool/functions/apply.md | 2 +- .../docs/clustertool/functions/encrypt.md | 2 +- .../docs/clustertool/functions/init.md | 2 +- .../docs/clustertool/functions/upgrade.md | 2 +- website/src/content/docs/clustertool/index.md | 2 +- .../virtual-machines/truenas-scale.mdx | 8 +- .../virtual-machines/virtualbox.md | 4 +- .../clustertool/virtual-machines/vsphere.md | 2 +- .../src/content/docs/guides/add-service.md | 2 +- .../content/docs/guides/external-service.md | 2 +- .../content/docs/news/2024-08-22-scale-faq.md | 2 +- .../src/content/docs/news/2024-10-16-news.md | 2 +- website/tsconfig.json | 2 +- 203 files changed, 8456 insertions(+), 8484 deletions(-) diff --git a/.github/actions/collect-changes/action.yaml b/.github/actions/collect-changes/action.yaml index 9fabd4a5848..2e8eb8d134c 100644 --- a/.github/actions/collect-changes/action.yaml +++ b/.github/actions/collect-changes/action.yaml @@ -44,4 +44,3 @@ runs: # Set output to changed charts echo "Changed charts: ${CHARTS[*]}" printf "::set-output name=addedOrModified::%s\n" "${CHARTS[*]}" - diff --git a/.github/renovate/special/customClusterManagers.json5 b/.github/renovate/special/customClusterManagers.json5 index eba87674a0f..08e025751fc 100644 --- a/.github/renovate/special/customClusterManagers.json5 +++ b/.github/renovate/special/customClusterManagers.json5 @@ -30,4 +30,4 @@ // "versioningTemplate": "redhat" // } ] -} \ No newline at end of file +} diff --git a/.github/scripts/cr.sh b/.github/scripts/cr.sh index de84fc467c8..5d1eaae463b 100755 --- a/.github/scripts/cr.sh +++ b/.github/scripts/cr.sh @@ -82,9 +82,9 @@ parse_command_line() { check_existing_tag() { local chart_name="$1" local tag="$2" - + echo "Checking if tag '$tag' exists for chart '$chart_name' on OCI..." - + # Query the OCI registry for existing tags local response response=$(curl -s -H "Authorization: Bearer ${quay_token}" \ @@ -97,7 +97,7 @@ check_existing_tag() { local tag_exists tag_exists=$(echo "$response" | jq -r --arg tag "$tag" '.tags[]? | select(.name == $tag) | .name') - + if [[ "$tag_exists" == "$tag" ]]; then echo "Tag '$tag' already exists for chart '$chart_name'." return 0 diff --git a/.github/workflows/charts-release.yaml b/.github/workflows/charts-release.yaml index f591b7a312b..f81da5e788e 100644 --- a/.github/workflows/charts-release.yaml +++ b/.github/workflows/charts-release.yaml @@ -30,7 +30,7 @@ jobs: pull-requests: write name: "${{ github.ref == 'refs/heads/master' && '(Production)' || '(Preview)' }}" runs-on: actions-runners - + steps: - name: Checkout uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 @@ -79,12 +79,12 @@ jobs: pre-commit run --all ||: # Fix sh files to always be executable find . -name '*.sh' | xargs chmod +x - + - name: Install Helm uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # tag=v3 with: version: v3.14.0 - + # Optional step if GPG signing is used - name: Prepare GPG key if: github.event_name == 'push' @@ -100,12 +100,12 @@ jobs: env: GPG_KEYRING_BASE64: "${{ secrets.GPG_KEYRING_BASE64 }}" GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}" - + - name: Helm | Login if: github.event_name == 'push' shell: bash run: echo ${{ secrets.QUAY_SECRET }} | helm registry login -u ${{ secrets.QUAY_USER }} --password-stdin quay.io - + - name: Release Charts shell: bash if: github.event_name == 'push' @@ -117,7 +117,7 @@ jobs: install="$RUNNER_TOOL_CACHE/cr/${{ inputs.version }}/$(uname -m)" echo "$install" >> "$GITHUB_PATH" ./.github/scripts/cr.sh --quay-token "${{ secrets.QUAY_TOKEN }}" --instal-dir $install - + - name: Helm | Logout shell: bash if: github.event_name == 'push' diff --git a/.github/workflows/clustertool.release.yaml b/.github/workflows/clustertool.release.yaml index b5e9926f68a..7405938e12a 100644 --- a/.github/workflows/clustertool.release.yaml +++ b/.github/workflows/clustertool.release.yaml @@ -24,4 +24,3 @@ jobs: version: "~> v2" # or 'latest', 'nightly', semver env: GITHUB_TOKEN: "${{ secrets.BOT_TOKEN }}" - diff --git a/.github/workflows/containers.build.yaml b/.github/workflows/containers.build.yaml index 96e67eaf170..ad9e32a3108 100644 --- a/.github/workflows/containers.build.yaml +++ b/.github/workflows/containers.build.yaml @@ -46,10 +46,10 @@ jobs: - id: reduce run: | CONTAINERS=$(jq --raw-output '.changed_files | fromjson | .[] |= sub("(?/?containers/(?(?[/]?)[^/]+/)(?(?[/]?)[^/]+)(?/[^/]+)*)"; "\(.second_directory)") | unique' changes.json) - + # Set the containers output echo ::set-output name=containers::${CONTAINERS} - + # Check if containers were found and set the containers_found output if [[ "$CONTAINERS" == "[]" || -z "$CONTAINERS" ]]; then echo "No Containers Found, Skipping" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fdf594f4b43..db1ca0fe780 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: remove-tabs - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: trailing-whitespace # trims trailing whitespace. exclude: ^archive/ @@ -48,10 +48,3 @@ repos: exclude: ^archive/ - id: rst-backticks exclude: ^archive/ - - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.1.0 - hooks: - - id: prettier - exclude: (^archive|^website\/public|templates\/.*|crds\/.*|README.md|CHANGELOG.md|questions.yaml|devcontainer.json|^clustertool) - files: \.(js|ts|jsx|tsx|css|less|html|json|markdown|md|yaml|yml)$ diff --git a/charts/incubator/comet/values.yaml b/charts/incubator/comet/values.yaml index 8cb6685bbe9..f0466773b01 100644 --- a/charts/incubator/comet/values.yaml +++ b/charts/incubator/comet/values.yaml @@ -43,7 +43,7 @@ persistence: enabled: true type: emptyDir mountPath: "/.cache" - + cnpg: main: enabled: true @@ -53,4 +53,3 @@ cnpg: portal: open: enabled: true - diff --git a/charts/incubator/riven/values.yaml b/charts/incubator/riven/values.yaml index 3d19266448e..12427e075ac 100644 --- a/charts/incubator/riven/values.yaml +++ b/charts/incubator/riven/values.yaml @@ -41,9 +41,9 @@ workload: RIVEN_FORCE_ENV: "true" ZURG_URL: somezurgurl:9999 # Set this to your rclone's mount `__all__` dir if using Zurg - RIVEN_SYMLINK_RCLONE_PATH: "/mnt/zurg/__all__" + RIVEN_SYMLINK_RCLONE_PATH: "/mnt/zurg/__all__" # This is the path that symlinks will be placed in - RIVEN_SYMLINK_LIBRARY_PATH: "/mnt/library" + RIVEN_SYMLINK_LIBRARY_PATH: "/mnt/library" RIVEN_DATABASE_HOST: '{{ printf "postgresql+psycopg2://%s:%s@%s.%s/%s" .Values.cnpg.main.user .Values.cnpg.main.creds.password (.Values.cnpg.main.creds.host | trimAll "\"") .Release.Namespace .Values.cnpg.main.database }}' RIVEN_DOWNLOADERS_REAL_DEBRID_ENABLED: "false" # set your real debrid api key @@ -51,7 +51,7 @@ workload: RIVEN_UPDATERS_PLEX_ENABLED: "false" RIVEN_UPDATERS_PLEX_URL: "http://plex:32400" # set your plex token" - RIVEN_UPDATERS_PLEX_TOKEN: "xxxxx" + RIVEN_UPDATERS_PLEX_TOKEN: "xxxxx" RIVEN_CONTENT_OVERSEERR_ENABLED: "false" RIVEN_CONTENT_OVERSEERR_URL: "http://overseerr:5055" # set your overseerr token @@ -94,7 +94,7 @@ persistence: data: enabled: true mountPath: "/riven/data" - zurg-all: + zurg-all: enabled: true mountPath: "/mnt/zurg/__all__" library: diff --git a/charts/incubator/zilean/values.yaml b/charts/incubator/zilean/values.yaml index 83a07f389ce..b9ca33e4cad 100644 --- a/charts/incubator/zilean/values.yaml +++ b/charts/incubator/zilean/values.yaml @@ -29,7 +29,7 @@ persistence: data: enabled: true mountPath: "/app/data" - + cnpg: main: enabled: true @@ -39,4 +39,3 @@ cnpg: portal: open: enabled: true - diff --git a/charts/incubator/zurg/values.yaml b/charts/incubator/zurg/values.yaml index 634fef54676..c23f3925785 100644 --- a/charts/incubator/zurg/values.yaml +++ b/charts/incubator/zurg/values.yaml @@ -24,9 +24,9 @@ workload: type: tcp env: # forces the use of env vars to be always used! - zurg_FORCE_ENV: "true" + zurg_FORCE_ENV: "true" # Set this to your rclone's mount `__all__` dir if using Zurg - LOG_LEVEL: DEBUG + LOG_LEVEL: DEBUG zurg: token: YOURTOKEN @@ -65,13 +65,13 @@ configmap: # Zurg configuration version zurg: v1 token: {{ .Values.zurg.token }} # https://real-debrid.com/apitoken - + # basic functionality host: "[::]" # do not change this if you are running it inside a docker container port: 9999 # do not change this if you are running it inside a docker container concurrent_workers: 32 check_for_changes_every_secs: 10 - + # misc configs retain_folder_name_extension: false # if true, zurg won't modify the filenames from real-debrid retain_rd_torrent_name: true # if true, it will strictly follow RD API torrent name property w/c should make this more compatible with rdt-client @@ -81,7 +81,7 @@ configmap: enable_repair: false # Don't change this, we run a separate zurg for doing repairs without blocking i/o on_library_update: sh plex_update.sh "$@" ignore_renames: true - + # advanced alternative for Jellyfin/Emby support # on_library_update: |- # # Log the updated directories and send refresh request to autoscan @@ -90,10 +90,10 @@ configmap: # echo "Detected update on: $arg" # # URL encode the directory path # encoded_arg=$(python -c "import urllib.parse; print(urllib.parse.quote_plus('$arg'))") - # curl -s -X GET "http://autoscan:3030/triggers/manual?dir=/storage/realdebrid-zurg/$encoded_arg" + # curl -s -X GET "http://autoscan:3030/triggers/manual?dir=/storage/realdebrid-zurg/$encoded_arg" # done # echo "All updated sections refreshed." - + # network configs network_buffer_size: 1048576 # 1 MiB serve_from_rclone: false # serve file data from rclone, not from zurg (zurg will only provide rclone the link to download) @@ -112,7 +112,7 @@ configmap: # - 32.download.real-debrid.com # - 34.download.real-debrid.com # - 40.download.real-debrid.com - + # List of directory definitions and their filtering rules directories: # Configuration for anime shows @@ -124,13 +124,13 @@ configmap: - has_episodes: true # intelligent detection of episode files inside a torrent - any_file_inside_regex: /^\[/ # usually anime starts with [ e.g. [SubsPlease] - any_file_inside_not_regex: /s\d\de\d\d/i # and usually anime doesn't use SxxExx - + shows: group: media group_order: 20 filters: - has_episodes: true # intelligent detection of episode files inside a torrent - + movies: group: media # because anime, shows and movies are in the same group, group_order: 30 # and anime and shows has a lower group_order number than movies, all torrents that doesn't fall into the previous 2 will fall into movies @@ -143,56 +143,56 @@ configmap: data: plex_update.sh: | #!/bin/bash - + # PLEX PARTIAL SCAN script or PLEX UPDATE script # When zurg detects changes, it can trigger this script IF your config.yml contains # on_library_update: sh plex_update.sh "$@" # Modified from https://github.com/debridmediamanager/zurg-testing/blob/main/plex_update.sh - + plex_url="http://plex:32400" # If you're using zurg inside a Docker container, by default it is 172.17.0.1:32400 token="yourplextoken" # open Plex in a browser, open dev console and copy-paste this: window.localStorage.getItem("myPlexAccessToken") zurg_mount="/storage/realdebrid-zurg" # replace with your zurg mount path, ensure this is what Plex sees - + # Get the list of section IDs section_ids=$(curl -sLX GET "$plex_url/library/sections" -H "X-Plex-Token: $token" | xmllint --xpath "//Directory/@key" - | sed 's/key="//g' | tr '"' '\n') - + for arg in "$@" do modified_arg="$zurg_mount/$arg" echo "Detected update on: $arg" echo "Absolute path: $modified_arg" - + ##### START Added by ElfHosted for auto DMM symlinking ### echo "Symlinking $modified_arg to /storage/symlinks/real-debrid-blackhole/$arg" - + # Ensure blackhole exists mkdir -p /storage/symlinks/real-debrid-blackhole/movies mkdir -p /storage/symlinks/real-debrid-blackhole/shows - + # Copy to the RD blackhole, preserving the directory structure cp -rs "$modified_arg/"* "/storage/symlinks/real-debrid-blackhole/$(echo $arg | cut -f1 -d/)/" ##### END Added by ElfHosted for auto DMM symlinking ### - + encoded_arg=$(echo -n "$modified_arg" | python3 -c "import sys, urllib.parse as ul; print (ul.quote_plus(sys.stdin.read()))") - + if [ -z "$encoded_arg" ]; then echo "Error: Encoded argument is empty. Check the input or encoding process." continue fi - + for section_id in $section_ids do final_url="${plex_url}/library/sections/${section_id}/refresh?path=${encoded_arg}&X-Plex-Token=${token}" - + echo "Encoded argument: $encoded_arg" echo "Section ID: $section_id" echo "Final URL: $final_url" - + curl -s "$final_url" done - + done - + echo "All updated sections refreshed" - - # credits to godver3 + + # credits to godver3 diff --git a/clustertool/.gitignore b/clustertool/.gitignore index 89283c5b8bf..8188d3813e7 100644 --- a/clustertool/.gitignore +++ b/clustertool/.gitignore @@ -20,4 +20,4 @@ ssh-public-key.txt *.DS_Store !/embed/** .DS_Store -.github \ No newline at end of file +.github diff --git a/clustertool/.vscode/extensions.json b/clustertool/.vscode/extensions.json index bfa36657234..849837cafb7 100644 --- a/clustertool/.vscode/extensions.json +++ b/clustertool/.vscode/extensions.json @@ -2,22 +2,22 @@ "recommendations": [ "golang.go", "redhat.vscode-yaml", - "formulahendry.code-runner", - "streetsidesoftware.code-spell-checker", - "Codium.codium", - "mrmlnc.vscode-duplicate", - "IgorSbitnev.error-gutters", - "usernamehw.errorlens", - "mhutchie.git-graph", - "eamodio.gitlens", - "vivaldy22.go-auto-struct-tag", - "msyrus.go-doc", - "766b.go-outliner", - "premparihar.gotestexplorer", - "yzhang.markdown-all-in-one", - "searKing.preview-vscode", - "zxh404.vscode-proto3", - "DavidAnson.vscode-markdownlint", - "GitHub.copilot" + "formulahendry.code-runner", + "streetsidesoftware.code-spell-checker", + "Codium.codium", + "mrmlnc.vscode-duplicate", + "IgorSbitnev.error-gutters", + "usernamehw.errorlens", + "mhutchie.git-graph", + "eamodio.gitlens", + "vivaldy22.go-auto-struct-tag", + "msyrus.go-doc", + "766b.go-outliner", + "premparihar.gotestexplorer", + "yzhang.markdown-all-in-one", + "searKing.preview-vscode", + "zxh404.vscode-proto3", + "DavidAnson.vscode-markdownlint", + "GitHub.copilot" ] -} \ No newline at end of file +} diff --git a/clustertool/.vscode/settings.json b/clustertool/.vscode/settings.json index 0e0dcd235c4..0db3279e44b 100644 --- a/clustertool/.vscode/settings.json +++ b/clustertool/.vscode/settings.json @@ -1,3 +1,3 @@ { -} \ No newline at end of file +} diff --git a/clustertool/.vscode/tasks.json b/clustertool/.vscode/tasks.json index eaf4171780a..654d6a063b4 100644 --- a/clustertool/.vscode/tasks.json +++ b/clustertool/.vscode/tasks.json @@ -19,4 +19,4 @@ "problemMatcher" : [] }, ] -} \ No newline at end of file +} diff --git a/clustertool/cmd/adv.go b/clustertool/cmd/adv.go index dddb2c66670..673f6c635c5 100644 --- a/clustertool/cmd/adv.go +++ b/clustertool/cmd/adv.go @@ -1,9 +1,9 @@ package cmd import ( - "strings" + "strings" - "github.com/spf13/cobra" + "github.com/spf13/cobra" ) var advLongHelp = strings.TrimSpace(` @@ -12,13 +12,13 @@ These are all advanced commands that should generally not be needed `) var adv = &cobra.Command{ - Use: "adv", - Short: "Advanced cluster maintanence commands", - Long: advLongHelp, - SilenceUsage: true, - SilenceErrors: true, + Use: "adv", + Short: "Advanced cluster maintanence commands", + Long: advLongHelp, + SilenceUsage: true, + SilenceErrors: true, } func init() { - RootCmd.AddCommand(adv) + RootCmd.AddCommand(adv) } diff --git a/clustertool/cmd/adv_bootstrap.go b/clustertool/cmd/adv_bootstrap.go index 332acefe0ee..b12df3a070b 100644 --- a/clustertool/cmd/adv_bootstrap.go +++ b/clustertool/cmd/adv_bootstrap.go @@ -1,20 +1,20 @@ package cmd import ( - "github.com/spf13/cobra" - "github.com/truecharts/public/clustertool/pkg/gencmd" + "github.com/spf13/cobra" + "github.com/truecharts/public/clustertool/pkg/gencmd" ) var bootstrap = &cobra.Command{ - Use: "bootstrap", - Short: "bootstrap first Talos Node", - Run: bootstrapfunc, + Use: "bootstrap", + Short: "bootstrap first Talos Node", + Run: bootstrapfunc, } func bootstrapfunc(cmd *cobra.Command, args []string) { - gencmd.RunBootstrap(args) + gencmd.RunBootstrap(args) } func init() { - adv.AddCommand(bootstrap) + adv.AddCommand(bootstrap) } diff --git a/clustertool/cmd/adv_fluxbootstrap.go b/clustertool/cmd/adv_fluxbootstrap.go index 8381941b643..aa58568661b 100644 --- a/clustertool/cmd/adv_fluxbootstrap.go +++ b/clustertool/cmd/adv_fluxbootstrap.go @@ -1,21 +1,21 @@ package cmd import ( - "context" + "context" - "github.com/spf13/cobra" - "github.com/truecharts/public/clustertool/pkg/fluxhandler" + "github.com/spf13/cobra" + "github.com/truecharts/public/clustertool/pkg/fluxhandler" ) var fluxbootstrap = &cobra.Command{ - Use: "fluxbootstrap", - Short: "Manually bootstrap fluxcd on existing cluster", - Run: func(cmd *cobra.Command, args []string) { - ctx := context.Background() - fluxhandler.FluxBootstrap(ctx) - }, + Use: "fluxbootstrap", + Short: "Manually bootstrap fluxcd on existing cluster", + Run: func(cmd *cobra.Command, args []string) { + ctx := context.Background() + fluxhandler.FluxBootstrap(ctx) + }, } func init() { - adv.AddCommand(fluxbootstrap) + adv.AddCommand(fluxbootstrap) } diff --git a/clustertool/cmd/adv_health.go b/clustertool/cmd/adv_health.go index 7b68e952fe6..0a5adca5e37 100644 --- a/clustertool/cmd/adv_health.go +++ b/clustertool/cmd/adv_health.go @@ -1,26 +1,26 @@ package cmd import ( - "github.com/rs/zerolog/log" - "github.com/spf13/cobra" - "github.com/truecharts/public/clustertool/pkg/gencmd" - "github.com/truecharts/public/clustertool/pkg/helper" - "github.com/truecharts/public/clustertool/pkg/sops" + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" + "github.com/truecharts/public/clustertool/pkg/gencmd" + "github.com/truecharts/public/clustertool/pkg/helper" + "github.com/truecharts/public/clustertool/pkg/sops" ) var health = &cobra.Command{ - Use: "health", - Short: "Check Talos Cluster Health", - Run: func(cmd *cobra.Command, args []string) { - if err := sops.DecryptFiles(); err != nil { - log.Info().Msgf("Error decrypting files: %v\n", err) - } - log.Info().Msg("Running Cluster HealthCheck") - healthcmd := gencmd.GenHealth(helper.TalEnv["VIP_IP"]) - gencmd.ExecCmd(healthcmd) - }, + Use: "health", + Short: "Check Talos Cluster Health", + Run: func(cmd *cobra.Command, args []string) { + if err := sops.DecryptFiles(); err != nil { + log.Info().Msgf("Error decrypting files: %v\n", err) + } + log.Info().Msg("Running Cluster HealthCheck") + healthcmd := gencmd.GenHealth(helper.TalEnv["VIP_IP"]) + gencmd.ExecCmd(healthcmd) + }, } func init() { - adv.AddCommand(health) + adv.AddCommand(health) } diff --git a/clustertool/cmd/adv_precommit.go b/clustertool/cmd/adv_precommit.go index 3c939a054d1..dd10efc6948 100644 --- a/clustertool/cmd/adv_precommit.go +++ b/clustertool/cmd/adv_precommit.go @@ -1,24 +1,24 @@ package cmd import ( - "os" + "os" - "github.com/rs/zerolog/log" - "github.com/spf13/cobra" - "github.com/truecharts/public/clustertool/pkg/sops" + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" + "github.com/truecharts/public/clustertool/pkg/sops" ) var precommit = &cobra.Command{ - Use: "precommit", - Short: "Runs the PreCommit encryption check", - Run: func(cmd *cobra.Command, args []string) { - if err := sops.CheckFilesAndReportEncryption(true, true); err != nil { - log.Info().Msgf("Error checking files: %v\n", err) - os.Exit(1) - } - }, + Use: "precommit", + Short: "Runs the PreCommit encryption check", + Run: func(cmd *cobra.Command, args []string) { + if err := sops.CheckFilesAndReportEncryption(true, true); err != nil { + log.Info().Msgf("Error checking files: %v\n", err) + os.Exit(1) + } + }, } func init() { - adv.AddCommand(precommit) + adv.AddCommand(precommit) } diff --git a/clustertool/cmd/adv_reset.go b/clustertool/cmd/adv_reset.go index bf101e0e19f..adf7db576c7 100644 --- a/clustertool/cmd/adv_reset.go +++ b/clustertool/cmd/adv_reset.go @@ -1,41 +1,41 @@ package cmd import ( - "github.com/rs/zerolog/log" - "github.com/spf13/cobra" - "github.com/truecharts/public/clustertool/pkg/gencmd" - "github.com/truecharts/public/clustertool/pkg/sops" + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" + "github.com/truecharts/public/clustertool/pkg/gencmd" + "github.com/truecharts/public/clustertool/pkg/sops" ) var reset = &cobra.Command{ - Use: "reset", - Short: "Reset Talos Nodes and Kubernetes", - Run: func(cmd *cobra.Command, args []string) { - var extraArgs []string - node := "" + Use: "reset", + Short: "Reset Talos Nodes and Kubernetes", + Run: func(cmd *cobra.Command, args []string) { + var extraArgs []string + node := "" - if len(args) > 1 { - extraArgs = args[1:] - } - if len(args) >= 1 { - node = args[0] - if args[0] == "all" { - node = "" - } - } + if len(args) > 1 { + extraArgs = args[1:] + } + if len(args) >= 1 { + node = args[0] + if args[0] == "all" { + node = "" + } + } - if err := sops.DecryptFiles(); err != nil { - log.Info().Msgf("Error decrypting files: %v\n", err) - } + if err := sops.DecryptFiles(); err != nil { + log.Info().Msgf("Error decrypting files: %v\n", err) + } - log.Info().Msg("Running Cluster node Reset") + log.Info().Msg("Running Cluster node Reset") - taloscmds := gencmd.GenReset(node, extraArgs) - gencmd.ExecCmds(taloscmds, true) + taloscmds := gencmd.GenReset(node, extraArgs) + gencmd.ExecCmds(taloscmds, true) - }, + }, } func init() { - adv.AddCommand(reset) + adv.AddCommand(reset) } diff --git a/clustertool/cmd/adv_scaleexport.go b/clustertool/cmd/adv_scaleexport.go index de5f57a6def..bef10cb93bd 100644 --- a/clustertool/cmd/adv_scaleexport.go +++ b/clustertool/cmd/adv_scaleexport.go @@ -1,18 +1,18 @@ package cmd import ( - "github.com/spf13/cobra" - "github.com/truecharts/public/clustertool/pkg/scale" + "github.com/spf13/cobra" + "github.com/truecharts/public/clustertool/pkg/scale" ) var scaleexport = &cobra.Command{ - Use: "scaleexport", - Short: "Export SCALE Apps to file", - Run: func(cmd *cobra.Command, args []string) { - scale.ExportApps() - }, + Use: "scaleexport", + Short: "Export SCALE Apps to file", + Run: func(cmd *cobra.Command, args []string) { + scale.ExportApps() + }, } func init() { - adv.AddCommand(scaleexport) + adv.AddCommand(scaleexport) } diff --git a/clustertool/cmd/adv_scalemigrate.go b/clustertool/cmd/adv_scalemigrate.go index 2e697033a97..fcca95f0904 100644 --- a/clustertool/cmd/adv_scalemigrate.go +++ b/clustertool/cmd/adv_scalemigrate.go @@ -1,22 +1,22 @@ package cmd import ( - "github.com/rs/zerolog/log" - "github.com/spf13/cobra" - "github.com/truecharts/public/clustertool/pkg/scale" + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" + "github.com/truecharts/public/clustertool/pkg/scale" ) var scalemigrate = &cobra.Command{ - Use: "scalemigrate", - Short: "Migrate exported SCALE Apps to the Talos Cluster", - Run: func(cmd *cobra.Command, args []string) { - err := scale.ProcessJSONFiles("./truenas_exports") - if err != nil { - log.Info().Msgf("Error: %v", err) - } - }, + Use: "scalemigrate", + Short: "Migrate exported SCALE Apps to the Talos Cluster", + Run: func(cmd *cobra.Command, args []string) { + err := scale.ProcessJSONFiles("./truenas_exports") + if err != nil { + log.Info().Msgf("Error: %v", err) + } + }, } func init() { - adv.AddCommand(scalemigrate) + adv.AddCommand(scalemigrate) } diff --git a/clustertool/cmd/adv_testcmd.go b/clustertool/cmd/adv_testcmd.go index f53af95c6cc..7c99e18b96f 100644 --- a/clustertool/cmd/adv_testcmd.go +++ b/clustertool/cmd/adv_testcmd.go @@ -1,26 +1,26 @@ package cmd import ( - "github.com/rs/zerolog/log" - "github.com/spf13/cobra" - "github.com/truecharts/public/clustertool/pkg/gencmd" - "github.com/truecharts/public/clustertool/pkg/initfiles" + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" + "github.com/truecharts/public/clustertool/pkg/gencmd" + "github.com/truecharts/public/clustertool/pkg/initfiles" ) var testcmd = &cobra.Command{ - Use: "test", - Short: "test run", - Run: func(cmd *cobra.Command, args []string) { - initfiles.LoadTalEnv() - // err := fluxhandler.ProcessJSONFiles("./testdata/truenas_exports") - // if err != nil { - // log.Info().Msg("Error:", err) - // } - something := gencmd.GenBootstrap("", []string{}) - log.Info().Msgf("test %v", something) - }, + Use: "test", + Short: "test run", + Run: func(cmd *cobra.Command, args []string) { + initfiles.LoadTalEnv() + // err := fluxhandler.ProcessJSONFiles("./testdata/truenas_exports") + // if err != nil { + // log.Info().Msg("Error:", err) + // } + something := gencmd.GenBootstrap("", []string{}) + log.Info().Msgf("test %v", something) + }, } func init() { - adv.AddCommand(testcmd) + adv.AddCommand(testcmd) } diff --git a/clustertool/cmd/apply.go b/clustertool/cmd/apply.go index 5729b903ebc..a2a5cdfb4e2 100644 --- a/clustertool/cmd/apply.go +++ b/clustertool/cmd/apply.go @@ -1,78 +1,78 @@ package cmd import ( - "github.com/rs/zerolog/log" - "github.com/spf13/cobra" - "github.com/truecharts/public/clustertool/pkg/gencmd" - "github.com/truecharts/public/clustertool/pkg/helper" - "github.com/truecharts/public/clustertool/pkg/nodestatus" - "github.com/truecharts/public/clustertool/pkg/sops" + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" + "github.com/truecharts/public/clustertool/pkg/gencmd" + "github.com/truecharts/public/clustertool/pkg/helper" + "github.com/truecharts/public/clustertool/pkg/nodestatus" + "github.com/truecharts/public/clustertool/pkg/sops" ) var apply = &cobra.Command{ - Use: "apply", - Short: "apply TalosConfig", - Run: func(cmd *cobra.Command, args []string) { - var extraArgs []string - node := "" + Use: "apply", + Short: "apply TalosConfig", + Run: func(cmd *cobra.Command, args []string) { + var extraArgs []string + node := "" - if len(args) > 1 { - extraArgs = args[1:] - } - if len(args) >= 1 { - node = args[0] - if args[0] == "all" { - node = "" - } - } + if len(args) > 1 { + extraArgs = args[1:] + } + if len(args) >= 1 { + node = args[0] + if args[0] == "all" { + node = "" + } + } - if err := sops.DecryptFiles(); err != nil { - log.Info().Msgf("Error decrypting files: %v\n", err) - } + if err := sops.DecryptFiles(); err != nil { + log.Info().Msgf("Error decrypting files: %v\n", err) + } - bootstrapcmds := gencmd.GenBootstrap("", extraArgs) - bootstrapNode := helper.ExtractNode(bootstrapcmds) + bootstrapcmds := gencmd.GenBootstrap("", extraArgs) + bootstrapNode := helper.ExtractNode(bootstrapcmds) - log.Info().Msgf("Checking if first node is ready to recieve anything... %s", bootstrapNode) - status, err := nodestatus.WaitForHealth(bootstrapNode, []string{"running", "maintenance"}) - if err != nil { + log.Info().Msgf("Checking if first node is ready to recieve anything... %s", bootstrapNode) + status, err := nodestatus.WaitForHealth(bootstrapNode, []string{"running", "maintenance"}) + if err != nil { - } else if status == "maintenance" { - bootstrapNeeded, err := nodestatus.CheckNeedBootstrap(bootstrapNode) - if err != nil { + } else if status == "maintenance" { + bootstrapNeeded, err := nodestatus.CheckNeedBootstrap(bootstrapNode) + if err != nil { - } else if bootstrapNeeded { - log.Info().Msg("First Node requires to be bootstrapped before it can be used.") - if helper.GetYesOrNo("Do you want to bootstrap now? (yes/no) [y/n]: ") { - gencmd.RunBootstrap(extraArgs) - if helper.GetYesOrNo("Do you want to apply config to all remaining clusternodes as well? (yes/no) [y/n]: ") { - RunApply("", extraArgs) - } - } else { - log.Info().Msg("Exiting bootstrap, as apply is not possible...") - } + } else if bootstrapNeeded { + log.Info().Msg("First Node requires to be bootstrapped before it can be used.") + if helper.GetYesOrNo("Do you want to bootstrap now? (yes/no) [y/n]: ") { + gencmd.RunBootstrap(extraArgs) + if helper.GetYesOrNo("Do you want to apply config to all remaining clusternodes as well? (yes/no) [y/n]: ") { + RunApply("", extraArgs) + } + } else { + log.Info().Msg("Exiting bootstrap, as apply is not possible...") + } - } else { - log.Info().Msg("Detected maintenance mode, but first node does not require to be bootrapped.") - log.Info().Msg("Assuming apply is requested... continuing with Apply...") - RunApply(node, extraArgs) - } + } else { + log.Info().Msg("Detected maintenance mode, but first node does not require to be bootrapped.") + log.Info().Msg("Assuming apply is requested... continuing with Apply...") + RunApply(node, extraArgs) + } - } else if status == "running" { - log.Info().Msg("Apply: running first controlnode detected, continuing...") - RunApply(node, extraArgs) - } - }, + } else if status == "running" { + log.Info().Msg("Apply: running first controlnode detected, continuing...") + RunApply(node, extraArgs) + } + }, } func RunApply(node string, extraArgs []string) { - taloscmds := gencmd.GenApply(node, extraArgs) - gencmd.ExecCmds(taloscmds, true) + taloscmds := gencmd.GenApply(node, extraArgs) + gencmd.ExecCmds(taloscmds, true) - kubeconfigcmds := gencmd.GenKubeConfig(helper.TalEnv["VIP_IP"]) - gencmd.ExecCmd(kubeconfigcmds) + kubeconfigcmds := gencmd.GenKubeConfig(helper.TalEnv["VIP_IP"]) + gencmd.ExecCmd(kubeconfigcmds) } func init() { - RootCmd.AddCommand(apply) + RootCmd.AddCommand(apply) } diff --git a/clustertool/cmd/charts.go b/clustertool/cmd/charts.go index db653d2c2e6..4175c6e1075 100644 --- a/clustertool/cmd/charts.go +++ b/clustertool/cmd/charts.go @@ -1,9 +1,9 @@ package cmd import ( - "strings" + "strings" - "github.com/spf13/cobra" + "github.com/spf13/cobra" ) var chartsLongHelp = strings.TrimSpace(` @@ -19,13 +19,13 @@ Workflow: `) var charts = &cobra.Command{ - Use: "charts", - Short: "A tool to help with creating Talos cluster", - Long: chartsLongHelp, - SilenceUsage: true, - SilenceErrors: true, + Use: "charts", + Short: "A tool to help with creating Talos cluster", + Long: chartsLongHelp, + SilenceUsage: true, + SilenceErrors: true, } func init() { - RootCmd.AddCommand(charts) + RootCmd.AddCommand(charts) } diff --git a/clustertool/cmd/charts_bump.go b/clustertool/cmd/charts_bump.go index 409342325c7..257caea14d9 100644 --- a/clustertool/cmd/charts_bump.go +++ b/clustertool/cmd/charts_bump.go @@ -1,23 +1,23 @@ package cmd import ( - "github.com/rs/zerolog/log" - "github.com/spf13/cobra" - "github.com/truecharts/public/clustertool/pkg/charts/version" + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" + "github.com/truecharts/public/clustertool/pkg/charts/version" ) var bumper = &cobra.Command{ - Use: "bump", - Short: "generate a bumped image version", - Example: "charttool bump ", - Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { - if err := version.Bump(args[0], args[1]); err != nil { - log.Fatal().Err(err).Msg("failed to bump version") - } - }, + Use: "bump", + Short: "generate a bumped image version", + Example: "charttool bump ", + Args: cobra.ExactArgs(2), + Run: func(cmd *cobra.Command, args []string) { + if err := version.Bump(args[0], args[1]); err != nil { + log.Fatal().Err(err).Msg("failed to bump version") + } + }, } func init() { - charts.AddCommand(bumper) + charts.AddCommand(bumper) } diff --git a/clustertool/cmd/charts_deps.go b/clustertool/cmd/charts_deps.go index cbb77ec322f..ea1be352540 100644 --- a/clustertool/cmd/charts_deps.go +++ b/clustertool/cmd/charts_deps.go @@ -1,29 +1,29 @@ package cmd import ( - "github.com/rs/zerolog/log" - "github.com/spf13/cobra" - "github.com/truecharts/public/clustertool/pkg/charts/deps" - "github.com/truecharts/public/clustertool/pkg/helper" + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" + "github.com/truecharts/public/clustertool/pkg/charts/deps" + "github.com/truecharts/public/clustertool/pkg/helper" ) var depsCmd = &cobra.Command{ - Use: "deps", - Short: "Download, Update and Verify Helm dependencies", - Example: "charttool deps ", - Run: func(cmd *cobra.Command, args []string) { - if err := deps.LoadGPGKey(); err != nil { - log.Fatal().Err(err).Msg("failed to load gpg key") - } + Use: "deps", + Short: "Download, Update and Verify Helm dependencies", + Example: "charttool deps ", + Run: func(cmd *cobra.Command, args []string) { + if err := deps.LoadGPGKey(); err != nil { + log.Fatal().Err(err).Msg("failed to load gpg key") + } - // Specify the mode (SyncMode or AsyncMode) - mode := helper.SyncMode // Change to helper.SyncMode for synchronous processing - if err := helper.WalkCharts(args, deps.DownloadDeps, "", mode); err != nil { - log.Fatal().Err(err).Msg("failed to update Chart.yaml") - } - }, + // Specify the mode (SyncMode or AsyncMode) + mode := helper.SyncMode // Change to helper.SyncMode for synchronous processing + if err := helper.WalkCharts(args, deps.DownloadDeps, "", mode); err != nil { + log.Fatal().Err(err).Msg("failed to update Chart.yaml") + } + }, } func init() { - charts.AddCommand(depsCmd) + charts.AddCommand(depsCmd) } diff --git a/clustertool/cmd/charts_genchangelog.go b/clustertool/cmd/charts_genchangelog.go index 2da62130722..84a1b57e89f 100644 --- a/clustertool/cmd/charts_genchangelog.go +++ b/clustertool/cmd/charts_genchangelog.go @@ -1,39 +1,39 @@ package cmd import ( - "github.com/rs/zerolog/log" + "github.com/rs/zerolog/log" - "github.com/spf13/cobra" - "github.com/truecharts/public/clustertool/pkg/charts/changelog" + "github.com/spf13/cobra" + "github.com/truecharts/public/clustertool/pkg/charts/changelog" ) var genChangelogCmd = &cobra.Command{ - Use: "genchangelog", - Short: "Generate changelog for charts", - Example: "charttool genchangelog