blob: 76dda9d2ac60a465ee6e7acded10c69e656c41eb [file] [log] [blame]
Matteo Scandolo660e4af2021-04-02 11:16:09 -07001// returns the helm flags required to override a specific image
2def 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 Scandolo9b644ba2021-04-19 11:21:07 -070030 return "--set images.bbsim.tag=${tag},images.bbsim.pullPolicy=${pullPolicy},images.bbsim.registry='' "
Matteo Scandolo660e4af2021-04-02 11:16:09 -070031 break
32 default:
Matteo Scandolo9b644ba2021-04-19 11:21:07 -070033 return ""
Matteo Scandolo660e4af2021-04-02 11:16:09 -070034 break
35 }
36
Matteo Scandolo9b644ba2021-04-19 11:21:07 -070037 return "--set ${chart}.images.${image}.tag=${tag},${chart}.images.${image}.pullPolicy=${pullPolicy},${chart}.images.${image}.registry='' "
Matteo Scandolo660e4af2021-04-02 11:16:09 -070038}