Skip to content

Commit ca63bee

Browse files
committed
refactor & fix
1 parent b7ce798 commit ca63bee

13 files changed

+106
-110
lines changed

api/v1alpha1/common.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ type SecretRef struct {
6868
Key string `json:"key,omitempty"`
6969
}
7070

71-
type SourceConf struct {
71+
type InputConf struct {
7272
Topics []string `json:"topics,omitempty"`
7373
TopicPattern string `json:"topicPattern,omitempty"`
7474
CustomSerdeSources map[string]string `json:"customSerdeSources,omitempty"`
@@ -85,7 +85,7 @@ type ConsumerConfig struct {
8585
ReceiverQueueSize int32 `json:"receiverQueueSize,omitempty"`
8686
}
8787

88-
type SinkConf struct {
88+
type OutputConf struct {
8989
Topic string `json:"topic,omitempty"`
9090
SinkSerdeClassName string `json:"sinkSerdeClassName,omitempty"`
9191
SinkSchemaType string `json:"sinkSchemaType,omitempty"`

api/v1alpha1/function_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ type FunctionSpec struct {
3737
SinkType string `json:"sinkType,omitempty"`
3838
Replicas *int32 `json:"replicas,omitempty"`
3939
MaxReplicas *int32 `json:"maxReplicas,omitempty"` // if provided, turn on autoscaling
40-
Sources SourceConf `json:"sources,omitempty"`
41-
Sink SinkConf `json:"sink,omitempty"`
40+
Input InputConf `json:"input,omitempty"`
41+
Output OutputConf `json:"output,omitempty"`
4242
LogTopic string `json:"logTopic,omitempty"`
4343
FuncConfig map[string]string `json:"funcConfig,omitempty"`
4444
Resources corev1.ResourceList `json:"resources,omitempty"`

api/v1alpha1/sink_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type SinkSpec struct {
3737
SinkType string `json:"sinkType,omitempty"`
3838
Replicas *int32 `json:"replicas,omitempty"`
3939
MaxReplicas *int32 `json:"maxReplicas,omitempty"` // if provided, turn on autoscaling
40-
Sources SourceConf `json:"sources,omitempty"`
40+
Input InputConf `json:"input,omitempty"`
4141
SinkConfig map[string]string `json:"sinkConfig,omitempty"`
4242
Resources corev1.ResourceList `json:"resources,omitempty"`
4343
SecretsMap map[string]SecretRef `json:"secretsMap,omitempty"`

api/v1alpha1/source_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type SourceSpec struct {
3737
SinkType string `json:"sinkType,omitempty"`
3838
Replicas *int32 `json:"replicas,omitempty"`
3939
MaxReplicas *int32 `json:"maxReplicas,omitempty"` // if provided, turn on autoscaling
40-
Sink SinkConf `json:"sink,omitempty"`
40+
Output OutputConf `json:"output,omitempty"`
4141
SourceConfig map[string]string `json:"sourceConfig,omitempty"`
4242
Resources corev1.ResourceList `json:"resources,omitempty"`
4343
SecretsMap map[string]SecretRef `json:"secretsMap,omitempty"`

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 72 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/cloud.streamnative.io_functionmeshes.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ spec:
135135
type: string
136136
type: object
137137
producerConf:
138-
description: TODO use json tag
139138
properties:
140139
maxPendingMessages:
141140
format: int32
@@ -169,7 +168,6 @@ spec:
169168
type: object
170169
sourceSpecs:
171170
additionalProperties:
172-
description: TODO json tag
173171
properties:
174172
consumerProperties:
175173
additionalProperties:
@@ -310,7 +308,6 @@ spec:
310308
type: object
311309
sourceSpecs:
312310
additionalProperties:
313-
description: TODO json tag
314311
properties:
315312
consumerProperties:
316313
additionalProperties:
@@ -424,7 +421,6 @@ spec:
424421
type: string
425422
type: object
426423
producerConf:
427-
description: TODO use json tag
428424
properties:
429425
maxPendingMessages:
430426
format: int32

config/crd/bases/cloud.streamnative.io_functions.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ spec:
133133
type: string
134134
type: object
135135
producerConf:
136-
description: TODO use json tag
137136
properties:
138137
maxPendingMessages:
139138
format: int32
@@ -167,7 +166,6 @@ spec:
167166
type: object
168167
sourceSpecs:
169168
additionalProperties:
170-
description: TODO json tag
171169
properties:
172170
consumerProperties:
173171
additionalProperties:

config/crd/bases/cloud.streamnative.io_sinks.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ spec:
136136
type: object
137137
sourceSpecs:
138138
additionalProperties:
139-
description: TODO json tag
140139
properties:
141140
consumerProperties:
142141
additionalProperties:

config/crd/bases/cloud.streamnative.io_sources.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ spec:
109109
type: string
110110
type: object
111111
producerConf:
112-
description: TODO use json tag
113112
properties:
114113
maxPendingMessages:
115114
format: int32

config/samples/cloud_v1alpha1_function.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ spec:
88
sinkType: java.lang.String
99
forwardSourceMessageProperty: true
1010
MaxPendingAsyncRequests: 1000
11-
replicas: 0
11+
replicas: 1
1212
maxReplicas: 5
1313
logTopic: persistent://public/default/logging-function-logs
14-
sources:
14+
input:
15+
topics:
1516
- persistent://public/default/source-topic1
16-
sink: persistent://public/default/sink-topic
17+
output:
18+
topic: persistent://public/default/sink-topic
1719
resources:
1820
cpu: "0.2"
1921
memory: 1G

0 commit comments

Comments
 (0)