garyox64

[helm & yaml] 分支和 pod command 怎么搭配

  •  
  •   garyox64 · Dec 23, 2022 · 1516 views
    This topic created in 1298 days ago, the information mentioned may be changed or developed.
    背景:在改 helm ,对这个玩意不太熟
    然后有两个开关,比如:
    A:
    enabled:true
    B:
    enabled:true
    yaml 里:

    ...k8s job

    command:
    command1 && ( if A true ) commandA && ( if B true ) commandB

    A 和 B 是至少有一个是 true
    if A.enabled = true 的时候,执行 commandA
    B 同理

    --
    command 和 helm 分支控制不知道怎么组合
    求指点,我能想到的就是 把三种情况列出来,或者分成两个 yaml
    1 replies    2022-12-23 20:53:50 +08:00
    lff0305
        1
    lff0305  
       Dec 23, 2022 via Android   ❤️ 1
    把条件 A 和放到 env 里,command 换成一个.sh, 在.sh 里面根据 env A 和 B 的值的各种逻辑判断来执行

    在 helm 里不是不行,比较麻烦,要用 if .eq
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   933 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 20:18 · PVG 04:18 · LAX 13:18 · JFK 16:18
    ♥ Do have faith in what you're doing.