第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

“if and (ne)”運算符在 helm 中是如何工作的?

“if and (ne)”運算符在 helm 中是如何工作的?

Go
尚方寶劍之說 2022-06-21 10:59:48
我正在使用一個開始時具有以下結構的圖表,但我很難理解何時評估為真的。{{- if and .Values.vpceIngress.enabled .Values.http.paths (ne .Values.vpceIngress.class "traefik2") }}我相信兩者都是enabled真實paths的,但ne在那之后讓我失望了。
查看完整描述

1 回答

?
FFIVE

TA貢獻1797條經(jīng)驗 獲得超6個贊

and并且ne是go templates中的函數(shù)。


and

    Returns the boolean AND of its arguments by returning the

    first empty argument or the last argument, that is,

    "and x y" behaves as "if x then y else x". All the

    arguments are evaluated.

ne

    Returns the boolean truth of arg1 != arg2

所以模板行相當于一個更偽的 codish


if (

  .Values.vpceIngress.enabled

  && .Values.http.paths

  && .Values.vpceIngress.class != "traefik2"

)

純文本的真實性.Value.key基本上是“此字段/鍵不是數(shù)據(jù)類型的零值。這也適用于映射,因為“此字段/鍵是否已定義”,因為映射沒有該路徑等于 nil 或非值(請注意,這僅在實際定義父地圖時才有效!否則模板錯誤)


查看完整回答
反對 回復 2022-06-21
  • 1 回答
  • 0 關注
  • 270 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號