mirror of
https://github.com/containers/podman.git
synced 2025-06-20 17:13:43 +08:00
podman kube play: fix broken annotation parsing
If a user did not set an equal sign in the annotation that old code would panic when accessing the second element in the slice. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -239,7 +239,7 @@ func play(cmd *cobra.Command, args []string) error {
|
||||
|
||||
for _, annotation := range playOptions.annotations {
|
||||
splitN := strings.SplitN(annotation, "=", 2)
|
||||
if len(splitN) > 2 {
|
||||
if len(splitN) != 2 {
|
||||
return fmt.Errorf("annotation %q must include an '=' sign", annotation)
|
||||
}
|
||||
if playOptions.Annotations == nil {
|
||||
|
Reference in New Issue
Block a user