Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strict unmarshal for plugin files #3046

Merged
merged 1 commit into from
Jan 3, 2025
Merged

Conversation

bjw-s
Copy link
Contributor

@bjw-s bjw-s commented Dec 29, 2024

This PR aims to improve the behaviour introduced in #2770.

The regular Unmarshal function does not result in an err when trying to unmarshal a yaml file that contains a plugins key into a Plugin var. The UnmarshalStrict function will, since it finds the undefined plugins key, causing the next loop to actually trigger.

I have also taken the liberty to make it look for plugins in the XDG_DATA_HOME and XDG_CONFIG_HOME folders. This is especially useful since XDG_DATA_HOME is not included in the XDG_DATA_DIRS by default (as per https://specifications.freedesktop.org/basedir-spec/latest/#variables). This allows users to define per-user plugins in addition to the ones in /usr/local/share/:/usr/share/.

Copy link
Owner

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bjw-s Thank you for this update!

@derailed derailed merged commit 356a09d into derailed:master Jan 3, 2025
2 checks passed
ventsislav-georgiev pushed a commit to ventsislav-georgiev/k9s that referenced this pull request Feb 9, 2025
Add test; refactor code & fix one-by-off errors

Remove nested conditionals

Decrease complexity of Render method

Fix linting errors

Fix unit tests

fix(argo-rollouts plugin): resolve improper piping in watch command (derailed#3009)

The `-w` or `--watch` flag is designed for continuous monitoring
and should not pipe to `less` to avoid unnecessary screen rolling.

chore(deps): bump github.com/anchore/grype from 0.84.0 to 0.85.0 (derailed#3008)

Bumps [github.com/anchore/grype](https://github.com/anchore/grype) from 0.84.0 to 0.85.0.
- [Release notes](https://github.com/anchore/grype/releases)
- [Changelog](https://github.com/anchore/grype/blob/main/.goreleaser.yaml)
- [Commits](anchore/grype@v0.84.0...v0.85.0)

---
updated-dependencies:
- dependency-name: github.com/anchore/grype
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

chore(deps): bump k8s.io/kubectl from 0.31.1 to 0.31.3 (derailed#3007)

Bumps [k8s.io/kubectl](https://github.com/kubernetes/kubectl) from 0.31.1 to 0.31.3.
- [Commits](kubernetes/kubectl@v0.31.1...v0.31.3)

---
updated-dependencies:
- dependency-name: k8s.io/kubectl
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

chore(deps): bump helm.sh/helm/v3 from 3.16.2 to 3.16.3 (derailed#3006)

Bumps [helm.sh/helm/v3](https://github.com/helm/helm) from 3.16.2 to 3.16.3.
- [Release notes](https://github.com/helm/helm/releases)
- [Commits](helm/helm@v3.16.2...v3.16.3)

---
updated-dependencies:
- dependency-name: helm.sh/helm/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Fix typos (derailed#3026)

Strict unmarshal for plugin files (derailed#3046)

feat: add helm diff plugin (derailed#3017)

* feat: add helm diff plugin

* feat: Add helm-diff to plugin readme and sort items alphabetically

* chore: Adjust plugin README format

Fix K9S_EDITOR (derailed#3043)

chore(deps): bump actions/setup-go from 5.1.0 to 5.2.0 (derailed#3034)

Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@v5.1.0...v5.2.0)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

fix check e != nil but return a nil value error err (derailed#3038)

the err has been checked in line 199

chore(deps): bump github.com/go-git/go-git/v5 from 5.12.0 to 5.13.0 (derailed#3056)

Bumps [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) from 5.12.0 to 5.13.0.
- [Release notes](https://github.com/go-git/go-git/releases)
- [Commits](go-git/go-git@v5.12.0...v5.13.0)

---
updated-dependencies:
- dependency-name: github.com/go-git/go-git/v5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

chore(deps): bump golang.org/x/net from 0.31.0 to 0.33.0 (derailed#3055)

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.31.0 to 0.33.0.
- [Commits](golang/net@v0.31.0...v0.33.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Fix Flux trace plugin command (derailed#3041)

chore(deps): bump golang.org/x/crypto from 0.29.0 to 0.31.0 (derailed#3029)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.29.0 to 0.31.0.
- [Commits](golang/crypto@v0.29.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

chore(deps): bump alpine from 3.20.3 to 3.21.0 (derailed#3020)

Bumps alpine from 3.20.3 to 3.21.0.

---
updated-dependencies:
- dependency-name: alpine
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

chore(deps): bump github.com/stretchr/testify from 1.9.0 to 1.10.0 (derailed#3024)

Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](stretchr/testify@v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Add proxy configuration at the context level (derailed#2675)

Dialog boxes use dialog style (derailed#2150)

Fix lint build (derailed#3066)

* clean up

* fix bug computing resource limits

* update rs rendering to match kubectl

* display ctx view if all hell fails

* clean ups and refactors

* fix linter issues

Fixed trimming of favorite namespaces in Config (derailed#3065)

Co-authored-by: Fernand Galiana <fernand.galiana@gmail.com>

feat: use kubectl events for plugin `watch-events` (derailed#3062)

chore(deps): bump k8s.io/client-go from 0.31.3 to 0.32.0 (derailed#3058)

Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.31.3 to 0.32.0.
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](kubernetes/client-go@v0.31.3...v0.32.0)

---
updated-dependencies:
- dependency-name: k8s.io/client-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

fix: coloring of rose-pine for values of log options (derailed#3018)

chore(deps): bump k8s.io/cli-runtime from 0.31.3 to 0.32.1 (derailed#3067)

Bumps [k8s.io/cli-runtime](https://github.com/kubernetes/cli-runtime) from 0.31.3 to 0.32.1.
- [Commits](kubernetes/cli-runtime@v0.31.3...v0.32.1)

---
updated-dependencies:
- dependency-name: k8s.io/cli-runtime
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

chore(deps): bump golangci/golangci-lint-action from 6.1.1 to 6.2.0 (derailed#3072)

Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.1.1 to 6.2.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](golangci/golangci-lint-action@v6.1.1...v6.2.0)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

chore(deps): bump helm.sh/helm/v3 from 3.16.3 to 3.17.0 (derailed#3071)

Bumps [helm.sh/helm/v3](https://github.com/helm/helm) from 3.16.3 to 3.17.0.
- [Release notes](https://github.com/helm/helm/releases)
- [Commits](helm/helm@v3.16.3...v3.17.0)

---
updated-dependencies:
- dependency-name: helm.sh/helm/v3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

chore(deps): bump github.com/mattn/go-colorable from 0.1.13 to 0.1.14 (derailed#3070)

Bumps [github.com/mattn/go-colorable](https://github.com/mattn/go-colorable) from 0.1.13 to 0.1.14.
- [Commits](mattn/go-colorable@v0.1.13...v0.1.14)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-colorable
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

chore(deps): bump golang from 1.23.3-alpine3.20 to 1.23.5-alpine3.20 (derailed#3068)

Bumps golang from 1.23.3-alpine3.20 to 1.23.5-alpine3.20.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

chore(deps): bump alpine from 3.21.0 to 3.21.2 (derailed#3069)

Bumps alpine from 3.21.0 to 3.21.2.

---
updated-dependencies:
- dependency-name: alpine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants