summaryrefslogtreecommitdiffstats
path: root/src/k8splugin/internal/app/config_backend.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/k8splugin/internal/app/config_backend.go')
-rw-r--r--src/k8splugin/internal/app/config_backend.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/k8splugin/internal/app/config_backend.go b/src/k8splugin/internal/app/config_backend.go
index 6bc145ee..4cbe1da3 100644
--- a/src/k8splugin/internal/app/config_backend.go
+++ b/src/k8splugin/internal/app/config_backend.go
@@ -360,10 +360,17 @@ func scheduleResources(c chan configResourceList) {
//Move onto the next cloud region
continue
}
+ //assuming - the resource is not exist already
data.createdResources, err = k8sClient.createResources(data.resourceTemplates, inst.Namespace)
+ errCreate := err
if err != nil {
- log.Printf("Error Creating resources: %s", err.Error())
- continue
+ // assuming - the err represent the resource is already exist, so going for update
+ data.createdResources, err = k8sClient.updateResources(data.resourceTemplates, inst.Namespace)
+ if err != nil {
+ log.Printf("Error Creating resources: %s", errCreate.Error())
+ log.Printf("Error Updating resources: %s", err.Error())
+ continue
+ }
}
}
//TODO: Needs to add code to call Kubectl create