Commit Graph

3 Commits

Author SHA1 Message Date
Pierangelo Di Pilato a850b9e047
Use t.Setenv instead of os.Setenv in tests (#2454)
Go 1.17 introduced a new handy API for setting env vars scoped for
a single test so we can avoid the hard to read set and reset env
loops.

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2022-03-10 10:00:48 -08:00
Arghya Sadhu 45918d07f2
add webhookname from env (#1918)
Signed-off-by: Arghya Sadhu <arghya88@gmail.com>
2020-11-20 07:01:52 -08:00
Jihui Nie 3c29a1ce89
Add helper function to read webhook port number from env var (#1162)
* Add helper function to read port number from env var

* Add check for port == 0

* Add the unit test

* Update error message

Co-Authored-By: savitaashture <sashture@redhat.com>

* Panic when env var is set but invalid

* Rename the func to be PortFromEnv.

* Apply suggestions from code review on error message

Co-authored-by: Victor Agababov <vagababov@gmail.com>

* Join defers

Co-authored-by: savitaashture <sashture@redhat.com>
Co-authored-by: Victor Agababov <vagababov@gmail.com>
2020-05-16 18:43:02 -07:00