fix pre-commit and cleanup

This commit is contained in:
Kjeld Schouten
2024-10-19 15:18:05 +02:00
parent 2acb59c9dc
commit 4ab41d42f2
203 changed files with 8456 additions and 8484 deletions
@@ -44,4 +44,3 @@ runs:
# Set output to changed charts # Set output to changed charts
echo "Changed charts: ${CHARTS[*]}" echo "Changed charts: ${CHARTS[*]}"
printf "::set-output name=addedOrModified::%s\n" "${CHARTS[*]}" printf "::set-output name=addedOrModified::%s\n" "${CHARTS[*]}"
@@ -30,4 +30,4 @@
// "versioningTemplate": "redhat" // "versioningTemplate": "redhat"
// } // }
] ]
} }
+3 -3
View File
@@ -82,9 +82,9 @@ parse_command_line() {
check_existing_tag() { check_existing_tag() {
local chart_name="$1" local chart_name="$1"
local tag="$2" local tag="$2"
echo "Checking if tag '$tag' exists for chart '$chart_name' on OCI..." echo "Checking if tag '$tag' exists for chart '$chart_name' on OCI..."
# Query the OCI registry for existing tags # Query the OCI registry for existing tags
local response local response
response=$(curl -s -H "Authorization: Bearer ${quay_token}" \ response=$(curl -s -H "Authorization: Bearer ${quay_token}" \
@@ -97,7 +97,7 @@ check_existing_tag() {
local tag_exists local tag_exists
tag_exists=$(echo "$response" | jq -r --arg tag "$tag" '.tags[]? | select(.name == $tag) | .name') tag_exists=$(echo "$response" | jq -r --arg tag "$tag" '.tags[]? | select(.name == $tag) | .name')
if [[ "$tag_exists" == "$tag" ]]; then if [[ "$tag_exists" == "$tag" ]]; then
echo "Tag '$tag' already exists for chart '$chart_name'." echo "Tag '$tag' already exists for chart '$chart_name'."
return 0 return 0
+6 -6
View File
@@ -30,7 +30,7 @@ jobs:
pull-requests: write pull-requests: write
name: "${{ github.ref == 'refs/heads/master' && '(Production)' || '(Preview)' }}" name: "${{ github.ref == 'refs/heads/master' && '(Production)' || '(Preview)' }}"
runs-on: actions-runners runs-on: actions-runners
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
@@ -79,12 +79,12 @@ jobs:
pre-commit run --all ||: pre-commit run --all ||:
# Fix sh files to always be executable # Fix sh files to always be executable
find . -name '*.sh' | xargs chmod +x find . -name '*.sh' | xargs chmod +x
- name: Install Helm - name: Install Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # tag=v3 uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # tag=v3
with: with:
version: v3.14.0 version: v3.14.0
# Optional step if GPG signing is used # Optional step if GPG signing is used
- name: Prepare GPG key - name: Prepare GPG key
if: github.event_name == 'push' if: github.event_name == 'push'
@@ -100,12 +100,12 @@ jobs:
env: env:
GPG_KEYRING_BASE64: "${{ secrets.GPG_KEYRING_BASE64 }}" GPG_KEYRING_BASE64: "${{ secrets.GPG_KEYRING_BASE64 }}"
GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}" GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}"
- name: Helm | Login - name: Helm | Login
if: github.event_name == 'push' if: github.event_name == 'push'
shell: bash shell: bash
run: echo ${{ secrets.QUAY_SECRET }} | helm registry login -u ${{ secrets.QUAY_USER }} --password-stdin quay.io run: echo ${{ secrets.QUAY_SECRET }} | helm registry login -u ${{ secrets.QUAY_USER }} --password-stdin quay.io
- name: Release Charts - name: Release Charts
shell: bash shell: bash
if: github.event_name == 'push' if: github.event_name == 'push'
@@ -117,7 +117,7 @@ jobs:
install="$RUNNER_TOOL_CACHE/cr/${{ inputs.version }}/$(uname -m)" install="$RUNNER_TOOL_CACHE/cr/${{ inputs.version }}/$(uname -m)"
echo "$install" >> "$GITHUB_PATH" echo "$install" >> "$GITHUB_PATH"
./.github/scripts/cr.sh --quay-token "${{ secrets.QUAY_TOKEN }}" --instal-dir $install ./.github/scripts/cr.sh --quay-token "${{ secrets.QUAY_TOKEN }}" --instal-dir $install
- name: Helm | Logout - name: Helm | Logout
shell: bash shell: bash
if: github.event_name == 'push' if: github.event_name == 'push'
@@ -24,4 +24,3 @@ jobs:
version: "~> v2" # or 'latest', 'nightly', semver version: "~> v2" # or 'latest', 'nightly', semver
env: env:
GITHUB_TOKEN: "${{ secrets.BOT_TOKEN }}" GITHUB_TOKEN: "${{ secrets.BOT_TOKEN }}"
+2 -2
View File
@@ -46,10 +46,10 @@ jobs:
- id: reduce - id: reduce
run: | run: |
CONTAINERS=$(jq --raw-output '.changed_files | fromjson | .[] |= sub("(?<filepath>/?containers/(?<first_directory>(?<root1>[/]?)[^/]+/)(?<second_directory>(?<root2>[/]?)[^/]+)(?<extra_paths>/[^/]+)*)"; "\(.second_directory)") | unique' changes.json) CONTAINERS=$(jq --raw-output '.changed_files | fromjson | .[] |= sub("(?<filepath>/?containers/(?<first_directory>(?<root1>[/]?)[^/]+/)(?<second_directory>(?<root2>[/]?)[^/]+)(?<extra_paths>/[^/]+)*)"; "\(.second_directory)") | unique' changes.json)
# Set the containers output # Set the containers output
echo ::set-output name=containers::${CONTAINERS} echo ::set-output name=containers::${CONTAINERS}
# Check if containers were found and set the containers_found output # Check if containers were found and set the containers_found output
if [[ "$CONTAINERS" == "[]" || -z "$CONTAINERS" ]]; then if [[ "$CONTAINERS" == "[]" || -z "$CONTAINERS" ]]; then
echo "No Containers Found, Skipping" echo "No Containers Found, Skipping"
+1 -8
View File
@@ -6,7 +6,7 @@ repos:
- id: remove-tabs - id: remove-tabs
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0 rev: v5.0.0
hooks: hooks:
- id: trailing-whitespace # trims trailing whitespace. - id: trailing-whitespace # trims trailing whitespace.
exclude: ^archive/ exclude: ^archive/
@@ -48,10 +48,3 @@ repos:
exclude: ^archive/ exclude: ^archive/
- id: rst-backticks - id: rst-backticks
exclude: ^archive/ 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)$
+1 -2
View File
@@ -43,7 +43,7 @@ persistence:
enabled: true enabled: true
type: emptyDir type: emptyDir
mountPath: "/.cache" mountPath: "/.cache"
cnpg: cnpg:
main: main:
enabled: true enabled: true
@@ -53,4 +53,3 @@ cnpg:
portal: portal:
open: open:
enabled: true enabled: true
+4 -4
View File
@@ -41,9 +41,9 @@ workload:
RIVEN_FORCE_ENV: "true" RIVEN_FORCE_ENV: "true"
ZURG_URL: somezurgurl:9999 ZURG_URL: somezurgurl:9999
# Set this to your rclone's mount `__all__` dir if using Zurg # 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 # 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_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" RIVEN_DOWNLOADERS_REAL_DEBRID_ENABLED: "false"
# set your real debrid api key # set your real debrid api key
@@ -51,7 +51,7 @@ workload:
RIVEN_UPDATERS_PLEX_ENABLED: "false" RIVEN_UPDATERS_PLEX_ENABLED: "false"
RIVEN_UPDATERS_PLEX_URL: "http://plex:32400" RIVEN_UPDATERS_PLEX_URL: "http://plex:32400"
# set your plex token" # set your plex token"
RIVEN_UPDATERS_PLEX_TOKEN: "xxxxx" RIVEN_UPDATERS_PLEX_TOKEN: "xxxxx"
RIVEN_CONTENT_OVERSEERR_ENABLED: "false" RIVEN_CONTENT_OVERSEERR_ENABLED: "false"
RIVEN_CONTENT_OVERSEERR_URL: "http://overseerr:5055" RIVEN_CONTENT_OVERSEERR_URL: "http://overseerr:5055"
# set your overseerr token # set your overseerr token
@@ -94,7 +94,7 @@ persistence:
data: data:
enabled: true enabled: true
mountPath: "/riven/data" mountPath: "/riven/data"
zurg-all: zurg-all:
enabled: true enabled: true
mountPath: "/mnt/zurg/__all__" mountPath: "/mnt/zurg/__all__"
library: library:
+1 -2
View File
@@ -29,7 +29,7 @@ persistence:
data: data:
enabled: true enabled: true
mountPath: "/app/data" mountPath: "/app/data"
cnpg: cnpg:
main: main:
enabled: true enabled: true
@@ -39,4 +39,3 @@ cnpg:
portal: portal:
open: open:
enabled: true enabled: true
+26 -26
View File
@@ -24,9 +24,9 @@ workload:
type: tcp type: tcp
env: env:
# forces the use of env vars to be always used! # 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 # Set this to your rclone's mount `__all__` dir if using Zurg
LOG_LEVEL: DEBUG LOG_LEVEL: DEBUG
zurg: zurg:
token: YOURTOKEN token: YOURTOKEN
@@ -65,13 +65,13 @@ configmap:
# Zurg configuration version # Zurg configuration version
zurg: v1 zurg: v1
token: {{ .Values.zurg.token }} # https://real-debrid.com/apitoken token: {{ .Values.zurg.token }} # https://real-debrid.com/apitoken
# basic functionality # basic functionality
host: "[::]" # do not change this if you are running it inside a docker container 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 port: 9999 # do not change this if you are running it inside a docker container
concurrent_workers: 32 concurrent_workers: 32
check_for_changes_every_secs: 10 check_for_changes_every_secs: 10
# misc configs # misc configs
retain_folder_name_extension: false # if true, zurg won't modify the filenames from real-debrid 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 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 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 "$@" on_library_update: sh plex_update.sh "$@"
ignore_renames: true ignore_renames: true
# advanced alternative for Jellyfin/Emby support # advanced alternative for Jellyfin/Emby support
# on_library_update: |- # on_library_update: |-
# # Log the updated directories and send refresh request to autoscan # # Log the updated directories and send refresh request to autoscan
@@ -90,10 +90,10 @@ configmap:
# echo "Detected update on: $arg" # echo "Detected update on: $arg"
# # URL encode the directory path # # URL encode the directory path
# encoded_arg=$(python -c "import urllib.parse; print(urllib.parse.quote_plus('$arg'))") # 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 # done
# echo "All updated sections refreshed." # echo "All updated sections refreshed."
# network configs # network configs
network_buffer_size: 1048576 # 1 MiB 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) 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 # - 32.download.real-debrid.com
# - 34.download.real-debrid.com # - 34.download.real-debrid.com
# - 40.download.real-debrid.com # - 40.download.real-debrid.com
# List of directory definitions and their filtering rules # List of directory definitions and their filtering rules
directories: directories:
# Configuration for anime shows # Configuration for anime shows
@@ -124,13 +124,13 @@ configmap:
- has_episodes: true # intelligent detection of episode files inside a torrent - 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_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 - any_file_inside_not_regex: /s\d\de\d\d/i # and usually anime doesn't use SxxExx
shows: shows:
group: media group: media
group_order: 20 group_order: 20
filters: filters:
- has_episodes: true # intelligent detection of episode files inside a torrent - has_episodes: true # intelligent detection of episode files inside a torrent
movies: movies:
group: media # because anime, shows and movies are in the same group, 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 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: data:
plex_update.sh: | plex_update.sh: |
#!/bin/bash #!/bin/bash
# PLEX PARTIAL SCAN script or PLEX UPDATE script # PLEX PARTIAL SCAN script or PLEX UPDATE script
# When zurg detects changes, it can trigger this script IF your config.yml contains # When zurg detects changes, it can trigger this script IF your config.yml contains
# on_library_update: sh plex_update.sh "$@" # on_library_update: sh plex_update.sh "$@"
# Modified from https://github.com/debridmediamanager/zurg-testing/blob/main/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 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") 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 zurg_mount="/storage/realdebrid-zurg" # replace with your zurg mount path, ensure this is what Plex sees
# Get the list of section IDs # 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') 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 "$@" for arg in "$@"
do do
modified_arg="$zurg_mount/$arg" modified_arg="$zurg_mount/$arg"
echo "Detected update on: $arg" echo "Detected update on: $arg"
echo "Absolute path: $modified_arg" echo "Absolute path: $modified_arg"
##### START Added by ElfHosted for auto DMM symlinking ### ##### START Added by ElfHosted for auto DMM symlinking ###
echo "Symlinking $modified_arg to /storage/symlinks/real-debrid-blackhole/$arg" echo "Symlinking $modified_arg to /storage/symlinks/real-debrid-blackhole/$arg"
# Ensure blackhole exists # Ensure blackhole exists
mkdir -p /storage/symlinks/real-debrid-blackhole/movies mkdir -p /storage/symlinks/real-debrid-blackhole/movies
mkdir -p /storage/symlinks/real-debrid-blackhole/shows mkdir -p /storage/symlinks/real-debrid-blackhole/shows
# Copy to the RD blackhole, preserving the directory structure # Copy to the RD blackhole, preserving the directory structure
cp -rs "$modified_arg/"* "/storage/symlinks/real-debrid-blackhole/$(echo $arg | cut -f1 -d/)/" cp -rs "$modified_arg/"* "/storage/symlinks/real-debrid-blackhole/$(echo $arg | cut -f1 -d/)/"
##### END Added by ElfHosted for auto DMM symlinking ### ##### 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()))") 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 if [ -z "$encoded_arg" ]; then
echo "Error: Encoded argument is empty. Check the input or encoding process." echo "Error: Encoded argument is empty. Check the input or encoding process."
continue continue
fi fi
for section_id in $section_ids for section_id in $section_ids
do do
final_url="${plex_url}/library/sections/${section_id}/refresh?path=${encoded_arg}&X-Plex-Token=${token}" final_url="${plex_url}/library/sections/${section_id}/refresh?path=${encoded_arg}&X-Plex-Token=${token}"
echo "Encoded argument: $encoded_arg" echo "Encoded argument: $encoded_arg"
echo "Section ID: $section_id" echo "Section ID: $section_id"
echo "Final URL: $final_url" echo "Final URL: $final_url"
curl -s "$final_url" curl -s "$final_url"
done done
done done
echo "All updated sections refreshed" echo "All updated sections refreshed"
# credits to godver3 # credits to godver3
+1 -1
View File
@@ -20,4 +20,4 @@ ssh-public-key.txt
*.DS_Store *.DS_Store
!/embed/** !/embed/**
.DS_Store .DS_Store
.github .github
+18 -18
View File
@@ -2,22 +2,22 @@
"recommendations": [ "recommendations": [
"golang.go", "golang.go",
"redhat.vscode-yaml", "redhat.vscode-yaml",
"formulahendry.code-runner", "formulahendry.code-runner",
"streetsidesoftware.code-spell-checker", "streetsidesoftware.code-spell-checker",
"Codium.codium", "Codium.codium",
"mrmlnc.vscode-duplicate", "mrmlnc.vscode-duplicate",
"IgorSbitnev.error-gutters", "IgorSbitnev.error-gutters",
"usernamehw.errorlens", "usernamehw.errorlens",
"mhutchie.git-graph", "mhutchie.git-graph",
"eamodio.gitlens", "eamodio.gitlens",
"vivaldy22.go-auto-struct-tag", "vivaldy22.go-auto-struct-tag",
"msyrus.go-doc", "msyrus.go-doc",
"766b.go-outliner", "766b.go-outliner",
"premparihar.gotestexplorer", "premparihar.gotestexplorer",
"yzhang.markdown-all-in-one", "yzhang.markdown-all-in-one",
"searKing.preview-vscode", "searKing.preview-vscode",
"zxh404.vscode-proto3", "zxh404.vscode-proto3",
"DavidAnson.vscode-markdownlint", "DavidAnson.vscode-markdownlint",
"GitHub.copilot" "GitHub.copilot"
] ]
} }
+1 -1
View File
@@ -1,3 +1,3 @@
{ {
} }
+1 -1
View File
@@ -19,4 +19,4 @@
"problemMatcher" : [] "problemMatcher" : []
}, },
] ]
} }
+8 -8
View File
@@ -1,9 +1,9 @@
package cmd package cmd
import ( import (
"strings" "strings"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
var advLongHelp = strings.TrimSpace(` var advLongHelp = strings.TrimSpace(`
@@ -12,13 +12,13 @@ These are all advanced commands that should generally not be needed
`) `)
var adv = &cobra.Command{ var adv = &cobra.Command{
Use: "adv", Use: "adv",
Short: "Advanced cluster maintanence commands", Short: "Advanced cluster maintanence commands",
Long: advLongHelp, Long: advLongHelp,
SilenceUsage: true, SilenceUsage: true,
SilenceErrors: true, SilenceErrors: true,
} }
func init() { func init() {
RootCmd.AddCommand(adv) RootCmd.AddCommand(adv)
} }
+7 -7
View File
@@ -1,20 +1,20 @@
package cmd package cmd
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/gencmd" "github.com/truecharts/public/clustertool/pkg/gencmd"
) )
var bootstrap = &cobra.Command{ var bootstrap = &cobra.Command{
Use: "bootstrap", Use: "bootstrap",
Short: "bootstrap first Talos Node", Short: "bootstrap first Talos Node",
Run: bootstrapfunc, Run: bootstrapfunc,
} }
func bootstrapfunc(cmd *cobra.Command, args []string) { func bootstrapfunc(cmd *cobra.Command, args []string) {
gencmd.RunBootstrap(args) gencmd.RunBootstrap(args)
} }
func init() { func init() {
adv.AddCommand(bootstrap) adv.AddCommand(bootstrap)
} }
+10 -10
View File
@@ -1,21 +1,21 @@
package cmd package cmd
import ( import (
"context" "context"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/fluxhandler" "github.com/truecharts/public/clustertool/pkg/fluxhandler"
) )
var fluxbootstrap = &cobra.Command{ var fluxbootstrap = &cobra.Command{
Use: "fluxbootstrap", Use: "fluxbootstrap",
Short: "Manually bootstrap fluxcd on existing cluster", Short: "Manually bootstrap fluxcd on existing cluster",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
ctx := context.Background() ctx := context.Background()
fluxhandler.FluxBootstrap(ctx) fluxhandler.FluxBootstrap(ctx)
}, },
} }
func init() { func init() {
adv.AddCommand(fluxbootstrap) adv.AddCommand(fluxbootstrap)
} }
+16 -16
View File
@@ -1,26 +1,26 @@
package cmd package cmd
import ( import (
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/gencmd" "github.com/truecharts/public/clustertool/pkg/gencmd"
"github.com/truecharts/public/clustertool/pkg/helper" "github.com/truecharts/public/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/sops" "github.com/truecharts/public/clustertool/pkg/sops"
) )
var health = &cobra.Command{ var health = &cobra.Command{
Use: "health", Use: "health",
Short: "Check Talos Cluster Health", Short: "Check Talos Cluster Health",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if err := sops.DecryptFiles(); err != nil { if err := sops.DecryptFiles(); err != nil {
log.Info().Msgf("Error decrypting files: %v\n", err) log.Info().Msgf("Error decrypting files: %v\n", err)
} }
log.Info().Msg("Running Cluster HealthCheck") log.Info().Msg("Running Cluster HealthCheck")
healthcmd := gencmd.GenHealth(helper.TalEnv["VIP_IP"]) healthcmd := gencmd.GenHealth(helper.TalEnv["VIP_IP"])
gencmd.ExecCmd(healthcmd) gencmd.ExecCmd(healthcmd)
}, },
} }
func init() { func init() {
adv.AddCommand(health) adv.AddCommand(health)
} }
+13 -13
View File
@@ -1,24 +1,24 @@
package cmd package cmd
import ( import (
"os" "os"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/sops" "github.com/truecharts/public/clustertool/pkg/sops"
) )
var precommit = &cobra.Command{ var precommit = &cobra.Command{
Use: "precommit", Use: "precommit",
Short: "Runs the PreCommit encryption check", Short: "Runs the PreCommit encryption check",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if err := sops.CheckFilesAndReportEncryption(true, true); err != nil { if err := sops.CheckFilesAndReportEncryption(true, true); err != nil {
log.Info().Msgf("Error checking files: %v\n", err) log.Info().Msgf("Error checking files: %v\n", err)
os.Exit(1) os.Exit(1)
} }
}, },
} }
func init() { func init() {
adv.AddCommand(precommit) adv.AddCommand(precommit)
} }
+26 -26
View File
@@ -1,41 +1,41 @@
package cmd package cmd
import ( import (
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/gencmd" "github.com/truecharts/public/clustertool/pkg/gencmd"
"github.com/truecharts/public/clustertool/pkg/sops" "github.com/truecharts/public/clustertool/pkg/sops"
) )
var reset = &cobra.Command{ var reset = &cobra.Command{
Use: "reset", Use: "reset",
Short: "Reset Talos Nodes and Kubernetes", Short: "Reset Talos Nodes and Kubernetes",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
var extraArgs []string var extraArgs []string
node := "" node := ""
if len(args) > 1 { if len(args) > 1 {
extraArgs = args[1:] extraArgs = args[1:]
} }
if len(args) >= 1 { if len(args) >= 1 {
node = args[0] node = args[0]
if args[0] == "all" { if args[0] == "all" {
node = "" node = ""
} }
} }
if err := sops.DecryptFiles(); err != nil { if err := sops.DecryptFiles(); err != nil {
log.Info().Msgf("Error decrypting files: %v\n", err) 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) taloscmds := gencmd.GenReset(node, extraArgs)
gencmd.ExecCmds(taloscmds, true) gencmd.ExecCmds(taloscmds, true)
}, },
} }
func init() { func init() {
adv.AddCommand(reset) adv.AddCommand(reset)
} }
+8 -8
View File
@@ -1,18 +1,18 @@
package cmd package cmd
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/scale" "github.com/truecharts/public/clustertool/pkg/scale"
) )
var scaleexport = &cobra.Command{ var scaleexport = &cobra.Command{
Use: "scaleexport", Use: "scaleexport",
Short: "Export SCALE Apps to file", Short: "Export SCALE Apps to file",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
scale.ExportApps() scale.ExportApps()
}, },
} }
func init() { func init() {
adv.AddCommand(scaleexport) adv.AddCommand(scaleexport)
} }
+12 -12
View File
@@ -1,22 +1,22 @@
package cmd package cmd
import ( import (
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/scale" "github.com/truecharts/public/clustertool/pkg/scale"
) )
var scalemigrate = &cobra.Command{ var scalemigrate = &cobra.Command{
Use: "scalemigrate", Use: "scalemigrate",
Short: "Migrate exported SCALE Apps to the Talos Cluster", Short: "Migrate exported SCALE Apps to the Talos Cluster",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
err := scale.ProcessJSONFiles("./truenas_exports") err := scale.ProcessJSONFiles("./truenas_exports")
if err != nil { if err != nil {
log.Info().Msgf("Error: %v", err) log.Info().Msgf("Error: %v", err)
} }
}, },
} }
func init() { func init() {
adv.AddCommand(scalemigrate) adv.AddCommand(scalemigrate)
} }
+16 -16
View File
@@ -1,26 +1,26 @@
package cmd package cmd
import ( import (
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/gencmd" "github.com/truecharts/public/clustertool/pkg/gencmd"
"github.com/truecharts/public/clustertool/pkg/initfiles" "github.com/truecharts/public/clustertool/pkg/initfiles"
) )
var testcmd = &cobra.Command{ var testcmd = &cobra.Command{
Use: "test", Use: "test",
Short: "test run", Short: "test run",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
initfiles.LoadTalEnv() initfiles.LoadTalEnv()
// err := fluxhandler.ProcessJSONFiles("./testdata/truenas_exports") // err := fluxhandler.ProcessJSONFiles("./testdata/truenas_exports")
// if err != nil { // if err != nil {
// log.Info().Msg("Error:", err) // log.Info().Msg("Error:", err)
// } // }
something := gencmd.GenBootstrap("", []string{}) something := gencmd.GenBootstrap("", []string{})
log.Info().Msgf("test %v", something) log.Info().Msgf("test %v", something)
}, },
} }
func init() { func init() {
adv.AddCommand(testcmd) adv.AddCommand(testcmd)
} }
+56 -56
View File
@@ -1,78 +1,78 @@
package cmd package cmd
import ( import (
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/gencmd" "github.com/truecharts/public/clustertool/pkg/gencmd"
"github.com/truecharts/public/clustertool/pkg/helper" "github.com/truecharts/public/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/nodestatus" "github.com/truecharts/public/clustertool/pkg/nodestatus"
"github.com/truecharts/public/clustertool/pkg/sops" "github.com/truecharts/public/clustertool/pkg/sops"
) )
var apply = &cobra.Command{ var apply = &cobra.Command{
Use: "apply", Use: "apply",
Short: "apply TalosConfig", Short: "apply TalosConfig",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
var extraArgs []string var extraArgs []string
node := "" node := ""
if len(args) > 1 { if len(args) > 1 {
extraArgs = args[1:] extraArgs = args[1:]
} }
if len(args) >= 1 { if len(args) >= 1 {
node = args[0] node = args[0]
if args[0] == "all" { if args[0] == "all" {
node = "" node = ""
} }
} }
if err := sops.DecryptFiles(); err != nil { if err := sops.DecryptFiles(); err != nil {
log.Info().Msgf("Error decrypting files: %v\n", err) log.Info().Msgf("Error decrypting files: %v\n", err)
} }
bootstrapcmds := gencmd.GenBootstrap("", extraArgs) bootstrapcmds := gencmd.GenBootstrap("", extraArgs)
bootstrapNode := helper.ExtractNode(bootstrapcmds) bootstrapNode := helper.ExtractNode(bootstrapcmds)
log.Info().Msgf("Checking if first node is ready to recieve anything... %s", bootstrapNode) log.Info().Msgf("Checking if first node is ready to recieve anything... %s", bootstrapNode)
status, err := nodestatus.WaitForHealth(bootstrapNode, []string{"running", "maintenance"}) status, err := nodestatus.WaitForHealth(bootstrapNode, []string{"running", "maintenance"})
if err != nil { if err != nil {
} else if status == "maintenance" { } else if status == "maintenance" {
bootstrapNeeded, err := nodestatus.CheckNeedBootstrap(bootstrapNode) bootstrapNeeded, err := nodestatus.CheckNeedBootstrap(bootstrapNode)
if err != nil { if err != nil {
} else if bootstrapNeeded { } else if bootstrapNeeded {
log.Info().Msg("First Node requires to be bootstrapped before it can be used.") 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]: ") { if helper.GetYesOrNo("Do you want to bootstrap now? (yes/no) [y/n]: ") {
gencmd.RunBootstrap(extraArgs) gencmd.RunBootstrap(extraArgs)
if helper.GetYesOrNo("Do you want to apply config to all remaining clusternodes as well? (yes/no) [y/n]: ") { if helper.GetYesOrNo("Do you want to apply config to all remaining clusternodes as well? (yes/no) [y/n]: ") {
RunApply("", extraArgs) RunApply("", extraArgs)
} }
} else { } else {
log.Info().Msg("Exiting bootstrap, as apply is not possible...") log.Info().Msg("Exiting bootstrap, as apply is not possible...")
} }
} else { } else {
log.Info().Msg("Detected maintenance mode, but first node does not require to be bootrapped.") 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...") log.Info().Msg("Assuming apply is requested... continuing with Apply...")
RunApply(node, extraArgs) RunApply(node, extraArgs)
} }
} else if status == "running" { } else if status == "running" {
log.Info().Msg("Apply: running first controlnode detected, continuing...") log.Info().Msg("Apply: running first controlnode detected, continuing...")
RunApply(node, extraArgs) RunApply(node, extraArgs)
} }
}, },
} }
func RunApply(node string, extraArgs []string) { func RunApply(node string, extraArgs []string) {
taloscmds := gencmd.GenApply(node, extraArgs) taloscmds := gencmd.GenApply(node, extraArgs)
gencmd.ExecCmds(taloscmds, true) gencmd.ExecCmds(taloscmds, true)
kubeconfigcmds := gencmd.GenKubeConfig(helper.TalEnv["VIP_IP"]) kubeconfigcmds := gencmd.GenKubeConfig(helper.TalEnv["VIP_IP"])
gencmd.ExecCmd(kubeconfigcmds) gencmd.ExecCmd(kubeconfigcmds)
} }
func init() { func init() {
RootCmd.AddCommand(apply) RootCmd.AddCommand(apply)
} }
+8 -8
View File
@@ -1,9 +1,9 @@
package cmd package cmd
import ( import (
"strings" "strings"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
var chartsLongHelp = strings.TrimSpace(` var chartsLongHelp = strings.TrimSpace(`
@@ -19,13 +19,13 @@ Workflow:
`) `)
var charts = &cobra.Command{ var charts = &cobra.Command{
Use: "charts", Use: "charts",
Short: "A tool to help with creating Talos cluster", Short: "A tool to help with creating Talos cluster",
Long: chartsLongHelp, Long: chartsLongHelp,
SilenceUsage: true, SilenceUsage: true,
SilenceErrors: true, SilenceErrors: true,
} }
func init() { func init() {
RootCmd.AddCommand(charts) RootCmd.AddCommand(charts)
} }
+13 -13
View File
@@ -1,23 +1,23 @@
package cmd package cmd
import ( import (
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/charts/version" "github.com/truecharts/public/clustertool/pkg/charts/version"
) )
var bumper = &cobra.Command{ var bumper = &cobra.Command{
Use: "bump", Use: "bump",
Short: "generate a bumped image version", Short: "generate a bumped image version",
Example: "charttool bump <version> <kind>", Example: "charttool bump <version> <kind>",
Args: cobra.ExactArgs(2), Args: cobra.ExactArgs(2),
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if err := version.Bump(args[0], args[1]); err != nil { if err := version.Bump(args[0], args[1]); err != nil {
log.Fatal().Err(err).Msg("failed to bump version") log.Fatal().Err(err).Msg("failed to bump version")
} }
}, },
} }
func init() { func init() {
charts.AddCommand(bumper) charts.AddCommand(bumper)
} }
+18 -18
View File
@@ -1,29 +1,29 @@
package cmd package cmd
import ( import (
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/charts/deps" "github.com/truecharts/public/clustertool/pkg/charts/deps"
"github.com/truecharts/public/clustertool/pkg/helper" "github.com/truecharts/public/clustertool/pkg/helper"
) )
var depsCmd = &cobra.Command{ var depsCmd = &cobra.Command{
Use: "deps", Use: "deps",
Short: "Download, Update and Verify Helm dependencies", Short: "Download, Update and Verify Helm dependencies",
Example: "charttool deps <chart> <chart> <chart>", Example: "charttool deps <chart> <chart> <chart>",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if err := deps.LoadGPGKey(); err != nil { if err := deps.LoadGPGKey(); err != nil {
log.Fatal().Err(err).Msg("failed to load gpg key") log.Fatal().Err(err).Msg("failed to load gpg key")
} }
// Specify the mode (SyncMode or AsyncMode) // Specify the mode (SyncMode or AsyncMode)
mode := helper.SyncMode // Change to helper.SyncMode for synchronous processing mode := helper.SyncMode // Change to helper.SyncMode for synchronous processing
if err := helper.WalkCharts(args, deps.DownloadDeps, "", mode); err != nil { if err := helper.WalkCharts(args, deps.DownloadDeps, "", mode); err != nil {
log.Fatal().Err(err).Msg("failed to update Chart.yaml") log.Fatal().Err(err).Msg("failed to update Chart.yaml")
} }
}, },
} }
func init() { func init() {
charts.AddCommand(depsCmd) charts.AddCommand(depsCmd)
} }
+28 -28
View File
@@ -1,39 +1,39 @@
package cmd package cmd
import ( import (
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/charts/changelog" "github.com/truecharts/public/clustertool/pkg/charts/changelog"
) )
var genChangelogCmd = &cobra.Command{ var genChangelogCmd = &cobra.Command{
Use: "genchangelog", Use: "genchangelog",
Short: "Generate changelog for charts", Short: "Generate changelog for charts",
Example: "charttool genchangelog <repo path> <template path> <charts dir>", Example: "charttool genchangelog <repo path> <template path> <charts dir>",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if len(args) < 3 { if len(args) < 3 {
log.Fatal().Msg("Missing required arguments. Please provide the repo path, template path and charts directory.") log.Fatal().Msg("Missing required arguments. Please provide the repo path, template path and charts directory.")
} }
opts := &changelog.ChangelogOptions{ opts := &changelog.ChangelogOptions{
RepoPath: args[0], RepoPath: args[0],
TemplatePath: args[1], TemplatePath: args[1],
ChartsDir: args[2], ChartsDir: args[2],
ChangelogFileName: "CHANGELOG.md", ChangelogFileName: "CHANGELOG.md",
JSONOutputPath: "./changelog.json", JSONOutputPath: "./changelog.json",
PrettyJSON: true, PrettyJSON: true,
StatusUpdateInterval: 5, StatusUpdateInterval: 5,
SkipCommitsWithBadMessage: false, SkipCommitsWithBadMessage: false,
} }
if err := opts.Generate(); err != nil { if err := opts.Generate(); err != nil {
log.Fatal().Err(err) log.Fatal().Err(err)
} }
if err := opts.Render(); err != nil { if err := opts.Render(); err != nil {
log.Fatal().Err(err) log.Fatal().Err(err)
} }
}, },
} }
func init() { func init() {
charts.AddCommand(genChangelogCmd) charts.AddCommand(genChangelogCmd)
} }
+20 -20
View File
@@ -1,34 +1,34 @@
package cmd package cmd
import ( import (
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/charts/website" "github.com/truecharts/public/clustertool/pkg/charts/website"
"github.com/truecharts/public/clustertool/pkg/helper" "github.com/truecharts/public/clustertool/pkg/helper"
) )
var genChartListCmd = &cobra.Command{ var genChartListCmd = &cobra.Command{
Use: "genchartlist", Use: "genchartlist",
Short: "Generate chart list json file", Short: "Generate chart list json file",
Example: "charttool genchartlist <path to charts folder>", Example: "charttool genchartlist <path to charts folder>",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
opts := &website.ChartListOptions{ opts := &website.ChartListOptions{
OutputPath: "./charts.json", OutputPath: "./charts.json",
TrainFilter: []string{}, // We can filter by train later if needed TrainFilter: []string{}, // We can filter by train later if needed
} }
if err := helper.WalkCharts2(args, opts.GetChartData, helper.AsyncMode); err != nil { if err := helper.WalkCharts2(args, opts.GetChartData, helper.AsyncMode); err != nil {
log.Fatal().Err(err).Msg("failed to generate chart list json file:") log.Fatal().Err(err).Msg("failed to generate chart list json file:")
} }
if err := opts.WriteChartList(); err != nil { if err := opts.WriteChartList(); err != nil {
log.Fatal().Err(err).Msg("failed to write chart list json file:") log.Fatal().Err(err).Msg("failed to write chart list json file:")
} }
}, },
} }
func init() { func init() {
charts.AddCommand(genChartListCmd) charts.AddCommand(genChartListCmd)
} }
+22 -22
View File
@@ -1,36 +1,36 @@
package cmd package cmd
import ( import (
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"slices" "slices"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/charts/chartFile" "github.com/truecharts/public/clustertool/pkg/charts/chartFile"
"github.com/truecharts/public/clustertool/pkg/helper" "github.com/truecharts/public/clustertool/pkg/helper"
) )
var genMetaCmd = &cobra.Command{ var genMetaCmd = &cobra.Command{
Use: "genmeta", Use: "genmeta",
Short: "Generate and update Chart.yaml metadata", Short: "Generate and update Chart.yaml metadata",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
bump := "" bump := ""
if len(args) > 0 && slices.Contains([]string{"patch", "minor", "major"}, args[0]) { if len(args) > 0 && slices.Contains([]string{"patch", "minor", "major"}, args[0]) {
bump = args[0] bump = args[0]
args = args[1:] args = args[1:]
} }
// Specify the mode (SyncMode or AsyncMode) // Specify the mode (SyncMode or AsyncMode)
// Async Mode showed concurrency issues (Stavros) // Async Mode showed concurrency issues (Stavros)
mode := helper.SyncMode mode := helper.SyncMode
err := helper.WalkCharts(args, chartFile.UpdateChartFile, bump, mode) err := helper.WalkCharts(args, chartFile.UpdateChartFile, bump, mode)
if err != nil { if err != nil {
log.Fatal().Err(err).Msg("failed to update Chart.yaml:") log.Fatal().Err(err).Msg("failed to update Chart.yaml:")
} }
}, },
} }
func init() { func init() {
charts.AddCommand(genMetaCmd) charts.AddCommand(genMetaCmd)
} }
+14 -14
View File
@@ -1,25 +1,25 @@
package cmd package cmd
import ( import (
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/charts/image" "github.com/truecharts/public/clustertool/pkg/charts/image"
) )
var tagCleaner = &cobra.Command{ var tagCleaner = &cobra.Command{
Use: "tagcleaner", Use: "tagcleaner",
Short: "Creates a clean version tag from a container digest", Short: "Creates a clean version tag from a container digest",
Example: "charttool tagcleaner <tag>", Example: "charttool tagcleaner <tag>",
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
err := image.Clean(args[0]) err := image.Clean(args[0])
if err != nil { if err != nil {
log.Fatal().Err(err).Msg("failed to clean tag") log.Fatal().Err(err).Msg("failed to clean tag")
} }
}, },
} }
func init() { func init() {
charts.AddCommand(tagCleaner) charts.AddCommand(tagCleaner)
} }
+13 -13
View File
@@ -1,24 +1,24 @@
package cmd package cmd
import ( import (
"os" "os"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/sops" "github.com/truecharts/public/clustertool/pkg/sops"
) )
var checkcrypt = &cobra.Command{ var checkcrypt = &cobra.Command{
Use: "checkcrypt", Use: "checkcrypt",
Short: "Checks if all files are encrypted correctly in accordance with .sops.yaml", Short: "Checks if all files are encrypted correctly in accordance with .sops.yaml",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if err := sops.CheckFilesAndReportEncryption(false, false); err != nil { if err := sops.CheckFilesAndReportEncryption(false, false); err != nil {
log.Info().Msgf("Error checking files: %v\n", err) log.Info().Msgf("Error checking files: %v\n", err)
os.Exit(1) os.Exit(1)
} }
}, },
} }
func init() { func init() {
RootCmd.AddCommand(checkcrypt) RootCmd.AddCommand(checkcrypt)
} }
+11 -11
View File
@@ -1,21 +1,21 @@
package cmd package cmd
import ( import (
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/sops" "github.com/truecharts/public/clustertool/pkg/sops"
) )
var decrypt = &cobra.Command{ var decrypt = &cobra.Command{
Use: "decrypt", Use: "decrypt",
Short: "Decrypt all high-risk data using sops", Short: "Decrypt all high-risk data using sops",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if err := sops.DecryptFiles(); err != nil { if err := sops.DecryptFiles(); err != nil {
log.Info().Msgf("Error decrypting files: %v\n", err) log.Info().Msgf("Error decrypting files: %v\n", err)
} }
}, },
} }
func init() { func init() {
RootCmd.AddCommand(decrypt) RootCmd.AddCommand(decrypt)
} }
+11 -11
View File
@@ -1,21 +1,21 @@
package cmd package cmd
import ( import (
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/sops" "github.com/truecharts/public/clustertool/pkg/sops"
) )
var encrypt = &cobra.Command{ var encrypt = &cobra.Command{
Use: "encrypt", Use: "encrypt",
Short: "Encrypt all high-risk data using sops", Short: "Encrypt all high-risk data using sops",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if err := sops.EncryptAllFiles(); err != nil { if err := sops.EncryptAllFiles(); err != nil {
log.Info().Msgf("Error encrypting files: %v\n", err) log.Info().Msgf("Error encrypting files: %v\n", err)
} }
}, },
} }
func init() { func init() {
RootCmd.AddCommand(encrypt) RootCmd.AddCommand(encrypt)
} }
+4 -4
View File
@@ -1,14 +1,14 @@
package cmd package cmd
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
var fluxBootstrap = &cobra.Command{ var fluxBootstrap = &cobra.Command{
Use: "fluxBootstrap", Use: "fluxBootstrap",
Short: "bootstrapFluxCD", Short: "bootstrapFluxCD",
} }
func init() { func init() {
RootCmd.AddCommand(fluxBootstrap) RootCmd.AddCommand(fluxBootstrap)
} }
+26 -26
View File
@@ -1,14 +1,14 @@
package cmd package cmd
import ( import (
"strings" "strings"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/gencmd" "github.com/truecharts/public/clustertool/pkg/gencmd"
"github.com/truecharts/public/clustertool/pkg/helper" "github.com/truecharts/public/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/nodestatus" "github.com/truecharts/public/clustertool/pkg/nodestatus"
"github.com/truecharts/public/clustertool/pkg/sops" "github.com/truecharts/public/clustertool/pkg/sops"
) )
var genConfigLongHelp = strings.TrimSpace(` var genConfigLongHelp = strings.TrimSpace(`
@@ -21,27 +21,27 @@ Powered by TalHelper (https://budimanjojo.github.io/talhelper/)
`) `)
var genConfig = &cobra.Command{ var genConfig = &cobra.Command{
Use: "genconfig", Use: "genconfig",
Short: "generate Configuration files", Short: "generate Configuration files",
Long: genConfigLongHelp, Long: genConfigLongHelp,
Example: "clustertool genconfig", Example: "clustertool genconfig",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if err := sops.DecryptFiles(); err != nil { if err := sops.DecryptFiles(); err != nil {
log.Info().Msgf("Error decrypting files: %v\n", err) log.Info().Msgf("Error decrypting files: %v\n", err)
} }
gencmd.GenConfig(args) gencmd.GenConfig(args)
err := nodestatus.CheckHealth(helper.TalEnv["VIP_IP"], "", true) err := nodestatus.CheckHealth(helper.TalEnv["VIP_IP"], "", true)
if err == nil { if err == nil {
log.Info().Msg("Running Cluster Detected, setting KubeConfig...") log.Info().Msg("Running Cluster Detected, setting KubeConfig...")
kubeconfigcmds := gencmd.GenKubeConfig(helper.TalEnv["VIP_IP"]) kubeconfigcmds := gencmd.GenKubeConfig(helper.TalEnv["VIP_IP"])
gencmd.ExecCmd(kubeconfigcmds) gencmd.ExecCmd(kubeconfigcmds)
} else { } else {
log.Info().Msg("No Running Cluster Detected, Skipping KubeConfig...") log.Info().Msg("No Running Cluster Detected, Skipping KubeConfig...")
} }
}, },
} }
func init() { func init() {
RootCmd.AddCommand(genConfig) RootCmd.AddCommand(genConfig)
} }
+8 -8
View File
@@ -1,9 +1,9 @@
package cmd package cmd
import ( import (
"strings" "strings"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
var helmreleaseHelp = strings.TrimSpace(` var helmreleaseHelp = strings.TrimSpace(`
@@ -12,13 +12,13 @@ A toolkit to load helm-release files onto a cluster without flux
`) `)
var helmrelease = &cobra.Command{ var helmrelease = &cobra.Command{
Use: "helmrelease", Use: "helmrelease",
Short: "A toolkit to load helm-release files onto a cluster without flux", Short: "A toolkit to load helm-release files onto a cluster without flux",
Long: advLongHelp, Long: advLongHelp,
SilenceUsage: true, SilenceUsage: true,
SilenceErrors: true, SilenceErrors: true,
} }
func init() { func init() {
RootCmd.AddCommand(helmrelease) RootCmd.AddCommand(helmrelease)
} }
+23 -23
View File
@@ -1,37 +1,37 @@
package cmd package cmd
import ( import (
"path/filepath" "path/filepath"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/fluxhandler" "github.com/truecharts/public/clustertool/pkg/fluxhandler"
"github.com/truecharts/public/clustertool/pkg/initfiles" "github.com/truecharts/public/clustertool/pkg/initfiles"
) )
var hrinstall = &cobra.Command{ var hrinstall = &cobra.Command{
Use: "install", Use: "install",
Short: "install a helm-release file without flux, helm-release file needs to be called helm-release.yaml", Short: "install a helm-release file without flux, helm-release file needs to be called helm-release.yaml",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
initfiles.LoadTalEnv() initfiles.LoadTalEnv()
var dir string var dir string
// Check if args[0] includes a filename // Check if args[0] includes a filename
if filename := filepath.Base(args[0]); filename != "" && filename != "." && filename != "/" { if filename := filepath.Base(args[0]); filename != "" && filename != "." && filename != "/" {
dir = filepath.Dir(args[0]) dir = filepath.Dir(args[0])
} else { } else {
dir = args[0] // Assuming args[0] is just a directory path without a filename dir = args[0] // Assuming args[0] is just a directory path without a filename
} }
helmRepoPath := filepath.Join("./repositories", "helm") helmRepoPath := filepath.Join("./repositories", "helm")
helmRepos, _ := fluxhandler.LoadAllHelmRepos(helmRepoPath) helmRepos, _ := fluxhandler.LoadAllHelmRepos(helmRepoPath)
intermediateCharts := []fluxhandler.HelmChart{ intermediateCharts := []fluxhandler.HelmChart{
{dir, false, true}, {dir, false, true},
} }
fluxhandler.InstallCharts(intermediateCharts, helmRepos, false) fluxhandler.InstallCharts(intermediateCharts, helmRepos, false)
}, },
} }
func init() { func init() {
helmrelease.AddCommand(hrinstall) helmrelease.AddCommand(hrinstall)
} }
+23 -23
View File
@@ -1,37 +1,37 @@
package cmd package cmd
import ( import (
"path/filepath" "path/filepath"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/fluxhandler" "github.com/truecharts/public/clustertool/pkg/fluxhandler"
"github.com/truecharts/public/clustertool/pkg/initfiles" "github.com/truecharts/public/clustertool/pkg/initfiles"
) )
var hrupgrade = &cobra.Command{ var hrupgrade = &cobra.Command{
Use: "upgrade", Use: "upgrade",
Short: "run helm-upgrade using a helm-release file without flux", Short: "run helm-upgrade using a helm-release file without flux",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
initfiles.LoadTalEnv() initfiles.LoadTalEnv()
var dir string var dir string
// Check if args[0] includes a filename // Check if args[0] includes a filename
if filename := filepath.Base(args[0]); filename != "" && filename != "." && filename != "/" { if filename := filepath.Base(args[0]); filename != "" && filename != "." && filename != "/" {
dir = filepath.Dir(args[0]) dir = filepath.Dir(args[0])
} else { } else {
dir = args[0] // Assuming args[0] is just a directory path without a filename dir = args[0] // Assuming args[0] is just a directory path without a filename
} }
helmRepoPath := filepath.Join("./repositories", "helm") helmRepoPath := filepath.Join("./repositories", "helm")
helmRepos, _ := fluxhandler.LoadAllHelmRepos(helmRepoPath) helmRepos, _ := fluxhandler.LoadAllHelmRepos(helmRepoPath)
intermediateCharts := []fluxhandler.HelmChart{ intermediateCharts := []fluxhandler.HelmChart{
{dir, false, true}, {dir, false, true},
} }
fluxhandler.UpgradeCharts(intermediateCharts, helmRepos, false) fluxhandler.UpgradeCharts(intermediateCharts, helmRepos, false)
}, },
} }
func init() { func init() {
helmrelease.AddCommand(hrupgrade) helmrelease.AddCommand(hrupgrade)
} }
+9 -9
View File
@@ -1,19 +1,19 @@
package cmd package cmd
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/info" "github.com/truecharts/public/clustertool/pkg/info"
) )
var infoCmd = &cobra.Command{ var infoCmd = &cobra.Command{
Use: "info", Use: "info",
Short: "Prints information about the clustertool binary", Short: "Prints information about the clustertool binary",
Example: "clustertool info", Example: "clustertool info",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
info.NewInfo().Print() info.NewInfo().Print()
}, },
} }
func init() { func init() {
RootCmd.AddCommand(infoCmd) RootCmd.AddCommand(infoCmd)
} }
+13 -13
View File
@@ -1,11 +1,11 @@
package cmd package cmd
import ( import (
"strings" "strings"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/initfiles" "github.com/truecharts/public/clustertool/pkg/initfiles"
"github.com/truecharts/public/clustertool/pkg/sops" "github.com/truecharts/public/clustertool/pkg/sops"
) )
var initLongHelp = strings.TrimSpace(` var initLongHelp = strings.TrimSpace(`
@@ -21,18 +21,18 @@ Powered by TalHelper (https://budimanjojo.github.io/talhelper/)
`) `)
var initFiles = &cobra.Command{ var initFiles = &cobra.Command{
Use: "init", Use: "init",
Short: "generate Basic ClusterTool file-and-folder structure in current folder", Short: "generate Basic ClusterTool file-and-folder structure in current folder",
Long: initLongHelp, Long: initLongHelp,
Example: "clustertool init", Example: "clustertool init",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
sops.DecryptFiles() sops.DecryptFiles()
initfiles.InitFiles() initfiles.InitFiles()
}, },
} }
func init() { func init() {
RootCmd.AddCommand(initFiles) RootCmd.AddCommand(initFiles)
} }
+29 -29
View File
@@ -1,13 +1,13 @@
package cmd package cmd
import ( import (
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/helper" "github.com/truecharts/public/clustertool/pkg/helper"
) )
var thisversion string var thisversion string
@@ -28,35 +28,35 @@ Workflow:
`) `)
var RootCmd = &cobra.Command{ var RootCmd = &cobra.Command{
Use: "clustertool", Use: "clustertool",
Short: "A tool to help with creating Talos cluster", Short: "A tool to help with creating Talos cluster",
Long: rootLongHelp, Long: rootLongHelp,
SilenceUsage: true, SilenceUsage: true,
SilenceErrors: true, SilenceErrors: true,
Version: thisversion, Version: thisversion,
} }
func init() { func init() {
// Define the --cluster flag // Define the --cluster flag
RootCmd.PersistentFlags().StringVar(&helper.ClusterName, "cluster", "main", "Cluster name") RootCmd.PersistentFlags().StringVar(&helper.ClusterName, "cluster", "main", "Cluster name")
} }
func Execute() error { func Execute() error {
// Parse only the persistent flags (like --cluster) before executing any command // Parse only the persistent flags (like --cluster) before executing any command
RootCmd.PersistentFlags().Parse(os.Args[1:]) RootCmd.PersistentFlags().Parse(os.Args[1:])
// You can now access the helper.ClusterName variable // You can now access the helper.ClusterName variable
if helper.ClusterName != "" { if helper.ClusterName != "" {
log.Info().Msgf("Cluster name: %s\n", helper.ClusterName) log.Info().Msgf("Cluster name: %s\n", helper.ClusterName)
helper.ClusterPath = filepath.Join("./clusters", helper.ClusterName) helper.ClusterPath = filepath.Join("./clusters", helper.ClusterName)
helper.ClusterEnvFile = filepath.Join(helper.ClusterPath, "/clusterenv.yaml") helper.ClusterEnvFile = filepath.Join(helper.ClusterPath, "/clusterenv.yaml")
helper.TalConfigFile = filepath.Join(helper.ClusterPath, "/talos", "talconfig.yaml") helper.TalConfigFile = filepath.Join(helper.ClusterPath, "/talos", "talconfig.yaml")
helper.TalosPath = filepath.Join(helper.ClusterPath, "/talos") helper.TalosPath = filepath.Join(helper.ClusterPath, "/talos")
helper.TalosGenerated = filepath.Join(helper.TalosPath, "/generated") helper.TalosGenerated = filepath.Join(helper.TalosPath, "/generated")
helper.TalosConfigFile = filepath.Join(helper.TalosGenerated, "talosconfig") helper.TalosConfigFile = filepath.Join(helper.TalosGenerated, "talosconfig")
helper.TalSecretFile = filepath.Join(helper.TalosGenerated, "talsecret.yaml") helper.TalSecretFile = filepath.Join(helper.TalosGenerated, "talsecret.yaml")
} }
// Execute the root command and all subcommands // Execute the root command and all subcommands
return RootCmd.Execute() return RootCmd.Execute()
} }
+33 -33
View File
@@ -1,50 +1,50 @@
package cmd package cmd
import ( import (
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/gencmd" "github.com/truecharts/public/clustertool/pkg/gencmd"
"github.com/truecharts/public/clustertool/pkg/helper" "github.com/truecharts/public/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/sops" "github.com/truecharts/public/clustertool/pkg/sops"
) )
var upgrade = &cobra.Command{ var upgrade = &cobra.Command{
Use: "upgrade", Use: "upgrade",
Short: "Upgrade Talos Nodes and Kubernetes", Short: "Upgrade Talos Nodes and Kubernetes",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
var extraArgs []string var extraArgs []string
node := "" node := ""
if len(args) > 1 { if len(args) > 1 {
extraArgs = args[1:] extraArgs = args[1:]
} }
if len(args) >= 1 { if len(args) >= 1 {
node = args[0] node = args[0]
if args[0] == "all" { if args[0] == "all" {
node = "" node = ""
} }
} }
if err := sops.DecryptFiles(); err != nil { if err := sops.DecryptFiles(); err != nil {
log.Info().Msgf("Error decrypting files: %v\n", err) log.Info().Msgf("Error decrypting files: %v\n", err)
} }
log.Info().Msg("Running Cluster Upgrade") log.Info().Msg("Running Cluster Upgrade")
taloscmds := gencmd.GenUpgrade(node, extraArgs) taloscmds := gencmd.GenUpgrade(node, extraArgs)
gencmd.ExecCmds(taloscmds, true) gencmd.ExecCmds(taloscmds, true)
log.Info().Msg("Running Kubernetes Upgrade") log.Info().Msg("Running Kubernetes Upgrade")
kubeUpgradeCmd := gencmd.GenKubeUpgrade(helper.TalEnv["VIP_IP"]) kubeUpgradeCmd := gencmd.GenKubeUpgrade(helper.TalEnv["VIP_IP"])
gencmd.ExecCmd(kubeUpgradeCmd) gencmd.ExecCmd(kubeUpgradeCmd)
log.Info().Msg("(re)Loading KubeConfig)") log.Info().Msg("(re)Loading KubeConfig)")
kubeconfigcmds := gencmd.GenKubeConfig(helper.TalEnv["VIP_IP"]) kubeconfigcmds := gencmd.GenKubeConfig(helper.TalEnv["VIP_IP"])
gencmd.ExecCmd(kubeconfigcmds) gencmd.ExecCmd(kubeconfigcmds)
}, },
} }
func init() { func init() {
RootCmd.AddCommand(upgrade) RootCmd.AddCommand(upgrade)
} }
+79 -79
View File
@@ -1,16 +1,16 @@
package embed package embed
import ( import (
"embed" "embed"
"io/fs" "io/fs"
"os" "os"
"path/filepath" "path/filepath"
"runtime" "runtime"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/leaanthony/debme" "github.com/leaanthony/debme"
"github.com/truecharts/public/clustertool/pkg/helper" "github.com/truecharts/public/clustertool/pkg/helper"
) )
//go:embed generic/* //go:embed generic/*
@@ -18,90 +18,90 @@ var GenericFiles embed.FS
var TalosExec string var TalosExec string
func AllToCache() { func AllToCache() {
err := os.RemoveAll(helper.CacheDir) err := os.RemoveAll(helper.CacheDir)
if err != nil { if err != nil {
log.Fatal().Err(err) log.Fatal().Err(err)
} }
GOOSARCH := runtime.GOOS + "_" + runtime.GOARCH GOOSARCH := runtime.GOOS + "_" + runtime.GOARCH
filesToCache(StaticFiles, GOOSARCH) filesToCache(StaticFiles, GOOSARCH)
filesToCache(GenericFiles, "generic") filesToCache(GenericFiles, "generic")
} }
func filesToCache(embededfs embed.FS, sub string) { func filesToCache(embededfs embed.FS, sub string) {
// Ensure the base cache directory exists // Ensure the base cache directory exists
if err := os.MkdirAll(helper.CacheDir, os.ModePerm); err != nil { if err := os.MkdirAll(helper.CacheDir, os.ModePerm); err != nil {
log.Info().Msgf("Error creating base cache directory: %v", err) log.Info().Msgf("Error creating base cache directory: %v", err)
return return
} }
root, _ := debme.FS(embededfs, sub) root, _ := debme.FS(embededfs, sub)
fs.WalkDir(root, ".", func(path string, d fs.DirEntry, err error) error { fs.WalkDir(root, ".", func(path string, d fs.DirEntry, err error) error {
if err != nil { if err != nil {
return err return err
} }
if d.Name() != sub { if d.Name() != sub {
if d.IsDir() { if d.IsDir() {
// If it's a directory, create the corresponding directory in the cache // If it's a directory, create the corresponding directory in the cache
writePath := filepath.Join(helper.CacheDir, path) writePath := filepath.Join(helper.CacheDir, path)
if err := os.MkdirAll(writePath, os.ModePerm); err != nil { if err := os.MkdirAll(writePath, os.ModePerm); err != nil {
log.Info().Msgf("Error creating directory in cache: %v", err) log.Info().Msgf("Error creating directory in cache: %v", err)
return err return err
} }
} else { } else {
// If it's a file, read and write it to the cache // If it's a file, read and write it to the cache
data, err := root.ReadFile(path) data, err := root.ReadFile(path)
if err != nil { if err != nil {
log.Info().Msgf("Error reading file: %v", err) log.Info().Msgf("Error reading file: %v", err)
return err return err
} }
writePath := filepath.Join(helper.CacheDir, path) writePath := filepath.Join(helper.CacheDir, path)
if err := os.WriteFile(writePath, data, 0755); err != nil { if err := os.WriteFile(writePath, data, 0755); err != nil {
log.Info().Msgf("Error writing file to cache: %v", err) log.Info().Msgf("Error writing file to cache: %v", err)
return err return err
} }
} }
} }
return nil return nil
}) })
} }
func GetTalosExec() string { func GetTalosExec() string {
execName := "" execName := ""
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
if runtime.GOARCH == "amd64" { if runtime.GOARCH == "amd64" {
execName = "talosctl-windows-amd64.exe" execName = "talosctl-windows-amd64.exe"
} else { } else {
execName = "talosctl-windows-arm64.exe" execName = "talosctl-windows-arm64.exe"
} }
} }
if runtime.GOOS == "linux" { if runtime.GOOS == "linux" {
if runtime.GOARCH == "amd64" { if runtime.GOARCH == "amd64" {
execName = "talosctl-linux-amd64" execName = "talosctl-linux-amd64"
} else { } else {
execName = "talosctl-linux-arm64" execName = "talosctl-linux-arm64"
} }
} }
if runtime.GOOS == "darwin" { if runtime.GOOS == "darwin" {
if runtime.GOARCH == "amd64" { if runtime.GOARCH == "amd64" {
execName = "talosctl-darwin-amd64" execName = "talosctl-darwin-amd64"
} else { } else {
execName = "talosctl-darwin-arm64" execName = "talosctl-darwin-arm64"
} }
} }
if runtime.GOOS == "freebsd" { if runtime.GOOS == "freebsd" {
if runtime.GOARCH == "amd64" { if runtime.GOARCH == "amd64" {
execName = "talosctl-freebsd-amd64" execName = "talosctl-freebsd-amd64"
} else { } else {
execName = "talosctl-freebsd-arm64" execName = "talosctl-freebsd-arm64"
} }
} }
return filepath.Join(helper.CacheDir, execName) return filepath.Join(helper.CacheDir, execName)
} }
+1 -1
View File
@@ -4,7 +4,7 @@
package embed package embed
import ( import (
"embed" "embed"
) )
//go:embed freebsd_amd64 //go:embed freebsd_amd64
+1 -1
View File
@@ -4,7 +4,7 @@
package embed package embed
import ( import (
"embed" "embed"
) )
//go:embed darwin_arm64 //go:embed darwin_arm64
+1 -1
View File
@@ -4,7 +4,7 @@
package embed package embed
import ( import (
"embed" "embed"
) )
//go:embed linux_amd64 //go:embed linux_amd64
+1 -1
View File
@@ -4,7 +4,7 @@
package embed package embed
import ( import (
"embed" "embed"
) )
//go:embed linux_arm64 //go:embed linux_arm64
+1 -1
View File
@@ -4,7 +4,7 @@
package embed package embed
import ( import (
"embed" "embed"
) )
//go:embed windows_amd64/* //go:embed windows_amd64/*
+1 -1
View File
@@ -4,7 +4,7 @@
package embed package embed
import ( import (
"embed" "embed"
) )
//go:embed windows_arm64/* //go:embed windows_arm64/*
+1 -1
View File
@@ -4,7 +4,7 @@
package embed package embed
import ( import (
"embed" "embed"
) )
//go:embed darwin_amd64 //go:embed darwin_amd64
+1 -1
View File
@@ -4,7 +4,7 @@
package embed package embed
import ( import (
"embed" "embed"
) )
//go:embed freebsd_arm64 //go:embed freebsd_arm64
@@ -3,7 +3,3 @@ clusterconfig
patches/sopssecret.yaml patches/sopssecret.yaml
cluster/main/kubernetes/**/bootstrap-values.yaml.ct cluster/main/kubernetes/**/bootstrap-values.yaml.ct
*kubeconfig *kubeconfig
@@ -35,4 +35,4 @@ spec:
patchStrategicMerge: patchStrategicMerge:
metadata: metadata:
annotations: annotations:
extensions.talos.dev/schematic: "{{ schematic }}" extensions.talos.dev/schematic: "{{ schematic }}"
@@ -9,4 +9,4 @@ spec:
prune: true prune: true
sourceRef: sourceRef:
kind: GitRepository kind: GitRepository
name: cluster name: cluster
@@ -37,4 +37,4 @@ spec:
autoAssign: false autoAssign: false
avoidBuggyIPs: true avoidBuggyIPs: true
addresses: addresses:
- ${METALLB_RANGE} - ${METALLB_RANGE}
@@ -48,4 +48,4 @@ spec:
args: args:
- --nodes=$(NODE_IP) - --nodes=$(NODE_IP)
- upgrade-k8s - upgrade-k8s
- --to=$(SYSTEM_UPGRADE_PLAN_LATEST_VERSION) - --to=$(SYSTEM_UPGRADE_PLAN_LATEST_VERSION)
@@ -2,7 +2,7 @@
# yaml-language-server: $schema=https://json.schemastore.org/kustomization # yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
# - schematics.yaml # - schematics.yaml
- kubernetes.yaml - kubernetes.yaml
- talos.yaml - talos.yaml
@@ -49,4 +49,4 @@ spec:
- --image=factory.talos.dev/installer/$(SCHEMATIC):$(SYSTEM_UPGRADE_PLAN_LATEST_VERSION) - --image=factory.talos.dev/installer/$(SCHEMATIC):$(SYSTEM_UPGRADE_PLAN_LATEST_VERSION)
- --preserve=true - --preserve=true
- --wait=false - --wait=false
- --force - --force
@@ -59,4 +59,4 @@ patches:
patch: | patch: |
- op: replace - op: replace
path: /metadata/name path: /metadata/name
value: flux-view-flux-system value: flux-view-flux-system
@@ -4,4 +4,4 @@ metadata:
name: cluster-config name: cluster-config
namespace: flux-system namespace: flux-system
data: data:
REPLACEWITHENV REPLACEWITHENV
@@ -84,4 +84,4 @@ spec:
value: --oom-watch-interval=500ms value: --oom-watch-interval=500ms
target: target:
kind: Deployment kind: Deployment
name: helm-controller name: helm-controller
@@ -5,4 +5,4 @@ metadata:
name: flux-system name: flux-system
labels: labels:
pod-security.kubernetes.io/enforce: privileged pod-security.kubernetes.io/enforce: privileged
topolvm.io/webhook: ignore topolvm.io/webhook: ignore
@@ -7,4 +7,4 @@ data:
# renovate: datasource=docker depName=ghcr.io/siderolabs/installer # renovate: datasource=docker depName=ghcr.io/siderolabs/installer
TALOS_VERSION: v1.8.1 TALOS_VERSION: v1.8.1
# renovate: datasource=docker depName=ghcr.io/siderolabs/kubelet # renovate: datasource=docker depName=ghcr.io/siderolabs/kubelet
KUBERNETES_VERSION: v1.31.1 KUBERNETES_VERSION: v1.31.1
@@ -1,3 +1,3 @@
## DO NOT ALTER THIS FILE, CHANGE DO NOT PERSIST. Alter TalEnv.yaml instead. ## DO NOT ALTER THIS FILE, CHANGE DO NOT PERSIST. Alter TalEnv.yaml instead.
hubble: hubble:
enabled: false enabled: false
@@ -1,3 +1,3 @@
metrics: metrics:
main: main:
enabled: false enabled: false
@@ -31,4 +31,4 @@ spec:
core: core:
sources: ["pci", "system", "usb"] sources: ["pci", "system", "usb"]
prometheus: prometheus:
enable: true enable: true
@@ -192,4 +192,4 @@ spec:
- '[ServiceMonitor,{{ if .Values.admissionController.serviceMonitor.namespace }}{{ .Values.admissionController.serviceMonitor.namespace }}{{ else }}{{ template "kyverno.namespace" . }}{{ end }},{{ template "kyverno.cleanup-controller.name" . }}]' - '[ServiceMonitor,{{ if .Values.admissionController.serviceMonitor.namespace }}{{ .Values.admissionController.serviceMonitor.namespace }}{{ else }}{{ template "kyverno.namespace" . }}{{ end }},{{ template "kyverno.cleanup-controller.name" . }}]'
- '[ServiceMonitor,{{ if .Values.admissionController.serviceMonitor.namespace }}{{ .Values.admissionController.serviceMonitor.namespace }}{{ else }}{{ template "kyverno.namespace" . }}{{ end }},{{ template "kyverno.reports-controller.name" . }}]' - '[ServiceMonitor,{{ if .Values.admissionController.serviceMonitor.namespace }}{{ .Values.admissionController.serviceMonitor.namespace }}{{ else }}{{ template "kyverno.namespace" . }}{{ end }},{{ template "kyverno.reports-controller.name" . }}]'
- '[Secret,{{ include "kyverno.namespace" . }},{{ template "kyverno.admission-controller.serviceName" . }}.{{ template "kyverno.namespace" . }}.svc.*]' - '[Secret,{{ include "kyverno.namespace" . }},{{ template "kyverno.admission-controller.serviceName" . }}.{{ template "kyverno.namespace" . }}.svc.*]'
- '[Secret,{{ include "kyverno.namespace" . }},{{ template "kyverno.cleanup-controller.name" . }}.{{ template "kyverno.namespace" . }}.svc.*]' - '[Secret,{{ include "kyverno.namespace" . }},{{ template "kyverno.cleanup-controller.name" . }}.{{ template "kyverno.namespace" . }}.svc.*]'
@@ -24,7 +24,7 @@ spec:
crds: CreateReplace crds: CreateReplace
remediation: remediation:
retries: 3 retries: 3
values: values:
defaultSettings: defaultSettings:
# Increase to 3 for a multi-node cluster # Increase to 3 for a multi-node cluster
defaultReplicaCount: 1 defaultReplicaCount: 1
@@ -35,4 +35,4 @@ spec:
# Set to false to pick another CSI as default # Set to false to pick another CSI as default
defaultClass: true defaultClass: true
# Increase to 3 for a multi-node cluster # Increase to 3 for a multi-node cluster
defaultClassReplicaCount: 1 defaultClassReplicaCount: 1
@@ -4,4 +4,4 @@ metadata:
name: longhorn-system name: longhorn-system
labels: labels:
pod-security.kubernetes.io/enforce: privileged pod-security.kubernetes.io/enforce: privileged
topolvm.io/webhook: ignore topolvm.io/webhook: ignore
@@ -8,4 +8,4 @@ metadata:
driver: driver.longhorn.io driver: driver.longhorn.io
deletionPolicy: Delete deletionPolicy: Delete
parameters: parameters:
type: snap type: snap
@@ -23,4 +23,4 @@ spec:
retries: 3 retries: 3
values: values:
speaker: speaker:
ignoreExcludeLB: true ignoreExcludeLB: true
@@ -42,4 +42,4 @@ spec:
replicated: replicated:
# The Mayastor backend contains a duplicate of snapshot controller which will cause conflicts # The Mayastor backend contains a duplicate of snapshot controller which will cause conflicts
mayastor: mayastor:
enabled: false enabled: false
@@ -99,4 +99,4 @@ spec:
hostPath: /etc/ca-certificates hostPath: /etc/ca-certificates
hostPathType: DirectoryOrCreate hostPathType: DirectoryOrCreate
globalMounts: globalMounts:
- readOnly: true - readOnly: true
@@ -24,7 +24,7 @@ spec:
crds: CreateReplace crds: CreateReplace
remediation: remediation:
retries: 3 retries: 3
values: values:
lvmd: lvmd:
managed: false managed: false
env: env:
@@ -50,6 +50,6 @@ spec:
"topolvm.io/device-class": "thin" "topolvm.io/device-class": "thin"
node: node:
lvmdEmbedded: true lvmdEmbedded: true
controller: controller:
replicaCount: 1 replicaCount: 1
@@ -4,4 +4,4 @@ metadata:
name: topolvm-system name: topolvm-system
labels: labels:
pod-security.kubernetes.io/enforce: privileged pod-security.kubernetes.io/enforce: privileged
topolvm.io/webhook: ignore topolvm.io/webhook: ignore
@@ -6,4 +6,4 @@ metadata:
# annotations: # annotations:
# snapshot.storage.kubernetes.io/is-default-class: "false" # snapshot.storage.kubernetes.io/is-default-class: "false"
driver: topolvm.io driver: topolvm.io
deletionPolicy: Delete deletionPolicy: Delete
@@ -4,4 +4,4 @@ metadata:
name: volsync name: volsync
labels: labels:
pod-security.kubernetes.io/enforce: privileged pod-security.kubernetes.io/enforce: privileged
topolvm.io/webhook: ignore topolvm.io/webhook: ignore
@@ -48,4 +48,4 @@
allowedRoles: allowedRoles:
- os:admin - os:admin
allowedKubernetesNamespaces: allowedKubernetesNamespaces:
- system-upgrade - system-upgrade
@@ -3,4 +3,4 @@
value: value:
"disabled": false "disabled": false
"servers": "servers":
- "time.cloudflare.com" - "time.cloudflare.com"
@@ -37,4 +37,3 @@ REPLACEWITHTALENV
namespace: flux-system namespace: flux-system
stringData: stringData:
REPLACEWITHDEPLOYKEY REPLACEWITHDEPLOYKEY
@@ -3,4 +3,4 @@
value: value:
"disabled": false "disabled": false
"servers": "servers":
- "time.cloudflare.com" - "time.cloudflare.com"
@@ -7,4 +7,4 @@ clustertool.exe
clustertool clustertool
sopssecret.yaml sopssecret.yaml
sopssecret* sopssecret*
*sopssecret* *sopssecret*
@@ -12,4 +12,4 @@ creation_rules:
age: REPLACEME age: REPLACEME
- path_regex: talsecret.yaml - path_regex: talsecret.yaml
age: REPLACEME age: REPLACEME
## DO NOT REMOVE: Personal setting go under this line ## DO NOT REMOVE: Personal setting go under this line
+1 -1
View File
@@ -1 +1 @@
This is a kubernetes cluster Powered by TrueCharts ClusterTool This is a kubernetes cluster Powered by TrueCharts ClusterTool
@@ -2,4 +2,4 @@
# yaml-language-server: $schema=https://json.schemastore.org/kustomization # yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: [] resources: []
@@ -38,4 +38,4 @@ spec:
target: target:
group: kustomize.toolkit.fluxcd.io group: kustomize.toolkit.fluxcd.io
kind: Kustomization kind: Kustomization
labelSelector: substitution.flux.home.arpa/disabled notin (true) labelSelector: substitution.flux.home.arpa/disabled notin (true)
@@ -4,4 +4,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- this-repo.yaml - this-repo.yaml
- truecharts.yaml - truecharts.yaml
@@ -17,4 +17,4 @@ spec:
/* /*
# include flux directories # include flux directories
!/clusters !/clusters
!/repositories !/repositories
@@ -16,4 +16,4 @@ spec:
# exclude all # exclude all
/* /*
# include flux directories # include flux directories
!/repositories !/repositories
@@ -6,4 +6,4 @@ resources:
- ./git - ./git
- ./helm - ./helm
- ./oci - ./oci
- ./entries - ./entries
@@ -9,4 +9,4 @@ spec:
interval: 10m interval: 10m
url: oci://ghcr.io/fluxcd/flux-manifests url: oci://ghcr.io/fluxcd/flux-manifests
ref: ref:
tag: v2.4.0 tag: v2.4.0
@@ -3,4 +3,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- flux-manifests.yaml - flux-manifests.yaml
+279 -279
View File
@@ -5,36 +5,36 @@ go 1.23.0
toolchain go1.23.2 toolchain go1.23.2
require ( require (
filippo.io/age v1.2.0 filippo.io/age v1.2.0
github.com/Masterminds/semver/v3 v3.3.0 github.com/Masterminds/semver/v3 v3.3.0
github.com/beevik/ntp v1.4.3 github.com/beevik/ntp v1.4.3
github.com/budimanjojo/talhelper/v3 v3.0.7 github.com/budimanjojo/talhelper/v3 v3.0.7
github.com/fatih/color v1.17.0 github.com/fatih/color v1.17.0
github.com/getsops/sops/v3 v3.9.1 github.com/getsops/sops/v3 v3.9.1
github.com/go-git/go-git/v5 v5.12.0 github.com/go-git/go-git/v5 v5.12.0
github.com/go-logr/logr v1.4.2 github.com/go-logr/logr v1.4.2
github.com/go-logr/zapr v1.3.0 github.com/go-logr/zapr v1.3.0
github.com/go-playground/validator/v10 v10.22.1 github.com/go-playground/validator/v10 v10.22.1
github.com/invopop/jsonschema v0.12.0 github.com/invopop/jsonschema v0.12.0
github.com/joho/godotenv v1.5.1 github.com/joho/godotenv v1.5.1
github.com/knadh/koanf/parsers/yaml v0.1.0 github.com/knadh/koanf/parsers/yaml v0.1.0
github.com/knadh/koanf/providers/file v1.1.2 github.com/knadh/koanf/providers/file v1.1.2
github.com/knadh/koanf/v2 v2.1.1 github.com/knadh/koanf/v2 v2.1.1
github.com/leaanthony/debme v1.2.1 github.com/leaanthony/debme v1.2.1
github.com/rs/zerolog v1.33.0 github.com/rs/zerolog v1.33.0
github.com/siderolabs/talos/pkg/machinery v1.8.1 github.com/siderolabs/talos/pkg/machinery v1.8.1
github.com/spf13/cobra v1.8.1 github.com/spf13/cobra v1.8.1
go.uber.org/zap v1.27.0 go.uber.org/zap v1.27.0
golang.org/x/crypto v0.28.0 golang.org/x/crypto v0.28.0
gopkg.in/yaml.v3 v3.0.1 gopkg.in/yaml.v3 v3.0.1
helm.sh/helm/v3 v3.16.2 helm.sh/helm/v3 v3.16.2
k8s.io/api v0.31.1 k8s.io/api v0.31.1
k8s.io/apimachinery v0.31.1 k8s.io/apimachinery v0.31.1
k8s.io/client-go v0.31.1 k8s.io/client-go v0.31.1
sigs.k8s.io/controller-runtime v0.19.0 sigs.k8s.io/controller-runtime v0.19.0
sigs.k8s.io/kustomize/api v0.18.0 sigs.k8s.io/kustomize/api v0.18.0
sigs.k8s.io/kustomize/kyaml v0.18.1 sigs.k8s.io/kustomize/kyaml v0.18.1
sigs.k8s.io/yaml v1.4.0 sigs.k8s.io/yaml v1.4.0
) )
replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.16 replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.16
@@ -42,253 +42,253 @@ replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.16
replace go.mozilla.org/sops/v3 => github.com/getsops/sops/v3 v3.9.1 replace go.mozilla.org/sops/v3 => github.com/getsops/sops/v3 v3.9.1
require ( require (
cloud.google.com/go v0.115.1 // indirect cloud.google.com/go v0.115.1 // indirect
cloud.google.com/go/auth v0.9.7 // indirect cloud.google.com/go/auth v0.9.7 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
cloud.google.com/go/compute/metadata v0.5.2 // indirect cloud.google.com/go/compute/metadata v0.5.2 // indirect
cloud.google.com/go/iam v1.2.1 // indirect cloud.google.com/go/iam v1.2.1 // indirect
cloud.google.com/go/kms v1.20.0 // indirect cloud.google.com/go/kms v1.20.0 // indirect
cloud.google.com/go/longrunning v0.6.1 // indirect cloud.google.com/go/longrunning v0.6.1 // indirect
cloud.google.com/go/storage v1.43.0 // indirect cloud.google.com/go/storage v1.43.0 // indirect
dario.cat/mergo v1.0.1 // indirect dario.cat/mergo v1.0.1 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.1.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.1.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // 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/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
github.com/BurntSushi/toml v1.4.0 // indirect github.com/BurntSushi/toml v1.4.0 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.3.0 // indirect github.com/Masterminds/sprig/v3 v3.3.0 // indirect
github.com/Masterminds/squirrel v1.5.4 // indirect github.com/Masterminds/squirrel v1.5.4 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ProtonMail/go-crypto v1.1.0-beta.0-proton // indirect github.com/ProtonMail/go-crypto v1.1.0-beta.0-proton // indirect
github.com/a8m/envsubst v1.4.2 // indirect github.com/a8m/envsubst v1.4.2 // indirect
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aws/aws-sdk-go-v2 v1.31.0 // indirect github.com/aws/aws-sdk-go-v2 v1.31.0 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.5 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.5 // indirect
github.com/aws/aws-sdk-go-v2/config v1.27.39 // indirect github.com/aws/aws-sdk-go-v2/config v1.27.39 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.37 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.17.37 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.25 // indirect github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.25 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.18 // indirect github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.18 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.5 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.5 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.20 // indirect github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.20 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.18 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.18 // indirect
github.com/aws/aws-sdk-go-v2/service/kms v1.36.3 // indirect github.com/aws/aws-sdk-go-v2/service/kms v1.36.3 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.63.3 // indirect github.com/aws/aws-sdk-go-v2/service/s3 v1.63.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.23.3 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.23.3 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.3 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.31.3 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.31.3 // indirect
github.com/aws/smithy-go v1.21.0 // indirect github.com/aws/smithy-go v1.21.0 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect github.com/blang/semver v3.5.1+incompatible // indirect
github.com/blang/semver/v4 v4.0.0 // indirect github.com/blang/semver/v4 v4.0.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect github.com/buger/jsonparser v1.1.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chai2010/gettext-go v1.0.3 // indirect github.com/chai2010/gettext-go v1.0.3 // indirect
github.com/cloudflare/circl v1.4.0 // indirect github.com/cloudflare/circl v1.4.0 // indirect
github.com/containerd/containerd v1.7.20 // indirect github.com/containerd/containerd v1.7.20 // indirect
github.com/containerd/errdefs v0.1.0 // indirect github.com/containerd/errdefs v0.1.0 // indirect
github.com/containerd/go-cni v1.1.10 // indirect github.com/containerd/go-cni v1.1.10 // indirect
github.com/containerd/log v0.1.0 // indirect github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v0.2.1 // indirect github.com/containerd/platforms v0.2.1 // indirect
github.com/containernetworking/cni v1.2.3 // indirect github.com/containernetworking/cni v1.2.3 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
github.com/cyphar/filepath-securejoin v0.3.1 // indirect github.com/cyphar/filepath-securejoin v0.3.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/distribution/distribution/v3 v3.0.0-alpha.1 // indirect github.com/distribution/distribution/v3 v3.0.0-alpha.1 // indirect
github.com/distribution/reference v0.6.0 // indirect github.com/distribution/reference v0.6.0 // indirect
github.com/docker/cli v27.3.1+incompatible // indirect github.com/docker/cli v27.3.1+incompatible // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker v27.3.1+incompatible // indirect github.com/docker/docker v27.3.1+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.2 // indirect github.com/docker/docker-credential-helpers v0.8.2 // indirect
github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect github.com/docker/go-metrics v0.0.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emicklei/go-restful/v3 v3.12.0 // indirect github.com/emicklei/go-restful/v3 v3.12.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect
github.com/evanphx/json-patch v5.9.0+incompatible // indirect github.com/evanphx/json-patch v5.9.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/getsops/gopgagent v0.0.0-20240527072608-0c14999532fe // indirect github.com/getsops/gopgagent v0.0.0-20240527072608-0c14999532fe // indirect
github.com/ghodss/yaml v1.0.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-errors/errors v1.5.1 // indirect github.com/go-errors/errors v1.5.1 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-gorp/gorp/v3 v3.1.0 // indirect github.com/go-gorp/gorp/v3 v3.1.0 // indirect
github.com/go-jose/go-jose/v4 v4.0.4 // indirect github.com/go-jose/go-jose/v4 v4.0.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
github.com/gobwas/glob v0.2.3 // indirect github.com/gobwas/glob v0.2.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect github.com/golang/protobuf v1.5.4 // indirect
github.com/google/btree v1.1.2 // indirect github.com/google/btree v1.1.2 // indirect
github.com/google/cel-go v0.21.0 // indirect github.com/google/cel-go v0.21.0 // indirect
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect github.com/google/gofuzz v1.2.0 // indirect
github.com/google/s2a-go v0.1.8 // indirect github.com/google/s2a-go v0.1.8 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
github.com/googleapis/gax-go/v2 v2.13.0 // indirect github.com/googleapis/gax-go/v2 v2.13.0 // indirect
github.com/gookit/filter v1.2.1 // indirect github.com/gookit/filter v1.2.1 // indirect
github.com/gookit/goutil v0.6.15 // indirect github.com/gookit/goutil v0.6.15 // indirect
github.com/gookit/validate v1.5.2 // indirect github.com/gookit/validate v1.5.2 // indirect
github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/websocket v1.5.1 // indirect github.com/gorilla/websocket v1.5.1 // indirect
github.com/gosuri/uitable v0.0.4 // indirect github.com/gosuri/uitable v0.0.4 // indirect
github.com/goware/prefixer v0.0.0-20160118172347-395022866408 // indirect github.com/goware/prefixer v0.0.0-20160118172347-395022866408 // indirect
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.8 // indirect github.com/hashicorp/go-secure-stdlib/parseutil v0.1.8 // indirect
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
github.com/hashicorp/go-sockaddr v1.0.7 // indirect github.com/hashicorp/go-sockaddr v1.0.7 // indirect
github.com/hashicorp/hcl v1.0.1-vault-5 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect
github.com/hashicorp/vault/api v1.15.0 // indirect github.com/hashicorp/vault/api v1.15.0 // indirect
github.com/hexops/gotextdiff v1.0.3 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect
github.com/huandu/xstrings v1.5.0 // indirect github.com/huandu/xstrings v1.5.0 // indirect
github.com/imdario/mergo v1.0.0 // indirect github.com/imdario/mergo v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jmoiron/sqlx v1.4.0 // indirect github.com/jmoiron/sqlx v1.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect github.com/josharian/intern v1.0.0 // indirect
github.com/josharian/native v1.1.0 // indirect github.com/josharian/native v1.1.0 // indirect
github.com/jsimonetti/rtnetlink/v2 v2.0.2 // indirect github.com/jsimonetti/rtnetlink/v2 v2.0.2 // indirect
github.com/json-iterator/go v1.1.12 // indirect github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect github.com/klauspost/compress v1.17.9 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect github.com/leodido/go-urn v1.4.0 // indirect
github.com/lib/pq v1.10.9 // indirect github.com/lib/pq v1.10.9 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mdlayher/ethtool v0.1.0 // indirect github.com/mdlayher/ethtool v0.1.0 // indirect
github.com/mdlayher/genetlink v1.3.2 // indirect github.com/mdlayher/genetlink v1.3.2 // indirect
github.com/mdlayher/netlink v1.7.2 // indirect github.com/mdlayher/netlink v1.7.2 // indirect
github.com/mdlayher/socket v0.5.1 // indirect github.com/mdlayher/socket v0.5.1 // indirect
github.com/miekg/dns v1.1.59 // indirect github.com/miekg/dns v1.1.59 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/locker v1.0.1 // indirect github.com/moby/locker v1.0.1 // indirect
github.com/moby/spdystream v0.4.0 // indirect github.com/moby/spdystream v0.4.0 // indirect
github.com/moby/term v0.5.0 // indirect github.com/moby/term v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/opencontainers/runtime-spec v1.2.0 // indirect github.com/opencontainers/runtime-spec v1.2.0 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pkg/errors v0.9.1 // indirect github.com/pkg/errors v0.9.1 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/prometheus/client_golang v1.20.2 // indirect github.com/prometheus/client_golang v1.20.2 // indirect
github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect github.com/rivo/uniseg v0.4.7 // indirect
github.com/rubenv/sql-migrate v1.7.0 // indirect github.com/rubenv/sql-migrate v1.7.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/shopspring/decimal v1.4.0 // indirect github.com/shopspring/decimal v1.4.0 // indirect
github.com/siderolabs/crypto v0.4.4 // indirect github.com/siderolabs/crypto v0.4.4 // indirect
github.com/siderolabs/gen v0.5.0 // indirect github.com/siderolabs/gen v0.5.0 // indirect
github.com/siderolabs/go-blockdevice v0.4.7 // indirect github.com/siderolabs/go-blockdevice v0.4.7 // indirect
github.com/siderolabs/go-blockdevice/v2 v2.0.2 // indirect github.com/siderolabs/go-blockdevice/v2 v2.0.2 // indirect
github.com/siderolabs/go-pointer v1.0.0 // indirect github.com/siderolabs/go-pointer v1.0.0 // indirect
github.com/siderolabs/image-factory v0.5.0 // indirect github.com/siderolabs/image-factory v0.5.0 // indirect
github.com/siderolabs/net v0.4.0 // indirect github.com/siderolabs/net v0.4.0 // indirect
github.com/siderolabs/protoenc v0.2.1 // indirect github.com/siderolabs/protoenc v0.2.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect github.com/sirupsen/logrus v1.9.3 // indirect
github.com/skeema/knownhosts v1.2.2 // indirect github.com/skeema/knownhosts v1.2.2 // indirect
github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cast v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/pflag v1.0.5 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/urfave/cli v1.22.15 // indirect github.com/urfave/cli v1.22.15 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/x448/float16 v0.8.4 // indirect github.com/x448/float16 v0.8.4 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/xlab/treeprint v1.2.0 // indirect github.com/xlab/treeprint v1.2.0 // indirect
go.opencensus.io v0.24.0 // indirect go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 // indirect
go.opentelemetry.io/otel v1.30.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect
go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect
go.opentelemetry.io/otel/trace v1.30.0 // indirect go.opentelemetry.io/otel/trace v1.30.0 // indirect
go.uber.org/multierr v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/mod v0.21.0 // indirect golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.29.0 // indirect golang.org/x/net v0.29.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sync v0.8.0 // indirect golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.25.0 // indirect golang.org/x/term v0.25.0 // indirect
golang.org/x/text v0.19.0 // indirect golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.6.0 // indirect golang.org/x/time v0.6.0 // indirect
google.golang.org/api v0.199.0 // indirect google.golang.org/api v0.199.0 // indirect
google.golang.org/genproto v0.0.0-20240930140551-af27646dc61f // indirect google.golang.org/genproto v0.0.0-20240930140551-af27646dc61f // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240930140551-af27646dc61f // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240930140551-af27646dc61f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f // indirect
google.golang.org/grpc v1.67.1 // indirect google.golang.org/grpc v1.67.1 // indirect
google.golang.org/protobuf v1.34.2 // indirect google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apiextensions-apiserver v0.31.1 // indirect k8s.io/apiextensions-apiserver v0.31.1 // indirect
k8s.io/apiserver v0.31.1 // indirect k8s.io/apiserver v0.31.1 // indirect
k8s.io/cli-runtime v0.31.1 // indirect k8s.io/cli-runtime v0.31.1 // indirect
k8s.io/component-base v0.31.1 // indirect k8s.io/component-base v0.31.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240709000822-3c01b740850f // indirect k8s.io/kube-openapi v0.0.0-20240709000822-3c01b740850f // indirect
k8s.io/kubectl v0.31.1 // indirect k8s.io/kubectl v0.31.1 // indirect
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
oras.land/oras-go v1.2.5 // indirect oras.land/oras-go v1.2.5 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
) )
+64 -64
View File
@@ -1,81 +1,81 @@
package main package main
import ( import (
"os" "os"
"time" "time"
"github.com/rs/zerolog" "github.com/rs/zerolog"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/truecharts/public/clustertool/cmd" "github.com/truecharts/public/clustertool/cmd"
"github.com/truecharts/public/clustertool/embed" "github.com/truecharts/public/clustertool/embed"
"github.com/truecharts/public/clustertool/pkg/helper" "github.com/truecharts/public/clustertool/pkg/helper"
"go.uber.org/zap" "go.uber.org/zap"
"go.uber.org/zap/zapcore" "go.uber.org/zap/zapcore"
ctrllog "sigs.k8s.io/controller-runtime/pkg/log" ctrllog "sigs.k8s.io/controller-runtime/pkg/log"
ctrllogzap "sigs.k8s.io/controller-runtime/pkg/log/zap" ctrllogzap "sigs.k8s.io/controller-runtime/pkg/log/zap"
) )
func main() { func main() {
// Configure zerolog // Configure zerolog
zerolog.DurationFieldUnit = time.Second zerolog.DurationFieldUnit = time.Second
var zerologLevel zerolog.Level var zerologLevel zerolog.Level
var zapLevel zapcore.Level var zapLevel zapcore.Level
// Switch-case for setting the global log level // Switch-case for setting the global log level
switch os.Getenv("DEBUG") { switch os.Getenv("DEBUG") {
case "trace": case "trace":
zerologLevel = zerolog.TraceLevel zerologLevel = zerolog.TraceLevel
zapLevel = zapcore.DebugLevel // zap does not have a Trace level, use Debug as equivalent zapLevel = zapcore.DebugLevel // zap does not have a Trace level, use Debug as equivalent
case "debug": case "debug":
zerologLevel = zerolog.DebugLevel zerologLevel = zerolog.DebugLevel
zapLevel = zapcore.DebugLevel zapLevel = zapcore.DebugLevel
case "warn": case "warn":
zerologLevel = zerolog.WarnLevel zerologLevel = zerolog.WarnLevel
zapLevel = zapcore.WarnLevel zapLevel = zapcore.WarnLevel
case "error": case "error":
zerologLevel = zerolog.ErrorLevel zerologLevel = zerolog.ErrorLevel
zapLevel = zapcore.ErrorLevel zapLevel = zapcore.ErrorLevel
case "fatal": case "fatal":
zerologLevel = zerolog.FatalLevel zerologLevel = zerolog.FatalLevel
zapLevel = zapcore.FatalLevel zapLevel = zapcore.FatalLevel
case "panic": case "panic":
zerologLevel = zerolog.PanicLevel zerologLevel = zerolog.PanicLevel
zapLevel = zapcore.PanicLevel zapLevel = zapcore.PanicLevel
default: default:
zerologLevel = zerolog.InfoLevel zerologLevel = zerolog.InfoLevel
zapLevel = zapcore.InfoLevel zapLevel = zapcore.InfoLevel
} }
// Set zerolog level // Set zerolog level
zerolog.SetGlobalLevel(zerologLevel) zerolog.SetGlobalLevel(zerologLevel)
log.Logger = log.Output(zerolog.ConsoleWriter{ log.Logger = log.Output(zerolog.ConsoleWriter{
Out: os.Stdout, Out: os.Stdout,
TimeFormat: time.RFC3339, TimeFormat: time.RFC3339,
NoColor: true, NoColor: true,
}) })
// Configure zap logger // Configure zap logger
zapConfig := zap.NewProductionConfig() zapConfig := zap.NewProductionConfig()
zapConfig.Level = zap.NewAtomicLevelAt(zapLevel) zapConfig.Level = zap.NewAtomicLevelAt(zapLevel)
zapLogger, err := zapConfig.Build() zapLogger, err := zapConfig.Build()
if err != nil { if err != nil {
panic(err) panic(err)
} }
defer zapLogger.Sync() defer zapLogger.Sync()
// Set controller-runtime logger to use zap // Set controller-runtime logger to use zap
ctrlLogger := ctrllogzap.New(ctrllogzap.UseDevMode(true), ctrllogzap.Level(zapLevel)) ctrlLogger := ctrllogzap.New(ctrllogzap.UseDevMode(true), ctrllogzap.Level(zapLevel))
ctrllog.SetLogger(ctrlLogger) ctrllog.SetLogger(ctrlLogger)
embed.AllToCache() embed.AllToCache()
helper.CheckSystemTime() helper.CheckSystemTime()
helper.CheckReqDomains() helper.CheckReqDomains()
err = cmd.Execute() err = cmd.Execute()
if err != nil { if err != nil {
log.Fatal().Err(err).Msg("Failed to execute command") log.Fatal().Err(err).Msg("Failed to execute command")
} }
} }
+2 -2
View File
@@ -23,7 +23,7 @@ done
for os in "${!os_targets[@]}"; do for os in "${!os_targets[@]}"; do
for arch in "${architectures[@]}"; do for arch in "${architectures[@]}"; do
echo "Building precommit for $os/$arch" echo "Building precommit for $os/$arch"
# Determine output file name and extension # Determine output file name and extension
output="./embed/${os}_${arch}/precommit" output="./embed/${os}_${arch}/precommit"
mkdir "./clustertool/embed/${os}_${arch}/" || echo "mkdir failed or not needed" mkdir "./clustertool/embed/${os}_${arch}/" || echo "mkdir failed or not needed"
@@ -37,4 +37,4 @@ for os in "${!os_targets[@]}"; do
ls -l "./embed/${os}_${arch}/" || echo "ls failed" ls -l "./embed/${os}_${arch}/" || echo "ls failed"
cd - cd -
done done
done done
+7 -7
View File
@@ -1,15 +1,15 @@
package main package main
import ( import (
"os" "os"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/truecharts/public/clustertool/pkg/sops" "github.com/truecharts/public/clustertool/pkg/sops"
) )
func main() { func main() {
if err := sops.CheckFilesAndReportEncryption(true, true); err != nil { if err := sops.CheckFilesAndReportEncryption(true, true); err != nil {
log.Info().Msgf("Error checking files: %v\n", err) log.Info().Msgf("Error checking files: %v\n", err)
os.Exit(1) os.Exit(1)
} }
} }
@@ -1,60 +1,60 @@
package changelog package changelog
import ( import (
"fmt" "fmt"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
"sync" "sync"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
) )
type ActiveChart struct { type ActiveChart struct {
Name string Name string
Train string Train string
} }
type ActiveCharts struct { type ActiveCharts struct {
items map[string]ActiveChart items map[string]ActiveChart
mu *sync.RWMutex mu *sync.RWMutex
} }
func (a *ActiveCharts) isActiveChart(chartName string) bool { func (a *ActiveCharts) isActiveChart(chartName string) bool {
a.mu.RLock() a.mu.RLock()
defer a.mu.RUnlock() defer a.mu.RUnlock()
_, ok := a.items[chartName] _, ok := a.items[chartName]
return ok return ok
} }
func (a *ActiveCharts) getActiveChartsWalker(path string, entry os.DirEntry, err error) error { func (a *ActiveCharts) getActiveChartsWalker(path string, entry os.DirEntry, err error) error {
if err != nil { if err != nil {
return err return err
} }
if entry.Name() != "Chart.yaml" { if entry.Name() != "Chart.yaml" {
return nil return nil
} }
// path = charts/<train>/<chart>/Chart.yaml // path = charts/<train>/<chart>/Chart.yaml
segLen := len(strings.Split(path, "/")) segLen := len(strings.Split(path, "/"))
if segLen < 3 { if segLen < 3 {
return fmt.Errorf("path (%s) is not valid. expected at least charts/<train>/<chart>/Chart.yaml", path) return fmt.Errorf("path (%s) is not valid. expected at least charts/<train>/<chart>/Chart.yaml", path)
} }
// chart = charts/<train>/<chart>/ // chart = charts/<train>/<chart>/
chart, _ := filepath.Split(path) chart, _ := filepath.Split(path)
// chart = charts/<train>/<chart> // chart = charts/<train>/<chart>
chart = strings.TrimSuffix(chart, "/") chart = strings.TrimSuffix(chart, "/")
// train = charts/<train> // train = charts/<train>
train := filepath.Dir(chart) train := filepath.Dir(chart)
// train = <train> // train = <train>
train = filepath.Base(train) train = filepath.Base(train)
// chartName = <chart> // chartName = <chart>
chartName := filepath.Base(chart) chartName := filepath.Base(chart)
a.mu.Lock() a.mu.Lock()
if _, ok := a.items[chartName]; !ok { if _, ok := a.items[chartName]; !ok {
a.items[chartName] = ActiveChart{Name: chartName, Train: train} a.items[chartName] = ActiveChart{Name: chartName, Train: train}
} else { } else {
log.Error().Msgf("chart [%s] already exists in activeCharts", chartName) log.Error().Msgf("chart [%s] already exists in activeCharts", chartName)
} }
a.mu.Unlock() a.mu.Unlock()
return nil return nil
} }
+136 -136
View File
@@ -1,187 +1,187 @@
package changelog package changelog
import ( import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"os" "os"
"sort" "sort"
"sync" "sync"
"time" "time"
"github.com/Masterminds/semver/v3" "github.com/Masterminds/semver/v3"
"github.com/go-git/go-git/v5/plumbing/object" "github.com/go-git/go-git/v5/plumbing/object"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
) )
type ChangedData struct { type ChangedData struct {
mu *sync.RWMutex `json:"-"` mu *sync.RWMutex `json:"-"`
LastCommit string `json:"last_commit"` LastCommit string `json:"last_commit"`
Charts map[string]*Chart `json:"charts"` Charts map[string]*Chart `json:"charts"`
} }
type Chart struct { type Chart struct {
Versions map[string]*Version `json:"versions"` Versions map[string]*Version `json:"versions"`
SortedVersions []string `json:"-"` // Used only for rendering SortedVersions []string `json:"-"` // Used only for rendering
Name string `json:"-"` // Used only for rendering Name string `json:"-"` // Used only for rendering
Train string `json:"-"` // Used only for rendering Train string `json:"-"` // Used only for rendering
} }
func (c *Chart) SortVersions(reverse bool) ([]*semver.Version, error) { func (c *Chart) SortVersions(reverse bool) ([]*semver.Version, error) {
chartVersions := []*semver.Version{} chartVersions := []*semver.Version{}
for key := range c.Versions { for key := range c.Versions {
semVer, err := semver.NewVersion(key) semVer, err := semver.NewVersion(key)
if err != nil { if err != nil {
return nil, err return nil, err
} }
chartVersions = append(chartVersions, semVer) chartVersions = append(chartVersions, semVer)
} }
// Sort the versions from oldest to newest // Sort the versions from oldest to newest
sort.Slice(chartVersions, func(i, j int) bool { sort.Slice(chartVersions, func(i, j int) bool {
if reverse { if reverse {
return chartVersions[i].GreaterThan(chartVersions[j]) return chartVersions[i].GreaterThan(chartVersions[j])
} }
return chartVersions[i].LessThan(chartVersions[j]) return chartVersions[i].LessThan(chartVersions[j])
}) })
for _, version := range chartVersions { for _, version := range chartVersions {
c.SortedVersions = append(c.SortedVersions, version.String()) c.SortedVersions = append(c.SortedVersions, version.String())
} }
return chartVersions, nil return chartVersions, nil
} }
func (c *ChangedData) AddOrUpdateChart(chart string, version string, train string, commit *object.Commit) { func (c *ChangedData) AddOrUpdateChart(chart string, version string, train string, commit *object.Commit) {
if c.Charts == nil { if c.Charts == nil {
c.Charts = make(map[string]*Chart) c.Charts = make(map[string]*Chart)
} }
_, exists := c.Charts[chart] _, exists := c.Charts[chart]
if !exists { if !exists {
c.Charts[chart] = &Chart{} c.Charts[chart] = &Chart{}
} }
c.Charts[chart].AddVersion(version, train) c.Charts[chart].AddVersion(version, train)
c.Charts[chart].Versions[version].AddCommit(commit) c.Charts[chart].Versions[version].AddCommit(commit)
} }
func (c *Chart) AddVersion(version string, train string) { func (c *Chart) AddVersion(version string, train string) {
if c.Versions == nil { if c.Versions == nil {
c.Versions = make(map[string]*Version) c.Versions = make(map[string]*Version)
} }
_, exists := c.Versions[version] _, exists := c.Versions[version]
if exists { if exists {
return return
} }
c.Versions[version] = &Version{ c.Versions[version] = &Version{
Version: version, Version: version,
Train: train, Train: train,
Commits: make(map[string]*Commit), Commits: make(map[string]*Commit),
} }
} }
type Version struct { type Version struct {
Version string `json:"version"` Version string `json:"version"`
Train string `json:"train"` Train string `json:"train"`
Commits map[string]*Commit `json:"commits"` Commits map[string]*Commit `json:"commits"`
SortedCommits []*Commit `json:"-"` // Used only for rendering SortedCommits []*Commit `json:"-"` // Used only for rendering
} }
func (v *Version) AddCommit(commit *object.Commit) { func (v *Version) AddCommit(commit *object.Commit) {
if v.Commits == nil { if v.Commits == nil {
v.Commits = make(map[string]*Commit) v.Commits = make(map[string]*Commit)
} }
_, exists := v.Commits[commit.Hash.String()] _, exists := v.Commits[commit.Hash.String()]
if exists { if exists {
return return
} }
v.Commits[commit.Hash.String()] = &Commit{ v.Commits[commit.Hash.String()] = &Commit{
CommitHash: commit.Hash.String(), CommitHash: commit.Hash.String(),
ParentHash: commit.ParentHashes[0].String(), ParentHash: commit.ParentHashes[0].String(),
Author: Author{Name: commit.Author.Name, Date: commit.Author.When.Format(dateFormat)}, Author: Author{Name: commit.Author.Name, Date: commit.Author.When.Format(dateFormat)},
Message: getCommitMessage(commit), Message: getCommitMessage(commit),
Kind: getCommitKind(commit), Kind: getCommitKind(commit),
} }
} }
func (v *Version) SortCommits(reverse bool) ([]*Commit, error) { func (v *Version) SortCommits(reverse bool) ([]*Commit, error) {
commits := []*Commit{} commits := []*Commit{}
for _, commit := range v.Commits { for _, commit := range v.Commits {
commits = append(commits, commit) commits = append(commits, commit)
} }
hasErr := false hasErr := false
sort.Slice(commits, func(i, j int) bool { sort.Slice(commits, func(i, j int) bool {
// While we could store the time.Time in the Author struct, // While we could store the time.Time in the Author struct,
// it was giving mixed results as the timezones were different. // it was giving mixed results as the timezones were different.
// The dateFormat we use does not contain timezone, so it sorts better. // The dateFormat we use does not contain timezone, so it sorts better.
iDate, err := time.Parse(dateFormat, commits[i].Author.Date) iDate, err := time.Parse(dateFormat, commits[i].Author.Date)
if err != nil { if err != nil {
log.Fatal().Err(err).Msgf("Failed to parse date [%s]", commits[i].Author.Date) log.Fatal().Err(err).Msgf("Failed to parse date [%s]", commits[i].Author.Date)
return false return false
} }
jDate, err := time.Parse(dateFormat, commits[j].Author.Date) jDate, err := time.Parse(dateFormat, commits[j].Author.Date)
if err != nil { if err != nil {
log.Fatal().Err(err).Msgf("Failed to parse date [%s]", commits[j].Author.Date) log.Fatal().Err(err).Msgf("Failed to parse date [%s]", commits[j].Author.Date)
return false return false
} }
if reverse { if reverse {
return iDate.After(jDate) return iDate.After(jDate)
} }
return iDate.Before(jDate) return iDate.Before(jDate)
}) })
if hasErr { if hasErr {
return nil, errors.New("failed to sort commits") return nil, errors.New("failed to sort commits")
} }
v.SortedCommits = commits v.SortedCommits = commits
return commits, nil return commits, nil
} }
type Commit struct { type Commit struct {
CommitHash string `json:"commit_hash"` CommitHash string `json:"commit_hash"`
ParentHash string `json:"parent_hash"` ParentHash string `json:"parent_hash"`
Author Author `json:"author"` Author Author `json:"author"`
Kind string `json:"kind"` Kind string `json:"kind"`
Message string `json:"message"` Message string `json:"message"`
} }
type Author struct { type Author struct {
Name string `json:"name"` Name string `json:"name"`
Date string `json:"date"` Date string `json:"date"`
} }
func (c *ChangedData) LoadFromFile(path string) error { func (c *ChangedData) LoadFromFile(path string) error {
fileInfo, err := os.Stat(path) fileInfo, err := os.Stat(path)
if err != nil { if err != nil {
if os.IsNotExist(err) { if os.IsNotExist(err) {
return nil return nil
} }
return err return err
} }
if fileInfo.IsDir() { if fileInfo.IsDir() {
return fmt.Errorf("path is a directory") return fmt.Errorf("path is a directory")
} }
bytes, err := os.ReadFile(path) bytes, err := os.ReadFile(path)
if err != nil { if err != nil {
return err return err
} }
err = json.Unmarshal(bytes, &c) err = json.Unmarshal(bytes, &c)
if err != nil { if err != nil {
return err return err
} }
return nil return nil
} }
func (c *ChangedData) WriteToFile(path string) error { func (c *ChangedData) WriteToFile(path string) error {
data, err := json.MarshalIndent(c, "", " ") data, err := json.MarshalIndent(c, "", " ")
if err != nil { if err != nil {
return err return err
} }
log.Info().Msgf("Writing changed data to [%s]", path) log.Info().Msgf("Writing changed data to [%s]", path)
return os.WriteFile(path, data, 0644) return os.WriteFile(path, data, 0644)
} }

Some files were not shown because too many files have changed in this diff Show More