Create formatted swagger CM
@@ -323,13 +323,13 @@ func (r *ReconcileAPI) Reconcile(request reconcile.Request) (reconcile.Result, e
return reconcile.Result{}, err
}
} else {
- log.Info("Updating swagger-mgw since timestamp value is given")
+ log.Info("Creating swagger configmap for updated MGW")
r.recorder.Event(instance, corev1.EventTypeNormal, "SwaggerConfigMap",
- "Updating swagger configmap for MGW.")
- if err := k8s.Update(&r.client, swaggerConfMapMgw); err != nil {
- log.Error(err, "Error updating formatted swagger configmap", "configmap", swaggerConfMapMgw)
+ "Creating swagger configmap for updated MGW.")
+ if err := k8s.Apply(&r.client, swaggerConfMapMgw); err != nil {
+ log.Error(err, "Error creating formatted swagger configmap", "configmap", swaggerConfMapMgw)
r.recorder.Event(instance, eventTypeError, "Configs",
- "Error updating swagger configmap for MGW.")
+ "Error creating swagger configmap for MGW.")
return reconcile.Result{}, err
}
}
