Runtime Namespace (#1547)

* Add context option to runtime; Add dynamic namespace to kubectl client

* Add namespace runtime arg

* Fixes & Debugging

* Pass options in k8s runtime

* Set namespace on k8s resources

* Additional Logging

* More debugging

* Remove Debugging

* Ensure namespace exists

* Add debugging

* Refactor namespaceExists check

* Fix

* Fix

* Fix

* Fix

* Change the way we check for namespace

* Fix

* Tidying Up

* Fix Test

* Fix merge bugs

* Serialize k8s namespaces

* Add namespace to watch

* Serialize namespace when creating k8s namespace

Co-authored-by: Ben Toogood <ben@micro.mu>
Co-authored-by: Asim Aslam <asim@aslam.me>
This commit is contained in:
ben-toogood
2020-04-23 13:53:42 +01:00
committed by GitHub
parent 7345ce9192
commit 692b27578c
14 changed files with 411 additions and 109 deletions

View File

@@ -335,7 +335,7 @@ func (r *runtime) Read(opts ...ReadOption) ([]*Service, error) {
}
// Update attemps to update the service
func (r *runtime) Update(s *Service) error {
func (r *runtime) Update(s *Service, opts ...UpdateOption) error {
r.Lock()
service, ok := r.services[serviceKey(s)]
r.Unlock()
@@ -350,7 +350,7 @@ func (r *runtime) Update(s *Service) error {
}
// Delete removes the service from the runtime and stops it
func (r *runtime) Delete(s *Service) error {
func (r *runtime) Delete(s *Service, opts ...DeleteOption) error {
r.Lock()
defer r.Unlock()