export POD NAME
Jump to navigation
Jump to search
Example with errors: Unable to find "/v1, Resource=pods" that match label selector[edit]
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[edit]
See also[edit]
Advertising: