Matteo Scandolo | 660e4af | 2021-04-02 11:16:09 -0700 | [diff] [blame] | 1 | // returns the helm flags required to override a specific image |
| 2 | def call(String project = "unknown", String tag = "citest", String pullPolicy = "Never") { |
| 3 | def chart = "unknown" |
| 4 | def image = "unknown" |
| 5 | switch(project) { |
| 6 | case "ofagent-go": |
| 7 | chart = "voltha" |
| 8 | image = "ofagent" |
| 9 | break |
| 10 | case "voltha-go": |
| 11 | chart = "voltha" |
| 12 | image = "rw_core" |
| 13 | break |
| 14 | case "voltha-openonu-adapter-go": |
| 15 | chart = "voltha-adapter-openonu" |
| 16 | image = "adapter_open_onu_go" |
| 17 | break |
| 18 | // TODO remove after 2.7 |
| 19 | case "voltha-openonu-adapter": |
| 20 | chart = "voltha-adapter-openonu" |
| 21 | image = "adapter_open_onu" |
| 22 | break |
| 23 | // TODO end |
| 24 | case "voltha-openolt-adapter": |
| 25 | chart = "voltha-adapter-openolt" |
| 26 | image = "adapter_open_olt" |
| 27 | break |
| 28 | case "bbsim": |
| 29 | // BBSIM has a different format that voltha, return directly |
Matteo Scandolo | 9b644ba | 2021-04-19 11:21:07 -0700 | [diff] [blame] | 30 | return "--set images.bbsim.tag=${tag},images.bbsim.pullPolicy=${pullPolicy},images.bbsim.registry='' " |
Matteo Scandolo | 660e4af | 2021-04-02 11:16:09 -0700 | [diff] [blame] | 31 | break |
| 32 | default: |
Matteo Scandolo | 9b644ba | 2021-04-19 11:21:07 -0700 | [diff] [blame] | 33 | return "" |
Matteo Scandolo | 660e4af | 2021-04-02 11:16:09 -0700 | [diff] [blame] | 34 | break |
| 35 | } |
| 36 | |
Matteo Scandolo | 9b644ba | 2021-04-19 11:21:07 -0700 | [diff] [blame] | 37 | return "--set ${chart}.images.${image}.tag=${tag},${chart}.images.${image}.pullPolicy=${pullPolicy},${chart}.images.${image}.registry='' " |
Matteo Scandolo | 660e4af | 2021-04-02 11:16:09 -0700 | [diff] [blame] | 38 | } |