ownerReference for cm
Signed-off-by: Howard Lau <howardlau1999@hotmail.com>
This commit is contained in:
parent
e7b287bb6f
commit
95b9af71fa
|
@ -88,6 +88,9 @@ func (r *SeaweedReconciler) ensureFilerConfigMap(seaweedCR *seaweedv1.Seaweed) (
|
|||
log := r.Log.WithValues("sw-filer-configmap", seaweedCR.Name)
|
||||
|
||||
filerConfigMap := r.createFilerConfigMap(seaweedCR)
|
||||
if err := controllerutil.SetControllerReference(seaweedCR, filerConfigMap, r.Scheme); err != nil {
|
||||
return ReconcileResult(err)
|
||||
}
|
||||
_, err := r.CreateOrUpdateConfigMap(filerConfigMap)
|
||||
|
||||
log.Info("Get filer ConfigMap " + filerConfigMap.Name)
|
||||
|
|
|
@ -82,6 +82,9 @@ func (r *SeaweedReconciler) ensureMasterConfigMap(seaweedCR *seaweedv1.Seaweed)
|
|||
log := r.Log.WithValues("sw-master-configmap", seaweedCR.Name)
|
||||
|
||||
masterConfigMap := r.createMasterConfigMap(seaweedCR)
|
||||
if err := controllerutil.SetControllerReference(seaweedCR, masterConfigMap, r.Scheme); err != nil {
|
||||
return ReconcileResult(err)
|
||||
}
|
||||
_, err := r.CreateOrUpdateConfigMap(masterConfigMap)
|
||||
|
||||
log.Info("Get master ConfigMap " + masterConfigMap.Name)
|
||||
|
@ -105,6 +108,9 @@ func (r *SeaweedReconciler) ensureMasterPeerService(seaweedCR *seaweedv1.Seaweed
|
|||
log := r.Log.WithValues("sw-master-peer-service", seaweedCR.Name)
|
||||
|
||||
masterPeerService := r.createMasterPeerService(seaweedCR)
|
||||
if err := controllerutil.SetControllerReference(seaweedCR, masterPeerService, r.Scheme); err != nil {
|
||||
return ReconcileResult(err)
|
||||
}
|
||||
_, err := r.CreateOrUpdateService(masterPeerService)
|
||||
|
||||
log.Info("Get master peer service " + masterPeerService.Name)
|
||||
|
|
|
@ -56,6 +56,9 @@ func (r *SeaweedReconciler) ensureVolumeServerPeerService(seaweedCR *seaweedv1.S
|
|||
log := r.Log.WithValues("sw-volume-peer-service", seaweedCR.Name)
|
||||
|
||||
volumeServerPeerService := r.createVolumeServerPeerService(seaweedCR)
|
||||
if err := controllerutil.SetControllerReference(seaweedCR, volumeServerPeerService, r.Scheme); err != nil {
|
||||
return ReconcileResult(err)
|
||||
}
|
||||
_, err := r.CreateOrUpdateService(volumeServerPeerService)
|
||||
|
||||
log.Info("ensure volume peer service " + volumeServerPeerService.Name)
|
||||
|
|
Loading…
Reference in New Issue