kubernetes-sigs / cri-tools

CLI and validation tools for Kubelet Container Runtime Interface (CRI) .
Apache License 2.0
1.63k stars 445 forks source link

Fix parent dir retrieval lint #1495

Closed saschagrunert closed 1 month ago

saschagrunert commented 1 month ago

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

We now use filepath.Dir to make the gocritic linter happy:

Error: pkg/validate/security_context_linux.go:1582:37: filepathJoin: "../" contains a path separator (gocritic)
    return filepath.Join(cfg.StateDir, "../")

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

cc @rata

Does this PR introduce a user-facing change?

None
kwilczynski commented 1 month ago

/approve /lgtm

k8s-ci-robot commented 1 month ago

@rata: changing LGTM is restricted to collaborators

In response to [this](https://github.com/kubernetes-sigs/cri-tools/pull/1495#pullrequestreview-2179702123): >LGTM, thanks! > >I guess the linter was added after I wrote that? I didn't see it :) Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
k8s-ci-robot commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kwilczynski, rata, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/cri-tools/blob/master/OWNERS)~~ [saschagrunert] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
saschagrunert commented 1 month ago

LGTM, thanks!

I guess the linter was added after I wrote that? I didn't see it :)

Everything merged all together, so it was not possible to catch that lint in your PR :)