Skip to content

Commit 7e7205b

Browse files
authored
Merge pull request #3442 from gman0/cachedresourcesendpointslice-sdk
CachedResourcesEndpointSlice SDK
2 parents de10d92 + d0f9d56 commit 7e7205b

30 files changed

+1676
-0
lines changed
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.17.3
7+
name: cachedresourceendpointslices.cache.kcp.io
8+
spec:
9+
group: cache.kcp.io
10+
names:
11+
categories:
12+
- kcp
13+
kind: CachedResourceEndpointSlice
14+
listKind: CachedResourceEndpointSliceList
15+
plural: cachedresourceendpointslices
16+
singular: cachedresourceendpointslice
17+
scope: Cluster
18+
versions:
19+
- additionalPrinterColumns:
20+
- jsonPath: .spec.cachedResource.name
21+
name: CachedResource
22+
type: string
23+
- jsonPath: .metadata.creationTimestamp
24+
name: Age
25+
type: date
26+
name: v1alpha1
27+
schema:
28+
openAPIV3Schema:
29+
description: CachedResourceEndpointSlice is a sink for the endpoints of CachedResource
30+
virtual workspaces.
31+
properties:
32+
apiVersion:
33+
description: |-
34+
APIVersion defines the versioned schema of this representation of an object.
35+
Servers should convert recognized schemas to the latest internal value, and
36+
may reject unrecognized values.
37+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
38+
type: string
39+
kind:
40+
description: |-
41+
Kind is a string value representing the REST resource this object represents.
42+
Servers may infer this from the endpoint the client submits requests to.
43+
Cannot be updated.
44+
In CamelCase.
45+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
46+
type: string
47+
metadata:
48+
type: object
49+
spec:
50+
description: |-
51+
spec holds the desired state:
52+
- the targeted CachedResource
53+
properties:
54+
cachedResource:
55+
description: CachedResource points to the real CachedResource the
56+
slice is created for.
57+
properties:
58+
name:
59+
description: name is the name of the CachedResource the reference
60+
points to.
61+
type: string
62+
required:
63+
- name
64+
type: object
65+
x-kubernetes-validations:
66+
- message: CachedResource reference must not be changed
67+
rule: self == oldSelf
68+
required:
69+
- cachedResource
70+
type: object
71+
status:
72+
description: |-
73+
status communicates the observed state:
74+
the filtered list of endpoints for the Replication service.
75+
properties:
76+
endpoints:
77+
description: endpoints contains all the URLs of the Replication service.
78+
items:
79+
description: CachedResourceEndpoint contains the endpoint information
80+
of a Replication service for a specific shard.
81+
properties:
82+
url:
83+
description: url is an CachedResource virtual workspace URL.
84+
minLength: 1
85+
type: string
86+
required:
87+
- url
88+
type: object
89+
type: array
90+
x-kubernetes-list-map-keys:
91+
- url
92+
x-kubernetes-list-type: map
93+
type: object
94+
type: object
95+
served: true
96+
storage: true
97+
subresources:
98+
status: {}

config/root-phase0/apiexport-cache.kcp.io.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ metadata:
55
name: cache.kcp.io
66
spec:
77
resources:
8+
- group: cache.kcp.io
9+
name: cachedresourceendpointslices
10+
schema: v250604-36e6abf17.cachedresourceendpointslices.cache.kcp.io
11+
storage:
12+
crd: {}
813
- group: cache.kcp.io
914
name: cachedresources
1015
schema: v250523-2b8c1d3c5.cachedresources.cache.kcp.io
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
apiVersion: apis.kcp.io/v1alpha1
2+
kind: APIResourceSchema
3+
metadata:
4+
creationTimestamp: null
5+
name: v250604-36e6abf17.cachedresourceendpointslices.cache.kcp.io
6+
spec:
7+
group: cache.kcp.io
8+
names:
9+
categories:
10+
- kcp
11+
kind: CachedResourceEndpointSlice
12+
listKind: CachedResourceEndpointSliceList
13+
plural: cachedresourceendpointslices
14+
singular: cachedresourceendpointslice
15+
scope: Cluster
16+
versions:
17+
- additionalPrinterColumns:
18+
- jsonPath: .spec.cachedResource.name
19+
name: CachedResource
20+
type: string
21+
- jsonPath: .metadata.creationTimestamp
22+
name: Age
23+
type: date
24+
name: v1alpha1
25+
schema:
26+
description: CachedResourceEndpointSlice is a sink for the endpoints of CachedResource
27+
virtual workspaces.
28+
properties:
29+
apiVersion:
30+
description: |-
31+
APIVersion defines the versioned schema of this representation of an object.
32+
Servers should convert recognized schemas to the latest internal value, and
33+
may reject unrecognized values.
34+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
35+
type: string
36+
kind:
37+
description: |-
38+
Kind is a string value representing the REST resource this object represents.
39+
Servers may infer this from the endpoint the client submits requests to.
40+
Cannot be updated.
41+
In CamelCase.
42+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
43+
type: string
44+
metadata:
45+
type: object
46+
spec:
47+
description: |-
48+
spec holds the desired state:
49+
- the targeted CachedResource
50+
properties:
51+
cachedResource:
52+
description: CachedResource points to the real CachedResource the slice
53+
is created for.
54+
properties:
55+
name:
56+
description: name is the name of the CachedResource the reference
57+
points to.
58+
type: string
59+
required:
60+
- name
61+
type: object
62+
x-kubernetes-validations:
63+
- message: CachedResource reference must not be changed
64+
rule: self == oldSelf
65+
required:
66+
- cachedResource
67+
type: object
68+
status:
69+
description: |-
70+
status communicates the observed state:
71+
the filtered list of endpoints for the Replication service.
72+
properties:
73+
endpoints:
74+
description: endpoints contains all the URLs of the Replication service.
75+
items:
76+
description: CachedResourceEndpoint contains the endpoint information
77+
of a Replication service for a specific shard.
78+
properties:
79+
url:
80+
description: url is an CachedResource virtual workspace URL.
81+
minLength: 1
82+
type: string
83+
required:
84+
- url
85+
type: object
86+
type: array
87+
x-kubernetes-list-map-keys:
88+
- url
89+
x-kubernetes-list-type: map
90+
type: object
91+
type: object
92+
served: true
93+
storage: true
94+
subresources:
95+
status: {}

config/system-crds/bootstrap.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func Bootstrap(ctx context.Context, crdClient apiextensionsclient.Interface, dis
5858
{Group: core.GroupName, Resource: "logicalclusters"},
5959
{Group: apis.GroupName, Resource: "apiconversions"},
6060
{Group: cache.GroupName, Resource: "cachedresources"},
61+
{Group: cache.GroupName, Resource: "cachedresourceendpointslices"},
6162
}
6263

6364
if err := wait.PollUntilContextCancel(ctx, time.Second, true, func(ctx context.Context) (bool, error) {

0 commit comments

Comments
 (0)