Skip to content

Commit

Permalink
Merge pull request #184 from cleverhu/add-ClusterSyncResourceTemplate…
Browse files Browse the repository at this point in the history
…-crd

add ClusterSyncResources
  • Loading branch information
Iceber authored Jun 27, 2022
2 parents 86ad680 + ea85f10 commit 8da69ed
Show file tree
Hide file tree
Showing 19 changed files with 661 additions and 17 deletions.
60 changes: 60 additions & 0 deletions charts/_crds/cluster.clusterpedia.io_clustersyncresources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.0
creationTimestamp: null
name: clustersyncresources.cluster.clusterpedia.io
spec:
group: cluster.clusterpedia.io
names:
kind: ClusterSyncResources
listKind: ClusterSyncResourcesList
plural: clustersyncresources
singular: clustersyncresources
scope: Cluster
versions:
- name: v1alpha2
schema:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
properties:
syncResources:
items:
properties:
group:
type: string
resources:
items:
type: string
minItems: 1
type: array
versions:
items:
type: string
type: array
required:
- group
- resources
type: object
type: array
required:
- syncResources
type: object
type: object
served: true
storage: true
2 changes: 2 additions & 0 deletions charts/_crds/cluster.clusterpedia.io_pediaclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ spec:
- resources
type: object
type: array
syncResourcesRefName:
type: string
tokenData:
format: byte
type: string
Expand Down
11 changes: 11 additions & 0 deletions examples/clustersyncresources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: cluster.clusterpedia.io/v1alpha2
kind: ClusterSyncResources
metadata:
name: cluster-sync-resources-example
spec:
syncResources:
- group: ""
resources:
- pods
versions:
- v1
12 changes: 6 additions & 6 deletions examples/pediacluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ spec:
certData:
keyData:
syncResources:
- group: apps
resources:
- deployments
- group: ""
resources:
- pods
- group: apps
resources:
- deployments
- group: ""
resources:
- pods
9 changes: 6 additions & 3 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ client-gen \
--input-base="github.com/clusterpedia-io/api" \
--input="cluster/v1alpha2" \
--output-package="github.com/clusterpedia-io/clusterpedia/pkg/generated/clientset" \
--clientset-name="versioned"
--clientset-name="versioned" \
--plural-exceptions="ClusterSyncResources:ClusterSyncResources"

echo "Generating with lister-gen"
lister-gen \
--go-header-file="hack/boilerplate.go.txt" \
--input-dirs="github.com/clusterpedia-io/api/cluster/v1alpha2" \
--output-package="github.com/clusterpedia-io/clusterpedia/pkg/generated/listers"
--output-package="github.com/clusterpedia-io/clusterpedia/pkg/generated/listers" \
--plural-exceptions="ClusterSyncResources:ClusterSyncResources"

echo "Generating with informer-gen"
informer-gen \
Expand All @@ -67,7 +69,8 @@ informer-gen \
--output-package="github.com/clusterpedia-io/clusterpedia/pkg/generated/informers" \
--versioned-clientset-package="github.com/clusterpedia-io/clusterpedia/pkg/generated/clientset/versioned" \
--listers-package="github.com/clusterpedia-io/clusterpedia/pkg/generated/listers" \
--output-package="github.com/clusterpedia-io/clusterpedia/pkg/generated/informers"
--output-package="github.com/clusterpedia-io/clusterpedia/pkg/generated/informers" \
--plural-exceptions="ClusterSyncResources:ClusterSyncResources"

#echo "Generating with openapi-gen"
#openapi-gen \
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8da69ed

Please sign in to comment.