Skip to content

Commit

Permalink
fix(clustertool) fix shamir_threshold check (#29302)
Browse files Browse the repository at this point in the history
**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._
  • Loading branch information
gismo2004 authored Nov 15, 2024
1 parent a26fe9b commit 4f13196
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions clustertool/pkg/sops/checkencrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,15 @@ 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)
}
}

if err := scanner.Err(); err != nil {
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.
Expand Down

0 comments on commit 4f13196

Please sign in to comment.