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

Label selectors not implemented correctly (wrong "arg_separator") - e.g. in HasPods::getPods() #441

Open
dev-maniac opened this issue Dec 27, 2024 · 0 comments

Comments

@dev-maniac
Copy link

Label selector is just built via normal http_build_query() without providing more arguments than desired label selectors:

$labelSelector = urldecode(http_build_query(
    $this->podsSelector()
));

This builds the selector like a normal query string - e.g. label1=value1&label2=value2 - but this results in api request /api/v1/namespaces/my-namespace/pods?labelSelector=label1=value1&label2=value2&pretty=1 which will only use first label, since labelSelector ends after value1 (due to & located IN label selector).

Entries of labelSelector need to be separated via comma (,). This can be achieved by providing third argument ($arg_separator) to http_build_query():

$labelSelector = urldecode(http_build_query(
    $this->podsSelector(),
    "",
    ","
));
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

No branches or pull requests

1 participant