blob: 8770ff25782e3a079fa32928efec843f62d0bc56 [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
Matteo Scandolo5244aaa2021-04-28 09:28:58 -070032 case "voltha-onos":
33 return "--set onos-classic.image.repository=voltha/voltha-onos,onos-classic.image.tag=citest,onos-classic.image.pullPolicy=${pullPolicy}"
Matteo Scandolo660e4af2021-04-02 11:16:09 -070034 default:
Matteo Scandolo9b644ba2021-04-19 11:21:07 -070035 return ""
Matteo Scandolo660e4af2021-04-02 11:16:09 -070036 break
37 }
38
Matteo Scandolo9b644ba2021-04-19 11:21:07 -070039 return "--set ${chart}.images.${image}.tag=${tag},${chart}.images.${image}.pullPolicy=${pullPolicy},${chart}.images.${image}.registry='' "
Matteo Scandolo660e4af2021-04-02 11:16:09 -070040}