diff --git a/api/v1alpha1/common.go b/api/v1alpha1/common.go index 7e4f19ed..30233cb8 100644 --- a/api/v1alpha1/common.go +++ b/api/v1alpha1/common.go @@ -98,40 +98,79 @@ type PackageContentRef struct { // Resources indicates the resources for the pulsar functions and connectors type Resources struct { - CPU string `json:"cpu"` - Disk int64 `json:"disk"` - RAM int64 `json:"ram"` + // +optional + CPU string `json:"cpu,omitempty"` + + // +optional + Disk int64 `json:"disk,omitempty"` + + // +optional + RAM int64 `json:"ram,omitempty"` } // ProducerConfig represents the configuration for the producer of the pulsar functions and connectors type ProducerConfig struct { - MaxPendingMessages int `json:"maxPendingMessages" yaml:"maxPendingMessages"` - MaxPendingMessagesAcrossPartitions int `json:"maxPendingMessagesAcrossPartitions" yaml:"maxPendingMessagesAcrossPartitions"` + // +optional + MaxPendingMessages int `json:"maxPendingMessages,omitempty" yaml:"maxPendingMessages"` + + // +optional + MaxPendingMessagesAcrossPartitions int `json:"maxPendingMessagesAcrossPartitions,omitempty" yaml:"maxPendingMessagesAcrossPartitions"` + + // +optional + UseThreadLocalProducers bool `json:"useThreadLocalProducers,omitempty" yaml:"useThreadLocalProducers"` - UseThreadLocalProducers bool `json:"useThreadLocalProducers" yaml:"useThreadLocalProducers"` - CryptoConfig *CryptoConfig `json:"cryptoConfig" yaml:"cryptoConfig"` - BatchBuilder string `json:"batchBuilder" yaml:"batchBuilder"` - CompressionType string `json:"compressionType" yaml:"compressionType"` + // +optional + CryptoConfig *CryptoConfig `json:"cryptoConfig,omitempty" yaml:"cryptoConfig"` + + // +optional + BatchBuilder string `json:"batchBuilder,omitempty" yaml:"batchBuilder"` + + // +optional + CompressionType string `json:"compressionType,omitempty" yaml:"compressionType"` } // ConsumerConfig represents the configuration for the consumer of the pulsar functions and connectors type ConsumerConfig struct { - SchemaType string `json:"schemaType,omitempty" yaml:"schemaType"` - SerdeClassName string `json:"serdeClassName,omitempty" yaml:"serdeClassName"` - RegexPattern bool `json:"regexPattern,omitempty" yaml:"regexPattern"` - ReceiverQueueSize int `json:"receiverQueueSize,omitempty" yaml:"receiverQueueSize"` - SchemaProperties map[string]string `json:"schemaProperties,omitempty" yaml:"schemaProperties"` + // +optional + SchemaType string `json:"schemaType,omitempty" yaml:"schemaType"` + + // +optional + SerdeClassName string `json:"serdeClassName,omitempty" yaml:"serdeClassName"` + + // +optional + RegexPattern bool `json:"regexPattern,omitempty" yaml:"regexPattern"` + + // +optional + ReceiverQueueSize int `json:"receiverQueueSize,omitempty" yaml:"receiverQueueSize"` + + // +optional + SchemaProperties map[string]string `json:"schemaProperties,omitempty" yaml:"schemaProperties"` + + // +optional ConsumerProperties map[string]string `json:"consumerProperties,omitempty" yaml:"consumerProperties"` - CryptoConfig *CryptoConfig `json:"cryptoConfig,omitempty" yaml:"cryptoConfig"` - PoolMessages bool `json:"poolMessages,omitempty" yaml:"poolMessages"` + + // +optional + CryptoConfig *CryptoConfig `json:"cryptoConfig,omitempty" yaml:"cryptoConfig"` + + // +optional + PoolMessages bool `json:"poolMessages,omitempty" yaml:"poolMessages"` } // CryptoConfig represents the configuration for the crypto of the pulsar functions and connectors type CryptoConfig struct { - CryptoKeyReaderClassName string `json:"cryptoKeyReaderClassName" yaml:"cryptoKeyReaderClassName"` - CryptoKeyReaderConfig map[string]string `json:"cryptoKeyReaderConfig" yaml:"cryptoKeyReaderConfig"` - EncryptionKeys []string `json:"encryptionKeys" yaml:"encryptionKeys"` - ProducerCryptoFailureAction string `json:"producerCryptoFailureAction" yaml:"producerCryptoFailureAction"` - ConsumerCryptoFailureAction string `json:"consumerCryptoFailureAction" yaml:"consumerCryptoFailureAction"` + // +optional + CryptoKeyReaderClassName string `json:"cryptoKeyReaderClassName,omitempty" yaml:"cryptoKeyReaderClassName"` + + // +optional + CryptoKeyReaderConfig map[string]string `json:"cryptoKeyReaderConfig,omitempty" yaml:"cryptoKeyReaderConfig"` + + // +optional + EncryptionKeys []string `json:"encryptionKeys,omitempty" yaml:"encryptionKeys"` + + // +optional + ProducerCryptoFailureAction string `json:"producerCryptoFailureAction,omitempty" yaml:"producerCryptoFailureAction"` + + // +optional + ConsumerCryptoFailureAction string `json:"consumerCryptoFailureAction,omitempty" yaml:"consumerCryptoFailureAction"` } diff --git a/api/v1alpha1/pulsarfunction_types.go b/api/v1alpha1/pulsarfunction_types.go index 2fa8445c..8a6dfe04 100644 --- a/api/v1alpha1/pulsarfunction_types.go +++ b/api/v1alpha1/pulsarfunction_types.go @@ -206,16 +206,35 @@ type PulsarFunctionSpec struct { // WindowConfig defines the window config of the function type WindowConfig struct { - WindowLengthCount *int `json:"windowLengthCount" yaml:"windowLengthCount"` - WindowLengthDurationMs *int64 `json:"windowLengthDurationMs" yaml:"windowLengthDurationMs"` - SlidingIntervalCount *int `json:"slidingIntervalCount" yaml:"slidingIntervalCount"` - SlidingIntervalDurationMs *int64 `json:"slidingIntervalDurationMs" yaml:"slidingIntervalDurationMs"` - LateDataTopic *string `json:"lateDataTopic" yaml:"lateDataTopic"` - MaxLagMs *int64 `json:"maxLagMs" yaml:"maxLagMs"` - WatermarkEmitIntervalMs *int64 `json:"watermarkEmitIntervalMs" yaml:"watermarkEmitIntervalMs"` - TimestampExtractorClassName *string `json:"timestampExtractorClassName" yaml:"timestampExtractorClassName"` - ActualWindowFunctionClassName *string `json:"actualWindowFunctionClassName" yaml:"actualWindowFunctionClassName"` - ProcessingGuarantees *string `json:"processingGuarantees" yaml:"processingGuarantees"` + // +optional + WindowLengthCount *int `json:"windowLengthCount,omitempty" yaml:"windowLengthCount"` + + // +optional + WindowLengthDurationMs *int64 `json:"windowLengthDurationMs,omitempty" yaml:"windowLengthDurationMs"` + + // +optional + SlidingIntervalCount *int `json:"slidingIntervalCount,omitempty" yaml:"slidingIntervalCount"` + + // +optional + SlidingIntervalDurationMs *int64 `json:"slidingIntervalDurationMs,omitempty" yaml:"slidingIntervalDurationMs"` + + // +optional + LateDataTopic *string `json:"lateDataTopic,omitempty" yaml:"lateDataTopic"` + + // +optional + MaxLagMs *int64 `json:"maxLagMs,omitempty" yaml:"maxLagMs"` + + // +optional + WatermarkEmitIntervalMs *int64 `json:"watermarkEmitIntervalMs,omitempty" yaml:"watermarkEmitIntervalMs"` + + // +optional + TimestampExtractorClassName *string `json:"timestampExtractorClassName,omitempty" yaml:"timestampExtractorClassName"` + + // +optional + ActualWindowFunctionClassName *string `json:"actualWindowFunctionClassName,omitempty" yaml:"actualWindowFunctionClassName"` + + // +optional + ProcessingGuarantees *string `json:"processingGuarantees,omitempty" yaml:"processingGuarantees"` } // PulsarFunctionStatus defines the observed state of PulsarFunction diff --git a/api/v1alpha1/pulsarsource_types.go b/api/v1alpha1/pulsarsource_types.go index cdcb61c1..c90e750a 100644 --- a/api/v1alpha1/pulsarsource_types.go +++ b/api/v1alpha1/pulsarsource_types.go @@ -110,9 +110,11 @@ type PulsarSourceSpec struct { // BatchSourceConfig represents the batch source config of the PulsarSource type BatchSourceConfig struct { - DiscoveryTriggererClassName string `json:"discoveryTriggererClassName" yaml:"discoveryTriggererClassName"` + // +optional + DiscoveryTriggererClassName string `json:"discoveryTriggererClassName,omitempty" yaml:"discoveryTriggererClassName"` - DiscoveryTriggererConfig *apiextensionsv1.JSON `json:"discoveryTriggererConfig" yaml:"discoveryTriggererConfig"` + // +optional + DiscoveryTriggererConfig *apiextensionsv1.JSON `json:"discoveryTriggererConfig,omitempty" yaml:"discoveryTriggererConfig"` } // PulsarSourceStatus defines the observed state of PulsarSource diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 9990511c..eda759e0 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -1,4 +1,4 @@ -// Copyright 2022 StreamNative +// Copyright 2024 StreamNative // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/config/crd/bases/resource.streamnative.io_pulsarconnections.yaml b/config/crd/bases/resource.streamnative.io_pulsarconnections.yaml index b8ce0ad8..8ce5ac5b 100644 --- a/config/crd/bases/resource.streamnative.io_pulsarconnections.yaml +++ b/config/crd/bases/resource.streamnative.io_pulsarconnections.yaml @@ -1,17 +1,3 @@ -# Copyright 2024 StreamNative -# -# 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. - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/config/crd/bases/resource.streamnative.io_pulsarfunctions.yaml b/config/crd/bases/resource.streamnative.io_pulsarfunctions.yaml index 1de5bcff..d1a1c24b 100644 --- a/config/crd/bases/resource.streamnative.io_pulsarfunctions.yaml +++ b/config/crd/bases/resource.streamnative.io_pulsarfunctions.yaml @@ -1,17 +1,3 @@ -# Copyright 2024 StreamNative -# -# 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. - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition @@ -162,12 +148,6 @@ spec: type: array producerCryptoFailureAction: type: string - required: - - consumerCryptoFailureAction - - cryptoKeyReaderClassName - - cryptoKeyReaderConfig - - encryptionKeys - - producerCryptoFailureAction type: object poolMessages: type: boolean @@ -272,12 +252,6 @@ spec: type: array producerCryptoFailureAction: type: string - required: - - consumerCryptoFailureAction - - cryptoKeyReaderClassName - - cryptoKeyReaderConfig - - encryptionKeys - - producerCryptoFailureAction type: object maxPendingMessages: type: integer @@ -285,13 +259,6 @@ spec: type: integer useThreadLocalProducers: type: boolean - required: - - batchBuilder - - compressionType - - cryptoConfig - - maxPendingMessages - - maxPendingMessagesAcrossPartitions - - useThreadLocalProducers type: object py: description: Py is the py of the function @@ -310,10 +277,6 @@ spec: ram: format: int64 type: integer - required: - - cpu - - disk - - ram type: object retainKeyOrdering: description: RetainKeyOrdering is the flag to indicate whether the @@ -392,17 +355,6 @@ spec: windowLengthDurationMs: format: int64 type: integer - required: - - actualWindowFunctionClassName - - lateDataTopic - - maxLagMs - - processingGuarantees - - slidingIntervalCount - - slidingIntervalDurationMs - - timestampExtractorClassName - - watermarkEmitIntervalMs - - windowLengthCount - - windowLengthDurationMs type: object required: - connectionRef diff --git a/config/crd/bases/resource.streamnative.io_pulsargeoreplications.yaml b/config/crd/bases/resource.streamnative.io_pulsargeoreplications.yaml index 03c7d2d6..4f177d58 100644 --- a/config/crd/bases/resource.streamnative.io_pulsargeoreplications.yaml +++ b/config/crd/bases/resource.streamnative.io_pulsargeoreplications.yaml @@ -1,17 +1,3 @@ -# Copyright 2024 StreamNative -# -# 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. - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/config/crd/bases/resource.streamnative.io_pulsarnamespaces.yaml b/config/crd/bases/resource.streamnative.io_pulsarnamespaces.yaml index c9855b7f..8528b885 100644 --- a/config/crd/bases/resource.streamnative.io_pulsarnamespaces.yaml +++ b/config/crd/bases/resource.streamnative.io_pulsarnamespaces.yaml @@ -1,17 +1,3 @@ -# Copyright 2024 StreamNative -# -# 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. - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/config/crd/bases/resource.streamnative.io_pulsarpackages.yaml b/config/crd/bases/resource.streamnative.io_pulsarpackages.yaml index eb3b62b8..8a609182 100644 --- a/config/crd/bases/resource.streamnative.io_pulsarpackages.yaml +++ b/config/crd/bases/resource.streamnative.io_pulsarpackages.yaml @@ -1,17 +1,3 @@ -# Copyright 2024 StreamNative -# -# 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. - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/config/crd/bases/resource.streamnative.io_pulsarpermissions.yaml b/config/crd/bases/resource.streamnative.io_pulsarpermissions.yaml index 2ab07071..af701bf4 100644 --- a/config/crd/bases/resource.streamnative.io_pulsarpermissions.yaml +++ b/config/crd/bases/resource.streamnative.io_pulsarpermissions.yaml @@ -1,17 +1,3 @@ -# Copyright 2024 StreamNative -# -# 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. - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/config/crd/bases/resource.streamnative.io_pulsarsinks.yaml b/config/crd/bases/resource.streamnative.io_pulsarsinks.yaml index fc0fe8a2..9cfc9dbd 100644 --- a/config/crd/bases/resource.streamnative.io_pulsarsinks.yaml +++ b/config/crd/bases/resource.streamnative.io_pulsarsinks.yaml @@ -1,17 +1,3 @@ -# Copyright 2024 StreamNative -# -# 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. - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition @@ -136,12 +122,6 @@ spec: type: array producerCryptoFailureAction: type: string - required: - - consumerCryptoFailureAction - - cryptoKeyReaderClassName - - cryptoKeyReaderConfig - - encryptionKeys - - producerCryptoFailureAction type: object poolMessages: type: boolean @@ -206,10 +186,6 @@ spec: ram: format: int64 type: integer - required: - - cpu - - disk - - ram type: object retainKeyOrdering: description: RetainKeyOrdering is the flag to enable or disable the diff --git a/config/crd/bases/resource.streamnative.io_pulsarsources.yaml b/config/crd/bases/resource.streamnative.io_pulsarsources.yaml index fa165869..6d631de6 100644 --- a/config/crd/bases/resource.streamnative.io_pulsarsources.yaml +++ b/config/crd/bases/resource.streamnative.io_pulsarsources.yaml @@ -1,17 +1,3 @@ -# Copyright 2024 StreamNative -# -# 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. - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition @@ -87,9 +73,6 @@ spec: type: string discoveryTriggererConfig: x-kubernetes-preserve-unknown-fields: true - required: - - discoveryTriggererClassName - - discoveryTriggererConfig type: object className: description: ClassName is the class name of the @@ -160,12 +143,6 @@ spec: type: array producerCryptoFailureAction: type: string - required: - - consumerCryptoFailureAction - - cryptoKeyReaderClassName - - cryptoKeyReaderConfig - - encryptionKeys - - producerCryptoFailureAction type: object maxPendingMessages: type: integer @@ -173,13 +150,6 @@ spec: type: integer useThreadLocalProducers: type: boolean - required: - - batchBuilder - - compressionType - - cryptoConfig - - maxPendingMessages - - maxPendingMessagesAcrossPartitions - - useThreadLocalProducers type: object resources: description: Resources is the resources of the PulsarSource @@ -192,10 +162,6 @@ spec: ram: format: int64 type: integer - required: - - cpu - - disk - - ram type: object runtimeFlags: description: RuntimeFlags is the runtime flags of the PulsarSource diff --git a/config/crd/bases/resource.streamnative.io_pulsartenants.yaml b/config/crd/bases/resource.streamnative.io_pulsartenants.yaml index d4d83ba4..39ffd176 100644 --- a/config/crd/bases/resource.streamnative.io_pulsartenants.yaml +++ b/config/crd/bases/resource.streamnative.io_pulsartenants.yaml @@ -1,17 +1,3 @@ -# Copyright 2024 StreamNative -# -# 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. - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/config/crd/bases/resource.streamnative.io_pulsartopics.yaml b/config/crd/bases/resource.streamnative.io_pulsartopics.yaml index 09a384a1..4c435101 100644 --- a/config/crd/bases/resource.streamnative.io_pulsartopics.yaml +++ b/config/crd/bases/resource.streamnative.io_pulsartopics.yaml @@ -1,17 +1,3 @@ -# Copyright 2024 StreamNative -# -# 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. - --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition