升级到 16.1.5 后,GitLab CI 管道因无效 yaml 错误而停止工作

问题描述 投票:0回答:1

我有一个 GitLab CI 管道,从 16.0.2 升级到 GitLab 16.1.5 后突然停止工作。

我现在在合并请求上收到以下错误消息:

Unable to create pipeline
image is defined in top-level and `default:` entry

我没有更改

.gitlab-ci.yml
文件中的任何内容。

管道给出

invalid yaml
错误。

为什么会发生这种情况以及如何解决?

gitlab yaml gitlab-ci gitlab-ci-runner
1个回答
0
投票

我必须将

image:
关键字移到
default:
关键字下。

之前:

image:
  name: alpine:3.17

之后:

default:
  image: alpine:3.17

似乎他们可能已经弃用了顶层的 image 关键字,并将其移至旧版本中的默认关键字下,并在最新版本中完全使其在顶层不可用。

参考资料:

© www.soinside.com 2019 - 2024. All rights reserved.