Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ resources:
# Comment the following 4 lines if you want to disable
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
# which protects your /metrics endpoint.
# - auth_proxy_service.yaml
# - auth_proxy_role.yaml
# - auth_proxy_role_binding.yaml
# - auth_proxy_client_clusterrole.yaml
- auth_proxy_service.yaml
- auth_proxy_role.yaml
- auth_proxy_role_binding.yaml
- auth_proxy_client_clusterrole.yaml
# For each CRD, "Editor" and "Viewer" roles are scaffolded by
# default, aiding admins in cluster management. Those roles are
# not used by the Project itself. You can comment the following lines
Expand Down
5 changes: 4 additions & 1 deletion controllers/clusterprofile_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ func (r *ClusterProfileReconciler) reconcileNormal(
depClusters := depManager.GetClusterDeployments(profileRef)
matchingCluster = append(matchingCluster, depClusters...)

profileScope.SetMatchingClusterRefs(removeDuplicates(matchingCluster))
matchingClusters := removeDuplicates(matchingCluster)
profileScope.SetMatchingClusterRefs(matchingClusters)
trackMatchingClusters(configv1beta1.ClusterProfileKind, "", profileScope.Profile.GetName(),
len(matchingClusters), logger)

r.updateMaps(profileScope)

Expand Down
22 changes: 22 additions & 0 deletions controllers/clustersummary_deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -887,17 +887,34 @@ func (r *ClusterSummaryReconciler) updateFeatureStatus(clusterSummaryScope *scop
logger.V(logs.LogDebug).Info("updating clustersummary status")
now := metav1.NewTime(time.Now())

clusterSummary := clusterSummaryScope.ClusterSummary
profileKind, profileNamespace, profileName := getProfileLabels(clusterSummary, logger)

switch *status {
case libsveltosv1beta1.FeatureStatusProvisioned:
failed := false
clusterSummaryScope.SetFeatureStatus(featureID, libsveltosv1beta1.FeatureStatusProvisioned, hash, &failed)
clusterSummaryScope.SetFailureMessage(featureID, nil)
clusterSummaryScope.SetLastAppliedTime(featureID, &now)
trackReconcileOutcome(clusterSummary.Spec.ClusterNamespace, clusterSummary.Spec.ClusterName,
string(featureID), clusterSummary.Spec.ClusterType, true, profileKind, profileNamespace, profileName, logger)
trackConsecutiveFailures(clusterSummary.Spec.ClusterNamespace, clusterSummary.Spec.ClusterName,
string(featureID), clusterSummary.Spec.ClusterType, r.getConsecutiveFailures(clusterSummaryScope, featureID),
profileKind, profileNamespace, profileName, logger)
trackLastSuccess(clusterSummary.Spec.ClusterNamespace, clusterSummary.Spec.ClusterName,
string(featureID), clusterSummary.Spec.ClusterType, now.Time, profileKind, profileNamespace, profileName, logger)
case libsveltosv1beta1.FeatureStatusRemoved:
failed := false
clusterSummaryScope.SetFeatureStatus(featureID, libsveltosv1beta1.FeatureStatusRemoved, hash, &failed)
clusterSummaryScope.SetFailureMessage(featureID, nil)
clusterSummaryScope.SetLastAppliedTime(featureID, &now)
trackReconcileOutcome(clusterSummary.Spec.ClusterNamespace, clusterSummary.Spec.ClusterName,
string(featureID), clusterSummary.Spec.ClusterType, true, profileKind, profileNamespace, profileName, logger)
trackConsecutiveFailures(clusterSummary.Spec.ClusterNamespace, clusterSummary.Spec.ClusterName,
string(featureID), clusterSummary.Spec.ClusterType, r.getConsecutiveFailures(clusterSummaryScope, featureID),
profileKind, profileNamespace, profileName, logger)
trackLastSuccess(clusterSummary.Spec.ClusterNamespace, clusterSummary.Spec.ClusterName,
string(featureID), clusterSummary.Spec.ClusterType, now.Time, profileKind, profileNamespace, profileName, logger)
case libsveltosv1beta1.FeatureStatusProvisioning:
clusterSummaryScope.SetFeatureStatus(featureID, libsveltosv1beta1.FeatureStatusProvisioning, hash, nil)
case libsveltosv1beta1.FeatureStatusAgentRemoving:
Expand All @@ -912,6 +929,11 @@ func (r *ClusterSummaryReconciler) updateFeatureStatus(clusterSummaryScope *scop
clusterSummaryScope.SetFailureMessage(featureID, &err)
}
clusterSummaryScope.SetLastAppliedTime(featureID, &now)
trackReconcileOutcome(clusterSummary.Spec.ClusterNamespace, clusterSummary.Spec.ClusterName,
string(featureID), clusterSummary.Spec.ClusterType, false, profileKind, profileNamespace, profileName, logger)
trackConsecutiveFailures(clusterSummary.Spec.ClusterNamespace, clusterSummary.Spec.ClusterName,
string(featureID), clusterSummary.Spec.ClusterType, r.getConsecutiveFailures(clusterSummaryScope, featureID),
profileKind, profileNamespace, profileName, logger)
}
}

Expand Down
Loading