mirror of
https://github.com/stakater/Reloader.git
synced 2026-03-02 17:30:19 +00:00
Merge branch 'master' of github.com:stakater/Reloader into rollback-upgrade-deployment
This commit is contained in:
@@ -25,7 +25,7 @@ func startReloader(cmd *cobra.Command, args []string) {
|
||||
currentNamespace := os.Getenv("KUBERNETES_NAMESPACE")
|
||||
if len(currentNamespace) == 0 {
|
||||
currentNamespace = v1.NamespaceAll
|
||||
logrus.Infof("Warning: KUBERNETES_NAMESPACE is unset, will detect changes in all namespaces.")
|
||||
logrus.Warnf("KUBERNETES_NAMESPACE is unset, will detect changes in all namespaces.")
|
||||
}
|
||||
|
||||
// create the clientset
|
||||
|
||||
@@ -66,7 +66,7 @@ func (c *Controller) Update(old interface{}, new interface{}) {
|
||||
// Delete function to add an object to the queue in case of deleting a resource
|
||||
func (c *Controller) Delete(old interface{}) {
|
||||
// TODO Added this function for future usecase
|
||||
logrus.Infof("Deleted resource has been added to queue")
|
||||
logrus.Infof("Deleted resource has been detected but no further implementation found to take action")
|
||||
}
|
||||
|
||||
//Run function for controller which handles the queue
|
||||
@@ -129,7 +129,7 @@ func (c *Controller) handleErr(err error, key interface{}) {
|
||||
|
||||
// This controller retries 5 times if something goes wrong. After that, it stops trying.
|
||||
if c.queue.NumRequeues(key) < 5 {
|
||||
logrus.Infof("Error syncing events %v: %v", key, err)
|
||||
logrus.Errorf("Error syncing events %v: %v", key, err)
|
||||
|
||||
// Re-enqueue the key rate limited. Based on the rate limiter on the
|
||||
// queue and the re-enqueue history, the key will be processed later again.
|
||||
|
||||
@@ -62,7 +62,7 @@ func TestControllerForUpdatingConfigmapShouldUpdateDeployment(t *testing.T) {
|
||||
logrus.Infof("Updating Configmap %q.\n", configmapName)
|
||||
_, err = configmapClient.Get(configmapName, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
logrus.Infof("Error while getting configmap %v", err)
|
||||
logrus.Errorf("Error while getting configmap %v", err)
|
||||
}
|
||||
_, updateErr := configmapClient.Update(updateConfigmap(namespace, configmapName))
|
||||
|
||||
@@ -71,7 +71,7 @@ func TestControllerForUpdatingConfigmapShouldUpdateDeployment(t *testing.T) {
|
||||
if updateErr != nil {
|
||||
err = controller.client.CoreV1().ConfigMaps(namespace).Delete(configmapName, &metav1.DeleteOptions{})
|
||||
if err != nil {
|
||||
logrus.Infof("Error while deleting the configmap %v", err)
|
||||
logrus.Errorf("Error while deleting the configmap %v", err)
|
||||
}
|
||||
logrus.Fatalf("Fatal error in configmap update: %v", updateErr)
|
||||
}
|
||||
@@ -84,7 +84,7 @@ func TestControllerForUpdatingConfigmapShouldUpdateDeployment(t *testing.T) {
|
||||
logrus.Infof("Deleting Configmap %q.\n", configmapName)
|
||||
err = controller.client.CoreV1().ConfigMaps(namespace).Delete(configmapName, &metav1.DeleteOptions{})
|
||||
if err != nil {
|
||||
logrus.Infof("Error while deleting the configmap %v", err)
|
||||
logrus.Errorf("Error while deleting the configmap %v", err)
|
||||
}
|
||||
time.Sleep(15 * time.Second)
|
||||
}
|
||||
@@ -132,7 +132,7 @@ func TestControllerForUpdatingSecretShouldUpdateDeployment(t *testing.T) {
|
||||
logrus.Infof("Updating Secret %q.\n", secretName)
|
||||
_, err = secretClient.Get(secretName, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
logrus.Infof("Error while getting secret %v", err)
|
||||
logrus.Errorf("Error while getting secret %v", err)
|
||||
}
|
||||
_, updateErr := secretClient.Update(updateSecret(namespace, secretName))
|
||||
|
||||
@@ -141,15 +141,15 @@ func TestControllerForUpdatingSecretShouldUpdateDeployment(t *testing.T) {
|
||||
if updateErr != nil {
|
||||
err := controller.client.CoreV1().Secrets(namespace).Delete(secretName, &metav1.DeleteOptions{})
|
||||
if err != nil {
|
||||
logrus.Infof("Error while deleting the secret %v", err)
|
||||
logrus.Errorf("Error while deleting the secret %v", err)
|
||||
}
|
||||
logrus.Infof("Error while deleting the secret %v", err)
|
||||
logrus.Errorf("Error while updating the secret %v", err)
|
||||
}
|
||||
time.Sleep(10 * time.Second)
|
||||
logrus.Infof("Deleting Secret %q.\n", secretName)
|
||||
err = controller.client.CoreV1().Secrets(namespace).Delete(secretName, &metav1.DeleteOptions{})
|
||||
if err != nil {
|
||||
logrus.Infof("Error while deleting the secret %v", err)
|
||||
logrus.Errorf("Error while deleting the secret %v", err)
|
||||
}
|
||||
time.Sleep(15 * time.Second)
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ func (r ResourceCreatedHandler) Handle() error {
|
||||
} else if _, ok := r.Resource.(*v1.Secret); ok {
|
||||
logrus.Infof("Performing 'Added' action for resource of type 'secret'")
|
||||
} else {
|
||||
logrus.Infof("Invalid resource")
|
||||
logrus.Warnf("Invalid resource: Resource should be 'Secret' or 'Configmap' but found %v", r.Resource)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -42,7 +42,7 @@ func (r ResourceUpdatedHandler) Handle() error {
|
||||
rollingUpgrade(r, "secrets", "daemonsets")
|
||||
rollingUpgrade(r, "secrets", "statefulSets")
|
||||
} else {
|
||||
logrus.Infof("Invalid resource")
|
||||
logrus.Warnf("Invalid resource: Resource should be 'Secret' or 'Configmap' but found %v", r.Resource)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user