小编lav*_*zer的帖子

Terrform状态锁无法释放

我在尝试运行使用 terraform 锁的 terraform 脚本时收到以下错误消息。

*Acquiring state lock. This may take a few moments...*

*Error: Error locking state: Error acquiring the state lock: storage: service returned error: StatusCode=409, ErrorCode=LeaseAlreadyPresent, ErrorMessage=There is already a lease present.*

Run Code Online (Sandbox Code Playgroud)

我实际上使用 ctrl+c 杀死了该进程,现在锁被卡住了。我尝试terraform force-unlock 'LockID' 得到以下错误。

*Local state cannot be unlocked by another process*
Run Code Online (Sandbox Code Playgroud)

请有人提供建议。谢谢

terraform

6
推荐指数
2
解决办法
2万
查看次数

Azure Devops yml管道if else条件与变量

我正在尝试将 Azure Devops yml 管道中的 if else 条件与变量组一起使用。我正在尝试按照最新的 Azure Devops yaml pipeline build 来实现它

以下是我的场景中 if else 条件的示例代码。test 是 my-global 变量组内的变量。

variables:
  - group: my-global
  - name: fileName
    ${{ if eq(variables['test'], 'true') }}:
      value: 'product.js'
    ${{ elseif eq(variables['test'], false) }}:
      value: 'productCost.js'

jobs:
  - job:
    steps:
      - bash:
          echo test variable value $(fileName)
Run Code Online (Sandbox Code Playgroud)

当执行上面的代码时,在 echo 语句中我们看不到文件名的任何值,即它为空,这意味着上面的 if else 条件都没有被执行,但是当我使用以下条件测试 if else 条件时。

  - name: fileName
    ${{ if eq('true', 'true') }}:
       value: 'product.js'

Run Code Online (Sandbox Code Playgroud)

文件名确实回显了正确的值,即product.js。所以我的结论是我无法正确引用变量组中的变量。因此,任何建议都会有所帮助并受到赞赏。谢谢!

azure-devops azure-pipelines-yaml

3
推荐指数
1
解决办法
2万
查看次数