This is an automated email from the ASF dual-hosted git repository.
zhongxjian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-kubernetes.git
The following commit(s) were added to refs/heads/master by this push:
new 03849dca [operator] manifest generate command completed
03849dca is described below
commit 03849dca6f20f9efbefe5a9b208992598ea22e43
Author: mfordjody <[email protected]>
AuthorDate: Thu Dec 26 08:32:23 2024 +0800
[operator] manifest generate command completed
---
dubboctl/my-config.yaml | 935 +++++++++++++++++++++++++++++++++++++++
operator/cmd/cluster/manifest.go | 83 +++-
operator/pkg/util/clog/clog.go | 1 +
3 files changed, 1015 insertions(+), 4 deletions(-)
diff --git a/dubboctl/my-config.yaml b/dubboctl/my-config.yaml
new file mode 100644
index 00000000..d5c96eab
--- /dev/null
+++ b/dubboctl/my-config.yaml
@@ -0,0 +1,935 @@
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: conditionroutes.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: ConditionRoute
+ listKind: ConditionRouteList
+ plural: conditionroutes
+ singular: conditionroute
+ scope: Cluster
+ versions:
+ - name: v1alpha1
+ 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
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the specification of the Dubbo ConditionRoute
resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: dataplaneinsights.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: DataplaneInsight
+ listKind: DataplaneInsightList
+ plural: dataplaneinsights
+ singular: dataplaneinsight
+ scope: Namespaced
+ versions:
+ - name: v1alpha1
+ 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
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ status:
+ description: Status is the status the dubbo resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: dataplanes.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: Dataplane
+ listKind: DataplaneList
+ plural: dataplanes
+ singular: dataplane
+ scope: Namespaced
+ versions:
+ - name: v1alpha1
+ 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
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the specification of the Dubbo Dataplane
resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: datasources.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: DataSource
+ listKind: DataSourceList
+ plural: datasources
+ singular: datasource
+ scope: Cluster
+ versions:
+ - name: v1alpha1
+ 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
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the specification of the Dubbo DataSource
resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: dynamicconfigs.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: DynamicConfig
+ listKind: DynamicConfigList
+ plural: dynamicconfigs
+ singular: dynamicconfig
+ scope: Cluster
+ versions:
+ - name: v1alpha1
+ 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
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the specification of the Dubbo DynamicConfig
resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: mappings.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: Mapping
+ listKind: MappingList
+ plural: mappings
+ singular: mapping
+ scope: Namespaced
+ versions:
+ - name: v1alpha1
+ 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
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the specification of the Dubbo Mapping
resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: meshes.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: Mesh
+ listKind: MeshList
+ plural: meshes
+ singular: mesh
+ scope: Cluster
+ versions:
+ - name: v1alpha1
+ 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
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the specification of the Dubbo Mesh resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: meshinsights.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: MeshInsight
+ listKind: MeshInsightList
+ plural: meshinsights
+ singular: meshinsight
+ scope: Cluster
+ versions:
+ - name: v1alpha1
+ 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
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the specification of the Dubbo MeshInsight
resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: metadata.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: MetaData
+ listKind: MetaDataList
+ plural: metadata
+ singular: metadata
+ scope: Namespaced
+ versions:
+ - name: v1alpha1
+ 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
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the specification of the Dubbo MetaData
resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: secrets.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: Secret
+ listKind: SecretList
+ plural: secrets
+ singular: secret
+ scope: Cluster
+ versions:
+ - name: v1alpha1
+ 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
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the specification of the Dubbo Secret
resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: servicenamemappings.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: ServiceNameMapping
+ listKind: ServiceNameMappingList
+ plural: servicenamemappings
+ singular: servicenamemapping
+ scope: Namespaced
+ versions:
+ - name: v1alpha1
+ 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:
+ description: Spec is the specification of the Dubbo
ServiceNameMapping
+ resource.
+ properties:
+ applicationNames:
+ items:
+ type: string
+ type: array
+ interfaceName:
+ type: string
+ namespace:
+ type: string
+ required:
+ - applicationNames
+ - interfaceName
+ - namespace
+ type: object
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: tagroutes.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: TagRoute
+ listKind: TagRouteList
+ plural: tagroutes
+ singular: tagroute
+ scope: Cluster
+ versions:
+ - name: v1alpha1
+ 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
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the specification of the Dubbo TagRoute
resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: zoneegresses.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: ZoneEgress
+ listKind: ZoneEgressList
+ plural: zoneegresses
+ singular: zoneegress
+ scope: Namespaced
+ versions:
+ - name: v1alpha1
+ 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
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the specification of the Dubbo ZoneEgress
resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: zoneegressinsights.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: ZoneEgressInsight
+ listKind: ZoneEgressInsightList
+ plural: zoneegressinsights
+ singular: zoneegressinsight
+ scope: Namespaced
+ versions:
+ - name: v1alpha1
+ 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
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the specification of the Dubbo
ZoneEgressInsight
+ resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: zoneingresses.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: ZoneIngress
+ listKind: ZoneIngressList
+ plural: zoneingresses
+ singular: zoneingress
+ scope: Namespaced
+ versions:
+ - name: v1alpha1
+ 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
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the specification of the Dubbo ZoneIngress
resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: zoneingressinsights.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: ZoneIngressInsight
+ listKind: ZoneIngressInsightList
+ plural: zoneingressinsights
+ singular: zoneingressinsight
+ scope: Namespaced
+ versions:
+ - name: v1alpha1
+ 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
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the specification of the Dubbo
ZoneIngressInsight
+ resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: zoneinsights.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: ZoneInsight
+ listKind: ZoneInsightList
+ plural: zoneinsights
+ singular: zoneinsight
+ scope: Cluster
+ versions:
+ - name: v1alpha1
+ 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
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the specification of the Dubbo ZoneInsight
resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.14.0
+ name: zones.dubbo.io
+spec:
+ group: dubbo.io
+ names:
+ categories:
+ - dubbo
+ kind: Zone
+ listKind: ZoneList
+ plural: zones
+ singular: zone
+ scope: Cluster
+ versions:
+ - name: v1alpha1
+ 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
+ mesh:
+ description: |-
+ Mesh is the name of the dubbo mesh this resource belongs to.
+ It may be omitted for cluster-scoped resources.
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: Spec is the specification of the Dubbo Zone resource.
+ x-kubernetes-preserve-unknown-fields: true
+ type: object
+ served: true
+ storage: true
+
+---
+apiVersion: v1
+kind: Namespace
+metadata:
+ name: dubbo-system
+
+---
diff --git a/operator/cmd/cluster/manifest.go b/operator/cmd/cluster/manifest.go
index f0576004..63c386c9 100644
--- a/operator/cmd/cluster/manifest.go
+++ b/operator/cmd/cluster/manifest.go
@@ -1,9 +1,16 @@
package cluster
import (
+ "cmp"
"fmt"
"github.com/apache/dubbo-kubernetes/dubboctl/pkg/cli"
+ "github.com/apache/dubbo-kubernetes/operator/pkg/manifest"
+ "github.com/apache/dubbo-kubernetes/operator/pkg/render"
+ "github.com/apache/dubbo-kubernetes/operator/pkg/util/clog"
+ "github.com/apache/dubbo-kubernetes/pkg/kube"
+ "github.com/apache/dubbo-kubernetes/pkg/util/slices"
"github.com/spf13/cobra"
+ "sigs.k8s.io/yaml"
"strings"
)
@@ -31,7 +38,6 @@ func ManifestCmd(ctx cli.Context) *cobra.Command {
rootArgs := &RootArgs{}
mgcArgs := &ManifestGenerateArgs{}
mgc := ManifestGenerateCmd(ctx, rootArgs, mgcArgs)
- ic := InstallCmd(ctx)
mc := &cobra.Command{
Use: "manifest",
Short: "dubbo manifest related commands",
@@ -41,10 +47,11 @@ func ManifestCmd(ctx cli.Context) *cobra.Command {
addFlags(mgc, rootArgs)
addManifestGenerateFlags(mgc, mgcArgs)
mc.AddCommand(mgc)
- mc.AddCommand(ic)
return mc
}
+var kubeClientFunc func() (kube.CLIClient, error)
+
func ManifestGenerateCmd(ctx cli.Context, _ *RootArgs, mgArgs
*ManifestGenerateArgs) *cobra.Command {
return &cobra.Command{
Use: "generate",
@@ -56,7 +63,75 @@ func ManifestGenerateCmd(ctx cli.Context, _ *RootArgs,
mgArgs *ManifestGenerateA
# Generate the demo profile
istioctl manifest generate --set profile=demo
`,
- Args: nil,
- RunE: nil,
+ Args: func(cmd *cobra.Command, args []string) error {
+ if len(args) != 0 {
+ return fmt.Errorf("generate accepts no
positional arguments, got %#v", args)
+ }
+ return nil
+ },
+ RunE: func(cmd *cobra.Command, args []string) error {
+ if kubeClientFunc == nil {
+ kubeClientFunc = ctx.CLIClient
+ }
+ var kubeClient kube.CLIClient
+ kc, err := kubeClientFunc()
+ if err != nil {
+ return err
+ }
+ kubeClient = kc
+
+ cl := clog.NewConsoleLogger(cmd.OutOrStdout(),
cmd.ErrOrStderr(), installerScope)
+ return ManifestGenerate(kubeClient, mgArgs, cl)
+ },
+ }
+}
+
+const (
+ YAMLSeparator = "\n---\n"
+)
+
+func ManifestGenerate(kc kube.CLIClient, mgArgs *ManifestGenerateArgs, cl
clog.Logger) error {
+ setFlags := applyFlagAliases(mgArgs.sets, mgArgs.manifestPath)
+ manifests, _, err := render.GenerateManifest(mgArgs.files, setFlags,
cl, kc)
+ if err != nil {
+ return err
+ }
+ for _, smf := range sortManifests(manifests) {
+ cl.Print(smf + YAMLSeparator)
+ }
+ return nil
+}
+
+func sortManifests(raw []manifest.ManifestSet) []string {
+ all := []manifest.Manifest{}
+ for _, m := range raw {
+ all = append(all, m.Manifests...)
+ }
+ slices.SortStableFunc(all, func(a, b manifest.Manifest) int {
+ if r := cmp.Compare(objectKindOrder(a), objectKindOrder(b)); r
!= 0 {
+ return r
+ }
+ if r := cmp.Compare(a.GroupVersionKind().Group,
b.GroupVersionKind().Group); r != 0 {
+ return r
+ }
+ if r := cmp.Compare(a.GroupVersionKind().Kind,
b.GroupVersionKind().Kind); r != 0 {
+ return r
+ }
+ return cmp.Compare(a.GetName(), b.GetName())
+ })
+ return slices.Map(all, func(e manifest.Manifest) string {
+ res, _ := yaml.Marshal(e.Object)
+ return string(res)
+ })
+}
+
+func objectKindOrder(m manifest.Manifest) int {
+ o := m.Unstructured
+ gk := o.GroupVersionKind().Group + "/" + o.GroupVersionKind().Kind
+ switch {
+ case gk == "apiextensions.k8s.io/CustomResourceDefinition":
+ return -1000
+ default:
+ return 1000
}
}
diff --git a/operator/pkg/util/clog/clog.go b/operator/pkg/util/clog/clog.go
index 1dbdbbf9..09775e6f 100644
--- a/operator/pkg/util/clog/clog.go
+++ b/operator/pkg/util/clog/clog.go
@@ -20,6 +20,7 @@ type Logger interface {
LogAndPrintf(format string, a ...any)
LogAndErrorf(format string, a ...any)
LogAndFatalf(format string, a ...any)
+ Print(s string)
}
func NewConsoleLogger(stdOut, stdErr io.Writer, scope *log.Scope)
*ConsoleLogger {