Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
added coment explaninig package cloning changes
Browse files Browse the repository at this point in the history
return err for all config controllers when cluster not found

adds check of cluster ownership
  • Loading branch information
Adolfo Duarte committed Nov 4, 2022
1 parent f2819f8 commit a94dde3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion addons/controllers/antrea/antreaconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (r *AntreaConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request
if apierrors.IsNotFound(err) && cluster != nil {
log.Info(fmt.Sprintf("'%s/%s' is listed as owner reference but could not be found",
cluster.Namespace, cluster.Name))
return ctrl.Result{}, nil
return ctrl.Result{}, err
}
log.Error(err, "could not determine owner cluster")
return ctrl.Result{}, err
Expand Down
2 changes: 1 addition & 1 deletion addons/controllers/calico/calicoconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (r *CalicoConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request
if apierrors.IsNotFound(err) && cluster != nil {
log.Info(fmt.Sprintf("'%s/%s' is listed as owner reference but could not be found",
cluster.Namespace, cluster.Name))
return ctrl.Result{}, nil
return ctrl.Result{}, err
}
log.Error(err, "could not determine owner cluster")
return ctrl.Result{}, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (r *KappControllerConfigReconciler) Reconcile(ctx context.Context, req ctrl
if apierrors.IsNotFound(err) && cluster != nil {
r.Log.Info(fmt.Sprintf("'%s/%s' is listed as owner reference but could not be found",
cluster.Namespace, cluster.Name))
return ctrl.Result{}, nil
return ctrl.Result{}, err
}
r.Log.Info("could not determine owner cluster")
return ctrl.Result{}, err
Expand Down
11 changes: 10 additions & 1 deletion addons/pkg/util/clusterbootstrapclone/clusterbootstrapclone.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,16 @@ func (h *Helper) HandleExistingClusterBootstrap(clusterBootstrap *runtanzuv1alph
packages = packagesToBeCloned
}
} else {
// packages with values from inline need to be cloned.
// packages with values from inline need to be cloned for two cases:
//
// 1. When no Clusterbootstrap is given by user and clusterbootstraptemplate
// is cloned as clusterbootstrap but resolved tkr is not set - In this
// case the providers are already cloned so providers have to be cloned again
//
// 2. When full clusterbootstrap without tkr annotation is given by user.
// In this case we only want to handle inline packages for creating
// secret. The providers are expected to be present in the
// clusternamespace, created by user before clusterbootstrap is created.
var nonEmptyInlinePackages []*runtanzuv1alpha3.ClusterBootstrapPackage
for _, cbPackage := range packages {
if cbPackage != nil && cbPackage.ValuesFrom != nil && cbPackage.ValuesFrom.Inline != nil {
Expand Down

0 comments on commit a94dde3

Please # to comment.