-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Phoeniix Zhao <[email protected]>
- Loading branch information
1 parent
3a75bdc
commit 07a59b9
Showing
17 changed files
with
539 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
debug/ | ||
target/ | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
bin/* | ||
Dockerfile.cross | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
# Test binary, build with `go test -c` | ||
*.test | ||
|
||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
*.pdb | ||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Added by cargo | ||
# Kubernetes Generated files - skip generated files, except for vendored files | ||
|
||
/target | ||
!vendor/**/zz_generated.* | ||
|
||
.DS_Store | ||
.vscode | ||
# editor and IDE paraphernalia | ||
.idea | ||
out/ | ||
examples/crd.yml | ||
.vscode | ||
*.swp | ||
*.swo | ||
*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
Copyright 2023. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// Package v1alpha1 contains API Schema definitions for the v1alpha1 API group | ||
// +kubebuilder:object:generate=true | ||
// +groupName=xline.kvstore.datenlord.com | ||
package v1alpha1 | ||
|
||
import ( | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"sigs.k8s.io/controller-runtime/pkg/scheme" | ||
) | ||
|
||
var ( | ||
// GroupVersion is group version used to register these objects | ||
GroupVersion = schema.GroupVersion{Group: "xline.kvstore.datenlord.com", Version: "v1alpha1"} | ||
|
||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme | ||
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} | ||
|
||
// AddToScheme adds the types in this group-version to the given scheme. | ||
AddToScheme = SchemeBuilder.AddToScheme | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
Copyright 2023. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! | ||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||
|
||
// XlineClusterSpec defines the desired state of XlineCluster | ||
type XlineClusterSpec struct { | ||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
|
||
// Foo is an example field of XlineCluster. Edit xlinecluster_types.go to remove/update | ||
Foo string `json:"foo,omitempty"` | ||
} | ||
|
||
// XlineClusterStatus defines the observed state of XlineCluster | ||
type XlineClusterStatus struct { | ||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
|
||
// XlineCluster is the Schema for the xlineclusters API | ||
type XlineCluster struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec XlineClusterSpec `json:"spec,omitempty"` | ||
Status XlineClusterStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// XlineClusterList contains a list of XlineCluster | ||
type XlineClusterList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []XlineCluster `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&XlineCluster{}, &XlineClusterList{}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# This kustomization.yaml is not intended to be run by itself, | ||
# since it depends on service name and namespace that are out of this kustomize package. | ||
# It should be run by config/default | ||
resources: | ||
- bases/xline.kvstore.datenlord.com_xlineclusters.yaml | ||
#+kubebuilder:scaffold:crdkustomizeresource | ||
|
||
patches: | ||
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. | ||
# patches here are for enabling the conversion webhook for each CRD | ||
#- path: patches/webhook_in_xlineclusters.yaml | ||
#+kubebuilder:scaffold:crdkustomizewebhookpatch | ||
|
||
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix. | ||
# patches here are for enabling the CA injection for each CRD | ||
#- path: patches/cainjection_in_xlineclusters.yaml | ||
#+kubebuilder:scaffold:crdkustomizecainjectionpatch | ||
|
||
# [WEBHOOK] To enable webhook, uncomment the following section | ||
# the following config is for teaching kustomize how to do kustomization for CRDs. | ||
|
||
#configurations: | ||
#- kustomizeconfig.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This file is for teaching kustomize how to substitute name and namespace reference in CRD | ||
nameReference: | ||
- kind: Service | ||
version: v1 | ||
fieldSpecs: | ||
- kind: CustomResourceDefinition | ||
version: v1 | ||
group: apiextensions.k8s.io | ||
path: spec/conversion/webhook/clientConfig/service/name | ||
|
||
namespace: | ||
- kind: CustomResourceDefinition | ||
version: v1 | ||
group: apiextensions.k8s.io | ||
path: spec/conversion/webhook/clientConfig/service/namespace | ||
create: false | ||
|
||
varReference: | ||
- path: metadata/annotations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# permissions for end users to edit xlineclusters. | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: clusterrole | ||
app.kubernetes.io/instance: xlinecluster-editor-role | ||
app.kubernetes.io/component: rbac | ||
app.kubernetes.io/created-by: xline-operator | ||
app.kubernetes.io/part-of: xline-operator | ||
app.kubernetes.io/managed-by: kustomize | ||
name: xlinecluster-editor-role | ||
rules: | ||
- apiGroups: | ||
- xline.kvstore.datenlord.com | ||
resources: | ||
- xlineclusters | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- xline.kvstore.datenlord.com | ||
resources: | ||
- xlineclusters/status | ||
verbs: | ||
- get |
Oops, something went wrong.