fix(clustertool) fix shamir_threshold check (#29302)

**Description**
current implementation just checks the first line of the file as it
exits in the “else”

⚒️ Fixes  # <!--(issue)-->

**⚙️ 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:**
<!-- Please enter any other relevant information here -->

**✔️ 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._
This commit is contained in:
gismo2004
2024-11-15 22:58:53 +01:00
committed by GitHub
parent a26fe9b1ef
commit 4f13196df4
+2 -4
View File
@@ -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.