blob: 957d58600c31a582e079e6aa771fc4cce96238f0 [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
Matteo Scandolo660e4af2021-04-02 11:16:09 -070018 // TODO end
19 case "voltha-openolt-adapter":
20 chart = "voltha-adapter-openolt"
21 image = "adapter_open_olt"
22 break
23 case "bbsim":
24 // BBSIM has a different format that voltha, return directly
Matteo Scandolo9b644ba2021-04-19 11:21:07 -070025 return "--set images.bbsim.tag=${tag},images.bbsim.pullPolicy=${pullPolicy},images.bbsim.registry='' "
Matteo Scandolo660e4af2021-04-02 11:16:09 -070026 break
Matteo Scandolo5244aaa2021-04-28 09:28:58 -070027 case "voltha-onos":
28 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 -070029 default:
Matteo Scandolo9b644ba2021-04-19 11:21:07 -070030 return ""
Matteo Scandolo660e4af2021-04-02 11:16:09 -070031 break
32 }
33
Matteo Scandolo9b644ba2021-04-19 11:21:07 -070034 return "--set ${chart}.images.${image}.tag=${tag},${chart}.images.${image}.pullPolicy=${pullPolicy},${chart}.images.${image}.registry='' "
Matteo Scandolo660e4af2021-04-02 11:16:09 -070035}