...
1 package v1alpha1
2
3 import (
4 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
5
6 "edge-infra.dev/pkg/edge/constants/api/fleet"
7 )
8
9 func OwnerReference(cluster *GKECluster) []metav1.OwnerReference {
10 return []metav1.OwnerReference{
11 *metav1.NewControllerRef(cluster, GroupVersion.WithKind(GKEClusterGVK.Kind)),
12 }
13 }
14
15 func New(projectID, banner, organization, name, location, nodeVersion string, numNode int, _fleet fleet.Type, clusterEdgeID string) *GKECluster {
16 clusterName := clusterEdgeID
17 return &GKECluster{
18 TypeMeta: metav1.TypeMeta{
19 Kind: GKEClusterGVK.Kind,
20 APIVersion: GKEClusterAPIVersion,
21 },
22 ObjectMeta: metav1.ObjectMeta{
23 Name: clusterName,
24 },
25 Spec: GKEClusterSpec{
26 ProjectID: projectID,
27 Banner: banner,
28 Organization: organization,
29 Name: name,
30 Fleet: _fleet,
31 Location: location,
32 NodeVersion: nodeVersion,
33 NumNode: numNode,
34 },
35 }
36 }
37
View as plain text