Skip to content

Commit e847740

Browse files
author
hang.jiang
committed
adapt code to new crds
Signed-off-by: hang.jiang <[email protected]>
1 parent b83a154 commit e847740

File tree

56 files changed

+538
-541
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+538
-541
lines changed

.github/workflows/call-offline-build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ jobs:
3737
KUBEAN_TAG: ${{ github.ref_name }}
3838
KUBESPRAY_TAG: ${{ env.SPRAY_SHA_SHORT }}
3939
run: |
40-
bash artifacts/manage_version_cr.sh create_infomanifest
41-
bash artifacts/manage_version_cr.sh create_offlineversion
40+
bash artifacts/manage_version_cr.sh create_manifest
41+
bash artifacts/manage_version_cr.sh create_localartifactset
4242
4343
echo "kubeanofflineversion cr output:"
4444
cat ${KUBEAN_TAG}/kubeanofflineversion.cr.yaml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ helm install kubean kubean-io/kubean --create-namespace -n kubean-system
1717

1818
Then check kubean-operator status by `kubectl get pods -n kubean-system | grep 'kubean'`.
1919

20-
## Start KuBeanClusterOps for cluster.yml playbook
20+
## Start ClusterOperation for cluster.yml playbook
2121

2222
We cloud use the example in folder `artifacts/demo` which uses online resources to install k8s cluster.
2323

api/apis/cluster/v1alpha1/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const (
5353
)
5454

5555
type ClusterCondition struct {
56-
// ClusterOps refers to the name of KuBeanClusterOps.
56+
// ClusterOps refers to the name of ClusterOperation.
5757
// +required
5858
ClusterOps string `json:"clusterOps"`
5959
// +optional
@@ -77,6 +77,6 @@ type ClusterList struct {
7777
metav1.TypeMeta `json:",inline"`
7878
metav1.ListMeta `json:"metadata,omitempty"`
7979

80-
// Items holds a list of KuBeanCluster.
80+
// Items holds a list of Cluster.
8181
Items []Cluster `json:"items"`
8282
}

api/apis/clusteroperation/v1alpha1/types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ const (
3434

3535
// Spec defines the desired state of a member cluster.
3636
type Spec struct {
37-
// KuBeanCluster the name of KuBeanCluster.
37+
// Cluster the name of Cluster.kubean.io.
3838
// +required
39-
KuBeanCluster string `json:"kuBeanCluster"`
39+
Cluster string `json:"cluster"`
4040
// HostsConfRef will be filled by operator when it performs backup.
4141
// +optional
4242
HostsConfRef *apis.ConfigMapRef `json:"hostsConfRef"`
@@ -114,6 +114,6 @@ type ClusterOperationList struct {
114114
metav1.TypeMeta `json:",inline"`
115115
metav1.ListMeta `json:"metadata,omitempty"`
116116

117-
// Items holds a list of KuBeanClusterOps.
117+
// Items holds a list of ClusterOperation.
118118
Items []ClusterOperation `json:"items"`
119119
}

api/apis/localartifactset/v1alpha1/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type LocalArtifactSetList struct {
4242
metav1.TypeMeta `json:",inline"`
4343
metav1.ListMeta `json:"metadata,omitempty"`
4444

45-
// Items holds a list of KuBeanClusterOps.
45+
// Items holds a list of ClusterOperation.
4646
Items []LocalArtifactSet `json:"items"`
4747
}
4848

api/charts/crds/kubean.io_clusteroperations.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ spec:
4747
type: string
4848
backoffLimit:
4949
type: integer
50+
cluster:
51+
description: Cluster the name of Cluster.kubean.io.
52+
type: string
5053
entrypointSHRef:
5154
description: EntrypointSHRef will be filled by operator when it renders
5255
entrypoint.sh.
@@ -75,9 +78,6 @@ spec:
7578
type: object
7679
image:
7780
type: string
78-
kuBeanCluster:
79-
description: KuBeanCluster the name of KuBeanCluster.
80-
type: string
8181
postHook:
8282
items:
8383
properties:
@@ -134,8 +134,8 @@ spec:
134134
- action
135135
- actionType
136136
- backoffLimit
137+
- cluster
137138
- image
138-
- kuBeanCluster
139139
type: object
140140
status:
141141
description: Status contains information about the current status of a

api/charts/crds/kubean.io_clusters.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ spec:
9797
items:
9898
properties:
9999
clusterOps:
100-
description: ClusterOps refers to the name of KuBeanClusterOps.
100+
description: ClusterOps refers to the name of ClusterOperation.
101101
type: string
102102
endTime:
103103
format: date-time

api/constants/constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package constants
22

3-
const InfoManifestGlobal = "infomanifest-global"
3+
const InfoManifestGlobal = "manifest-global"
44

55
const KubeanClusterLabelKey = "clusterName"
66

api/hack/update-codegen.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,14 @@ client-gen \
3939
--input-base="" \
4040
--input=kubean.io/api/apis/$SubDirName/v1alpha1 \
4141
--output-package=kubean.io/api/generated/$SubDirName/clientset \
42-
--clientset-name=versioned \
43-
--plural-exceptions="KuBeanClusterOps:KuBeanClusterOps"
42+
--clientset-name=versioned
4443

4544
echo "Generating with lister-gen"
4645
GO111MODULE=on go install k8s.io/code-generator/cmd/lister-gen
4746
lister-gen \
4847
--go-header-file hack/boilerplate/boilerplate.go.txt \
4948
--input-dirs=kubean.io/api/apis/$SubDirName/v1alpha1 \
50-
--output-package=kubean.io/api/generated/$SubDirName/listers \
51-
--plural-exceptions="KuBeanClusterOps:KuBeanClusterOps"
49+
--output-package=kubean.io/api/generated/$SubDirName/listers
5250

5351
echo "Generating with informer-gen"
5452
GO111MODULE=on go install k8s.io/code-generator/cmd/informer-gen
@@ -57,8 +55,7 @@ informer-gen \
5755
--input-dirs=kubean.io/api/apis/$SubDirName/v1alpha1 \
5856
--versioned-clientset-package=kubean.io/api/generated/$SubDirName/clientset/versioned \
5957
--listers-package=kubean.io/api/generated/$SubDirName/listers \
60-
--output-package=kubean.io/api/generated/$SubDirName/informers \
61-
--plural-exceptions="KuBeanClusterOps:KuBeanClusterOps"
58+
--output-package=kubean.io/api/generated/$SubDirName/informers
6259

6360
if ls "$GOPATH"/src | grep kubean.io; then
6461
cp -r "$GOPATH"/src/kubean.io/api/apis/$SubDirName/v1alpha1/*.go apis/$SubDirName/v1alpha1/

artifacts/demo/kubeanCluster.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: kubean.io/v1alpha1
2-
kind: KuBeanCluster
2+
kind: Cluster
33
metadata:
44
name: cluster1-demo
55
labels:

0 commit comments

Comments
 (0)