Skip to content

Conversation

koba1t
Copy link
Member

@koba1t koba1t commented Jul 11, 2025

Remove dependency on shlex package by implementing functionality for shlex.Split()
ref: kubernetes/kubernetes#132593 (comment)

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 11, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: koba1t

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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested a review from ncapps July 11, 2025 19:09
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 11, 2025
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 11, 2025
@koba1t koba1t force-pushed the chore/drop_shlex_dependency branch 3 times, most recently from d2e62c5 to 95c954b Compare July 11, 2025 21:38
@koba1t koba1t force-pushed the chore/drop_shlex_dependency branch from 95c954b to 042a2cf Compare July 11, 2025 22:14
@k8s-ci-robot
Copy link
Contributor

This PR has multiple commits, and the default merge method is: merge.
You can request commits to be squashed using the label: tide/merge-method-squash

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@koba1t koba1t marked this pull request as ready for review July 13, 2025 18:54
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 13, 2025
Copy link
Member

@stormqueen1990 stormqueen1990 left a comment

Choose a reason for hiding this comment

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

Hi there, @koba1t! This change looks good to me in essence, I just have a suggestion regarding documentation and a question on the test cases.

Comment on lines 32 to 36
case (r == '\'' || r == '"') && quote == 0:
quote = r
case r == quote:
quote = 0
case r == '#' && quote == 0:
Copy link
Member

Choose a reason for hiding this comment

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

Could we use a constant for the indication that a quote was finished? It wasn't immediately clear to me why the value of quote here was 0 to mean "no quote open".

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good opinion.
I added a noQuote const value to check.
3866a30

Comment on lines +167 to +180
if tc.wantErr {
if err == nil {
t.Errorf("FAIL: Expected error but got none, Expected: %q\n", tc.expected)
}
return
}

if assert.NoError(t, err, "FAIL: Unexpected error %q for input %q", err, tc.input) {
// check if the result matches the expected output
assert.Equal(t, tc.expected, result,
"FAIL: Result mismatch,Input %q, Expected %q, Got: %q\n",
tc.input, tc.expected, result,
)
}
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if we want require.Error/require.NoError in this loop instead of just assert. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

The difference between require and assert functions in whether execution continues when a test fails—in this test function, specifying either should produce identical behavior. This is because both assert variants cause the t.Run() function to terminate immediately upon failure.

https://pkg.go.dev/github.com/stretchr/testify/require

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense. Let's keep as-is.

Copy link
Member

@stormqueen1990 stormqueen1990 left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 20, 2025
@k8s-ci-robot k8s-ci-robot merged commit 87f462a into kubernetes-sigs:master Jul 20, 2025
11 checks passed
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jul 28, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [kubernetes-sigs/kustomize](https://github.com/kubernetes-sigs/kustomize) | patch | `v5.7.0` -> `v5.7.1` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>kubernetes-sigs/kustomize (kubernetes-sigs/kustomize)</summary>

### [`v5.7.1`](https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize/v5.7.1)

[Compare Source](kubernetes-sigs/kustomize@kustomize/v5.7.0...kustomize/v5.7.1)

This release introduces code to replace the shlex library used for parsing arguments in the exec plugin.
If any existing manifests become corrupted, please file an issue. discussion: https://github.com/kubernetes/kubernetes/pull/132593#discussion\_r2178116543

#### Dependencies

[#&#8203;5943](kubernetes-sigs/kustomize#5943): drop shlex dependency

#### Chore

[#&#8203;5948](kubernetes-sigs/kustomize#5948): Update kyaml to v0.20.1
[#&#8203;5949](kubernetes-sigs/kustomize#5949): Update cmd/config to v0.20.1
[#&#8203;5950](kubernetes-sigs/kustomize#5950): Update api to v0.20.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC42Mi4xIiwidXBkYXRlZEluVmVyIjoiNDAuNjIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants