Skip to content

Commit 16a68de

Browse files
chore: integrate build repository
1 parent afdd722 commit 16a68de

File tree

10 files changed

+15
-288
lines changed

10 files changed

+15
-288
lines changed

Taskfile.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ vars:
44
NESTED_MODULES: api
55
API_DIRS: '{{.ROOT_DIR}}/api/v1alpha1/...'
66
MANIFEST_OUT: '{{.ROOT_DIR}}/config/crd/bases'
7-
CODE_DIRS: '{{.ROOT_DIR}}/cmd/... {{.ROOT_DIR}}/internal/... {{.ROOT_DIR}}/test/... {{.ROOT_DIR}}/api/v1alpha1/...'
7+
CODE_DIRS: '{{.ROOT_DIR}}/cmd/... {{.ROOT_DIR}}/internal/... {{.ROOT_DIR}}/api/v1alpha1/...'
88
COMPONENTS: 'cluster-provider-kind'
99
REPO_NAME: 'https://github.com/openmcp-project/cluster-provider-kind'
1010
GENERATE_DOCS_INDEX: "false"

api/v1alpha1/accessrequest_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ type AccessRequestStatus struct {
3333
Kubeconfig *Kubeconfig `json:"kubeconfig,omitempty"`
3434
}
3535

36+
// Kubeconfig contains the information needed to access a cluster.
3637
type Kubeconfig struct {
3738
SecretRef corev1.SecretReference `json:"secretRef,omitempty"`
3839
ExpiresAt metav1.Time `json:"expiresAt,omitempty"`
3940
ServiceAccount ServiceAccountRef `json:"serviceAccount,omitempty"`
4041
}
4142

43+
// ServiceAccountRef contains the information needed to access a service account.
4244
type ServiceAccountRef struct {
4345
Name string `json:"name"`
4446
Namespace string `json:"namespace"`

api/v1alpha1/cluster_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ const (
3333
Unknown Phase = "Unknown"
3434
)
3535

36+
// ClusterConditionType is a custom type representing the condition type of a cluster.
3637
type ClusterConditionType string
3738

39+
// Constants representing the conditions of a cluster.
3840
const (
3941
ClusterReady ClusterConditionType = "Ready"
4042
KindReady ClusterConditionType = "KindReady"

config/crd/bases/kind.clusters.openmcp.cloud_accessrequests.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ spec:
111111
description: AccessRequestStatus defines the observed state of AccessRequest.
112112
properties:
113113
kubeconfig:
114+
description: Kubeconfig contains the information needed to access
115+
a cluster.
114116
properties:
115117
expiresAt:
116118
format: date-time
@@ -131,6 +133,8 @@ spec:
131133
type: object
132134
x-kubernetes-map-type: atomic
133135
serviceAccount:
136+
description: ServiceAccountRef contains the information needed
137+
to access a service account.
134138
properties:
135139
name:
136140
type: string

internal/controller/accessrequest_controller_test.go

Lines changed: 0 additions & 84 deletions
This file was deleted.

internal/controller/cluster_controller.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import (
3737
)
3838

3939
var (
40+
// Finalizer is the finalizer for Cluster
4041
Finalizer = v1alpha1.GroupVersion.Group + "/finalizer"
4142
)
4243

@@ -68,7 +69,8 @@ func (r *ClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
6869
}
6970

7071
// Always try to update the status
71-
defer r.Status().Update(ctx, cluster)
72+
// FIXME: error handling at the end?
73+
defer r.Status().Update(ctx, cluster) //nolint:errcheck
7274

7375
ctx = smartrequeue.NewContext(ctx, r.RequeueStore.For(cluster))
7476

@@ -109,6 +111,7 @@ func (r *ClusterReconciler) handleDelete(ctx context.Context, cluster *v1alpha1.
109111
return requeue.Progressing()
110112
}
111113

114+
//nolint:gocyclo
112115
func (r *ClusterReconciler) handleCreateOrUpdate(ctx context.Context, cluster *v1alpha1.Cluster) (ctrl.Result, error) {
113116
requeue := smartrequeue.FromContext(ctx)
114117
cluster.Status.Phase = v1alpha1.Progressing

internal/controller/cluster_controller_test.go

Lines changed: 0 additions & 84 deletions
This file was deleted.

internal/controller/suite_test.go

Lines changed: 0 additions & 116 deletions
This file was deleted.

test/utils/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"os/exec"
2525
"strings"
2626

27-
. "github.com/onsi/ginkgo/v2" //nolint:golint,revive
27+
. "github.com/onsi/ginkgo/v2" //nolint:golint,revive,staticcheck
2828
)
2929

3030
const (
@@ -197,7 +197,7 @@ func GetProjectDir() (string, error) {
197197
if err != nil {
198198
return wd, err
199199
}
200-
wd = strings.Replace(wd, "/test/e2e", "", -1)
200+
wd = strings.ReplaceAll(wd, "/test/e2e", "")
201201
return wd, nil
202202
}
203203

0 commit comments

Comments
 (0)