Skip to content

Commit 1d5728d

Browse files
committed
Make dummy tests run successfully
Signed-off-by: Marvin Beckers <[email protected]>
1 parent 787e274 commit 1d5728d

File tree

7 files changed

+28
-8
lines changed

7 files changed

+28
-8
lines changed

api/v1alpha1/kubeconfig_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type KubeconfigSpec struct {
3232
Groups []string `json:"groups,omitempty"`
3333

3434
// Validity configures the lifetime of the embedded TLS certificate. The kubeconfig secret will be automatically regenerated when the certificate expires.
35-
Validity metav1.Time `json:"validity"`
35+
Validity metav1.Duration `json:"validity"`
3636

3737
// SecretRef defines the v1.Secret object that the resulting kubeconfig should be written to.
3838
SecretRef corev1.LocalObjectReference `json:"secretRef"`

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/operator.kcp.io_kubeconfigs.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ spec:
121121
description: Validity configures the lifetime of the embedded TLS
122122
certificate. The kubeconfig secret will be automatically regenerated
123123
when the certificate expires.
124-
format: date-time
125124
type: string
126125
required:
127126
- secretRef

internal/controller/cacheserver_controller_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var _ = Describe("CacheServer Controller", func() {
3838

3939
typeNamespacedName := types.NamespacedName{
4040
Name: resourceName,
41-
Namespace: "default", // TODO(user):Modify as needed
41+
Namespace: "default",
4242
}
4343
cacheserver := &operatorkcpiov1alpha1.CacheServer{}
4444

@@ -51,6 +51,11 @@ var _ = Describe("CacheServer Controller", func() {
5151
Name: resourceName,
5252
Namespace: "default",
5353
},
54+
Spec: operatorkcpiov1alpha1.CacheServerSpec{
55+
Etcd: operatorkcpiov1alpha1.EtcdConfig{
56+
Endpoints: []string{"https://localhost:2379"},
57+
},
58+
},
5459
// TODO(user): Specify other spec details if needed.
5560
}
5661
Expect(k8sClient.Create(ctx, resource)).To(Succeed())

internal/controller/kubeconfig_controller_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package controller
1818

1919
import (
2020
"context"
21+
"time"
2122

2223
. "github.com/onsi/ginkgo/v2"
2324
. "github.com/onsi/gomega"
@@ -51,7 +52,9 @@ var _ = Describe("Kubeconfig Controller", func() {
5152
Name: resourceName,
5253
Namespace: "default",
5354
},
54-
// TODO(user): Specify other spec details if needed.
55+
Spec: operatorkcpiov1alpha1.KubeconfigSpec{
56+
Validity: metav1.Duration{Duration: time.Duration(24 * time.Hour)},
57+
},
5558
}
5659
Expect(k8sClient.Create(ctx, resource)).To(Succeed())
5760
}

internal/controller/rootshard_controller_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ var _ = Describe("RootShard Controller", func() {
5151
Name: resourceName,
5252
Namespace: "default",
5353
},
54-
// TODO(user): Specify other spec details if needed.
54+
Spec: operatorkcpiov1alpha1.RootShardSpec{
55+
Hostname: "example.kcp.io",
56+
CommonShardSpec: operatorkcpiov1alpha1.CommonShardSpec{
57+
Etcd: operatorkcpiov1alpha1.EtcdConfig{
58+
Endpoints: []string{"https://localhost:2379"},
59+
},
60+
},
61+
},
5562
}
5663
Expect(k8sClient.Create(ctx, resource)).To(Succeed())
5764
}

internal/controller/shard_controller_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var _ = Describe("Shard Controller", func() {
3838

3939
typeNamespacedName := types.NamespacedName{
4040
Name: resourceName,
41-
Namespace: "default", // TODO(user):Modify as needed
41+
Namespace: "default",
4242
}
4343
shard := &operatorkcpiov1alpha1.Shard{}
4444

@@ -51,7 +51,13 @@ var _ = Describe("Shard Controller", func() {
5151
Name: resourceName,
5252
Namespace: "default",
5353
},
54-
// TODO(user): Specify other spec details if needed.
54+
Spec: operatorkcpiov1alpha1.ShardSpec{
55+
CommonShardSpec: operatorkcpiov1alpha1.CommonShardSpec{
56+
Etcd: operatorkcpiov1alpha1.EtcdConfig{
57+
Endpoints: []string{"https://localhost:2379"},
58+
},
59+
},
60+
},
5561
}
5662
Expect(k8sClient.Create(ctx, resource)).To(Succeed())
5763
}

0 commit comments

Comments
 (0)