Skip to content

Commit

Permalink
Make some collections optional
Browse files Browse the repository at this point in the history
  • Loading branch information
disrupted committed Dec 5, 2024
1 parent b5e2b85 commit 7bd074f
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 72 deletions.
86 changes: 57 additions & 29 deletions docs/docs/schema/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,20 @@
"description": "JMX configuration options.",
"properties": {
"metricRules": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "List of JMX metric rules.",
"items": {
"type": "string"
},
"title": "Metricrules",
"type": "array"
"title": "Metricrules"
},
"port": {
"anyOf": [
Expand Down Expand Up @@ -2310,16 +2318,15 @@
"title": "Nameoverride"
},
"persistence": {
"allOf": [
"anyOf": [
{
"$ref": "#/$defs/kpops__components__streams_bootstrap__streams__model__PersistenceConfig"
},
{
"type": "null"
}
],
"default": {
"enabled": false,
"size": null,
"storage_class": null
},
"default": null,
"description": "Configuration for persistent volume to store the state of the streams app."
},
"podAnnotations": {
Expand Down Expand Up @@ -3120,13 +3127,20 @@
"description": "Kubernetes Event-driven Autoscaling config.",
"properties": {
"additionalTriggers": {
"default": [],
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "List of additional KEDA triggers, see https://keda.sh/docs/latest/scalers/",
"items": {
"type": "string"
},
"title": "Additionaltriggers",
"type": "array"
"title": "Additionaltriggers"
},
"cooldownPeriod": {
"anyOf": [
Expand Down Expand Up @@ -3161,13 +3175,20 @@
"title": "Idle replica count"
},
"internalTopics": {
"default": [],
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "List of auto-generated Kafka Streams topics used by the streams app",
"items": {
"type": "string"
},
"title": "Internaltopics",
"type": "array"
"title": "Internaltopics"
},
"lagThreshold": {
"anyOf": [
Expand Down Expand Up @@ -3235,13 +3256,20 @@
"title": "Polling interval"
},
"topics": {
"default": [],
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "List of topics used by the streams app",
"items": {
"type": "string"
},
"title": "Topics",
"type": "array"
"title": "Topics"
}
},
"title": "StreamsAppAutoScaling",
Expand Down
86 changes: 57 additions & 29 deletions docs/docs/schema/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,20 @@
"description": "JMX configuration options.",
"properties": {
"metricRules": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "List of JMX metric rules.",
"items": {
"type": "string"
},
"title": "Metricrules",
"type": "array"
"title": "Metricrules"
},
"port": {
"anyOf": [
Expand Down Expand Up @@ -1970,16 +1978,15 @@
"title": "Nameoverride"
},
"persistence": {
"allOf": [
"anyOf": [
{
"$ref": "#/$defs/kpops__components__streams_bootstrap__streams__model__PersistenceConfig"
},
{
"type": "null"
}
],
"default": {
"enabled": false,
"size": null,
"storage_class": null
},
"default": null,
"description": "Configuration for persistent volume to store the state of the streams app."
},
"podAnnotations": {
Expand Down Expand Up @@ -2334,13 +2341,20 @@
"description": "Kubernetes Event-driven Autoscaling config.",
"properties": {
"additionalTriggers": {
"default": [],
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "List of additional KEDA triggers, see https://keda.sh/docs/latest/scalers/",
"items": {
"type": "string"
},
"title": "Additionaltriggers",
"type": "array"
"title": "Additionaltriggers"
},
"cooldownPeriod": {
"anyOf": [
Expand Down Expand Up @@ -2375,13 +2389,20 @@
"title": "Idle replica count"
},
"internalTopics": {
"default": [],
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "List of auto-generated Kafka Streams topics used by the streams app",
"items": {
"type": "string"
},
"title": "Internaltopics",
"type": "array"
"title": "Internaltopics"
},
"lagThreshold": {
"anyOf": [
Expand Down Expand Up @@ -2449,13 +2470,20 @@
"title": "Polling interval"
},
"topics": {
"default": [],
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "List of topics used by the streams app",
"items": {
"type": "string"
},
"title": "Topics",
"type": "array"
"title": "Topics"
}
},
"title": "StreamsAppAutoScaling",
Expand Down
20 changes: 10 additions & 10 deletions kpops/components/streams_bootstrap/streams/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,16 @@ class StreamsAppAutoScaling(CamelCaseConfigModel, DescConfigModel):
title="Idle replica count",
description=describe_attr("idle_replicas", __doc__),
)
internal_topics: list[str] = Field(
default=[],
internal_topics: list[str] | None = Field(
default=None,
description=describe_attr("internal_topics", __doc__),
)
topics: list[str] = Field(
default=[],
topics: list[str] | None = Field(
default=None,
description=describe_attr("topics", __doc__),
)
additional_triggers: list[str] = Field(
default=[],
additional_triggers: list[str] | None = Field(
default=None,
description=describe_attr("additional_triggers", __doc__),
)
model_config = ConfigDict(extra="allow")
Expand Down Expand Up @@ -289,8 +289,8 @@ class JMXConfig(CamelCaseConfigModel, DescConfigModel):
description=describe_attr("port", __doc__),
)

metric_rules: list[str] = Field(
default_factory=list,
metric_rules: list[str] | None = Field(
default=None,
description=describe_attr("metric_rules", __doc__),
)

Expand Down Expand Up @@ -323,8 +323,8 @@ class StreamsAppValues(StreamsBootstrapValues):
description=describe_attr("stateful_set", __doc__),
)

persistence: PersistenceConfig = Field(
default=PersistenceConfig(),
persistence: PersistenceConfig | None = Field(
default=None,
description=describe_attr("persistence", __doc__),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@
outputTopic: my-output-topic
schemaRegistryUrl: http://localhost:8081/
livenessProbe: {}
persistence:
enabled: false
podAnnotations: {}
podLabels: {}
ports: []
Expand Down Expand Up @@ -239,8 +237,6 @@
outputTopic: my-output-topic
schemaRegistryUrl: http://localhost:8081/
livenessProbe: {}
persistence:
enabled: false
podAnnotations: {}
podLabels: {}
ports: []
Expand Down

0 comments on commit 7bd074f

Please sign in to comment.