addon-controller icon indicating copy to clipboard operation
addon-controller copied to clipboard

ClusterReport/ClusterSummary name

Open gianlucam76 opened this issue 3 years ago • 0 comments

Currently ClusterReport name is

func getClusterReportName(clusterProfileName, clusterName string, clusterType libsveltosv1alpha1.ClusterType) string {
	// TODO: shorten this value
	return clusterProfileName + "--" + strings.ToLower(string(clusterType)) + "--" + clusterName
}

and ClusterSummary name is

func GetClusterSummaryName(clusterProfileName, clusterName string, isSveltosCluster bool) string {
	prefix := "capi"
	if isSveltosCluster {
		prefix = "sveltos"
	}
	return fmt.Sprintf("%s-%s-%s", clusterProfileName, prefix, clusterName)
}

which might end up exceeding maximum name length.

Describe the solution you'd like Implement a solution to shorten that making sure no collision ever happens (when pod starts we can fetch all existing ClusterSummary/ClusterReports).

Also, given a clusterProfile and a cluster name, there needs to be a way to get corresponding ClusterReport (which can likely be achieved using labels) and ClusterSummary.

gianlucam76 avatar Jan 18 '23 23:01 gianlucam76