From 4f13196df4f199d6d903b789c9e7cf4ba2b7ad6f Mon Sep 17 00:00:00 2001 From: gismo2004 <2325636+gismo2004@users.noreply.github.com> Date: Fri, 15 Nov 2024 22:58:53 +0100 Subject: [PATCH] fix(clustertool) fix shamir_threshold check (#29302) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** current implementation just checks the first line of the file as it exits in the “else” ⚒️ Fixes # **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [x] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** Local go test file. **📃 Notes:** **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning - [ ] I made sure the title starts with `feat(chart-name):`, `fix(chart-name):` or `chore(chart-name):` **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --- clustertool/pkg/sops/checkencrypt.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/clustertool/pkg/sops/checkencrypt.go b/clustertool/pkg/sops/checkencrypt.go index 0a65d6b8472f..dc8a28e865e4 100644 --- a/clustertool/pkg/sops/checkencrypt.go +++ b/clustertool/pkg/sops/checkencrypt.go @@ -207,9 +207,6 @@ func shamCheck() { if strings.Contains(scanner.Text(), "shamir_threshold") { log.Debug().Msg("clusterenv contains shamir_threshold, continuing...") return - } else { - log.Error().Msg("clusterenv is NOT encrypted and encryption-check failed!\n DO NOT UPLOAD!") - os.Exit(1) } } @@ -217,7 +214,8 @@ func shamCheck() { log.Error().Err(err).Msgf("error reading file: %w", err) } - return + log.Error().Msg("clusterenv is NOT encrypted and encryption-check failed!\n DO NOT UPLOAD!") + os.Exit(1) } // filesToCheck returns a list of files to check for encryption based on the logic in .sops.yaml.