Skip to content

ClusterReport/ClusterSummary name #118

Open
@gianlucam76

Description

@gianlucam76

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions