云形式中允许的值

发布于 2025-01-30 05:18:44 字数 530 浏览 1 评论 0原文

我正在使用一个参数询问他想要D驱动器是否想要的用户天气,以便这样做我正在使用条件。

我试图给出约束描述,允许的值参数属性。

  NeedVolumeD:
    Type: String
    Description: Do you want a D drive? Enter Yes or No
    ConstraintDescription: Enter Yes or No
    AllowedValues:
      - Yes
      - No

但这是给我一个真实和错误的下拉列表,而在我的代码下,我试图使用“是和否”,尽管这在某种程度上是有效的。

我在这里不了解什么。

I am using a parameter to ask a user weather he wants a D drive or not, to do this I am using conditions.

I tried to give a Constraint Description and Allowed Values a parameter property.

  NeedVolumeD:
    Type: String
    Description: Do you want a D drive? Enter Yes or No
    ConstraintDescription: Enter Yes or No
    AllowedValues:
      - Yes
      - No

But this is giving me a dropdown of true and false whereas later in my code under Conditions I am trying to use Yes and No, although this is somehow working.

enter image description here

What am I not understanding here.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

败给现实 2025-02-06 05:18:44

您必须使用单引号

  NeedVolumeD:
    Type: String
    Description: Do you want a D drive? Enter Yes or No
    ConstraintDescription: Enter Yes or No
    AllowedValues:
      - 'Yes'
      - 'No'

否则,yaml(旧版本)将自动将是/否转换为true/false 。

You have to use single quotes:

  NeedVolumeD:
    Type: String
    Description: Do you want a D drive? Enter Yes or No
    ConstraintDescription: Enter Yes or No
    AllowedValues:
      - 'Yes'
      - 'No'

Otherwise, YAML (old version) will automatically convert Yes/No into true/false.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文