Skip to content

Commit

Permalink
Rename MeshConfig to BackendConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangpengcheng committed Mar 26, 2024
1 parent d83f29b commit 6608761
Show file tree
Hide file tree
Showing 40 changed files with 329 additions and 330 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: compute.functionmesh.io/v1alpha1
kind: MeshConfig
kind: BackendConfig
metadata:
name: mesh-global
name: global-backend-config
spec:
env:
global1: globalvalue1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: compute.functionmesh.io/v1alpha1
kind: MeshConfig
kind: BackendConfig
metadata:
name: mesh-namespaced
name: backend-config
namespace: kube-system
spec:
env:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: compute.functionmesh.io/v1alpha1
kind: MeshConfig
kind: BackendConfig
metadata:
name: mesh-namespaced
name: backend-config
namespace: default
spec:
env:
Expand Down
4 changes: 2 additions & 2 deletions .ci/tests/integration/e2e_with_tls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ setup:
image="function-mesh-operator:latest"
IMG=${image} make docker-build-skip-test
kind load docker-image ${image}
helm install ${FUNCTION_MESH_RELEASE_NAME} -n ${FUNCTION_MESH_NAMESPACE} --set operatorImage=${image} --set controllerManager.globalMeshConfig=mesh-global --set controllerManager.globalMeshConfigNamespace=${FUNCTION_MESH_NAMESPACE} --set controllerManager.namespacedMeshConfig=mesh-namespaced --create-namespace charts/function-mesh-operator
helm install ${FUNCTION_MESH_RELEASE_NAME} -n ${FUNCTION_MESH_NAMESPACE} --set operatorImage=${image} --set controllerManager.globalBackendConfig=global-backend-config --set controllerManager.globalBackendConfigNamespace=${FUNCTION_MESH_NAMESPACE} --set controllerManager.namespacedBackendConfig=backend-config --create-namespace charts/function-mesh-operator
wait:
- namespace: function-mesh
resource: pod
Expand All @@ -96,7 +96,7 @@ setup:

- name: apply global env config map
command: |
kubectl create -n ${FUNCTION_MESH_NAMESPACE} -f .ci/clusters/global_mesh.yaml
kubectl create -n ${FUNCTION_MESH_NAMESPACE} -f .ci/clusters/global_backend_config.yaml
timeout: 60m

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
// 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.

// MeshConfigSpec defines the desired state of MeshConfig
// BackendConfigSpec defines the desired state of BackendConfig
// +kubebuilder:validation:Optional
type MeshConfigSpec struct {
type BackendConfigSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Name string `json:"name,omitempty"`
Expand All @@ -35,8 +35,8 @@ type MeshConfigSpec struct {
Env map[string]string `json:"env,omitempty"`
}

// MeshConfigStatus defines the observed state of MeshConfig
type MeshConfigStatus struct {
// BackendConfigStatus defines the observed state of BackendConfig
type BackendConfigStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}
Expand All @@ -46,25 +46,25 @@ type MeshConfigStatus struct {
// +kubebuilder:subresource:status
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector

// MeshConfig is the Schema of the global configs for all functions, sinks and sources
// BackendConfig is the Schema of the global configs for all functions, sinks and sources
// +kubebuilder:pruning:PreserveUnknownFields
type MeshConfig struct {
type BackendConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec MeshConfigSpec `json:"spec,omitempty"`
Status MeshConfigStatus `json:"status,omitempty"`
Spec BackendConfigSpec `json:"spec,omitempty"`
Status BackendConfigStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// MeshConfigList contains a list of MeshConfig
type MeshConfigList struct {
// BackendConfigList contains a list of BackendConfig
type BackendConfigList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []MeshConfig `json:"items"`
Items []BackendConfig `json:"items"`
}

func init() {
SchemeBuilder.Register(&MeshConfig{}, &MeshConfigList{})
SchemeBuilder.Register(&BackendConfig{}, &BackendConfigList{})
}
12 changes: 6 additions & 6 deletions api/compute/v1alpha1/function_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ type FunctionSpec struct {
type FunctionStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
Conditions map[Component]ResourceCondition `json:"conditions"`
Replicas int32 `json:"replicas"`
Selector string `json:"selector"`
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
GlobalMeshConfigRevision string `json:"globalMeshConfigRevision,omitempty"`
NamespacedMeshConfigRevision string `json:"namespacedMeshConfigRevision,omitempty"`
Conditions map[Component]ResourceCondition `json:"conditions"`
Replicas int32 `json:"replicas"`
Selector string `json:"selector"`
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
GlobalBackendConfigRevision string `json:"globalBackendConfigRevision,omitempty"`
NamespacedBackendConfigRevision string `json:"namespacedBackendConfigRevision,omitempty"`
}

// +genclient
Expand Down
12 changes: 6 additions & 6 deletions api/compute/v1alpha1/sink_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ type SinkSpec struct {
type SinkStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
Conditions map[Component]ResourceCondition `json:"conditions"`
Replicas int32 `json:"replicas"`
Selector string `json:"selector"`
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
GlobalMeshConfigRevision string `json:"globalMeshConfigRevision,omitempty"`
NamespacedMeshConfigRevision string `json:"namespacedMeshConfigRevision,omitempty"`
Conditions map[Component]ResourceCondition `json:"conditions"`
Replicas int32 `json:"replicas"`
Selector string `json:"selector"`
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
GlobalBackendConfigRevision string `json:"globalBackendConfigRevision,omitempty"`
NamespacedBackendConfigRevision string `json:"namespacedBackendConfigRevision,omitempty"`
}

// +genclient
Expand Down
12 changes: 6 additions & 6 deletions api/compute/v1alpha1/source_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ type BatchSourceConfig struct {
type SourceStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
Conditions map[Component]ResourceCondition `json:"conditions"`
Replicas int32 `json:"replicas"`
Selector string `json:"selector"`
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
GlobalMeshConfigRevision string `json:"globalMeshConfigRevision,omitempty"`
NamespacedMeshConfigRevision string `json:"namespacedMeshConfigRevision,omitempty"`
Conditions map[Component]ResourceCondition `json:"conditions"`
Replicas int32 `json:"replicas"`
Selector string `json:"selector"`
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
GlobalBackendConfigRevision string `json:"globalBackendConfigRevision,omitempty"`
NamespacedBackendConfigRevision string `json:"namespacedBackendConfigRevision,omitempty"`
}

// +genclient
Expand Down
192 changes: 96 additions & 96 deletions api/compute/v1alpha1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
{{- include "function-mesh-operator.certManager.annotation" . | nindent 4 -}}
{{- end }}
controller-gen.kubebuilder.io/version: v0.9.2
name: meshconfigs.compute.functionmesh.io
name: backendconfigs.compute.functionmesh.io
spec:
conversion:
strategy: Webhook
Expand All @@ -30,10 +30,10 @@ spec:
- v1beta1
group: compute.functionmesh.io
names:
kind: MeshConfig
listKind: MeshConfigList
plural: meshconfigs
singular: meshconfig
kind: BackendConfig
listKind: BackendConfigList
plural: backendconfigs
singular: backendconfig
scope: Namespaced
versions:
- name: v1alpha1
Expand Down
Loading

0 comments on commit 6608761

Please sign in to comment.