Difference between revisions of "Export POD NAME"
Jump to navigation
Jump to search
Tags: Mobile web edit, Mobile edit |
Tags: Mobile web edit, Mobile edit |
||
Line 1: | Line 1: | ||
{{lc}} | {{lc}} | ||
+ | |||
+ | |||
+ | |||
+ | == Example with errors: Unable to find "/v1, Resource=pods" that match [[label selector]] == | ||
<pre> | <pre> | ||
export POD_NAME=$(kubectl get pods -n default -l "app.kubernetes.io/name=kubernetes- dashboard,app.kubernetes.io/instance=my-release" -o jsonpath="{.items[0].metadata.name}") | export POD_NAME=$(kubectl get pods -n default -l "app.kubernetes.io/name=kubernetes- dashboard,app.kubernetes.io/instance=my-release" -o jsonpath="{.items[0].metadata.name}") |
Revision as of 18:58, 11 June 2022
Example with errors: Unable to find "/v1, Resource=pods" that match label selector
export POD_NAME=$(kubectl get pods -n default -l "app.kubernetes.io/name=kubernetes- dashboard,app.kubernetes.io/instance=my-release" -o jsonpath="{.items[0].metadata.name}") Error from server (BadRequest): Unable to find "/v1, Resource=pods" that match label selector "app.kubernetes.io/name=kubernetes- dashboard,app.kubernetes.io/instance=my-release", field selector "": unable to parse requirement: values[0][app.kubernetes.io/name]: Invalid value: "kubernetes-": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?') error executing jsonpath "{.items[0].metadata.name}": Error executing template: array index out of bounds: index 0, length 0. Printing more information for debugging the template: template was: {.items[0].metadata.name} object given to jsonpath engine was: map[string]interface {}{"apiVersion":"v1", "items":[]interface {}{}, "kind":"List", "metadata":map[string]interface {}{"resourceVersion":""}}
Related
See also
Advertising: