Skip to content

Commit 0405fa6

Browse files
committed
test: Add CRD roundtrip test data
1 parent 38ca0ec commit 0405fa6

1 file changed

Lines changed: 89 additions & 1 deletion

File tree

  • rust/operator-binary/src/crd

rust/operator-binary/src/crd/mod.rs

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,95 @@ mod tests {
595595

596596
impl RoundtripTestData for v1alpha1::NifiClusterSpec {
597597
fn roundtrip_test_data() -> Vec<Self> {
598-
vec![]
598+
stackable_operator::utils::yaml_from_str_singleton_map(indoc::indoc! {r#"
599+
- image:
600+
productVersion: 1.2.3
601+
pullPolicy: IfNotPresent
602+
clusterOperation:
603+
stopped: false
604+
reconciliationPaused: false
605+
clusterConfig:
606+
zookeeperConfigMapName: nifi-znode
607+
authentication:
608+
- authenticationClass: nifi-users
609+
hostHeaderCheck:
610+
allowAll: false
611+
additionalAllowedHosts:
612+
- example.com:1234
613+
sensitiveProperties:
614+
keySecret: nifi-sensitive-property-key
615+
customComponentsGitSync:
616+
- repo: ssh://git@github.com/stackable-airflow/dags.git
617+
- repo: https://github.com/stackable-airflow/dags
618+
branch: main
619+
credentials:
620+
basicAuthSecretName: my-basic-auth
621+
wait: 5s
622+
gitSyncConf:
623+
foo: bar
624+
gitFolder: "mount-dags-gitsync/dags_airflow3"
625+
tls:
626+
verification:
627+
server:
628+
caCert:
629+
secretClass: git-ca-cert
630+
- repo: ssh://git@github.com/stackable-airflow/dags.git
631+
# FIXME: The roundtrip looses data when private keys are used.
632+
# See https://github.com/stackabletech/issues/issues/849 for details.
633+
credentials:
634+
sshPrivateKeySecretName: my-private-key
635+
vectorAggregatorConfigMapName: vector-aggregator-discovery
636+
nodes:
637+
envOverrides:
638+
COMMON_VAR: role-value
639+
ROLE_VAR: role-value
640+
configOverrides:
641+
nifi.properties:
642+
nifi.diagnostics.on.shutdown.enabled: "true"
643+
nifi.diagnostics.on.shutdown.verbose: "false"
644+
config:
645+
logging:
646+
enableVectorAgent: true
647+
resources:
648+
cpu:
649+
min: 500m
650+
max: "1"
651+
memory:
652+
limit: 2Gi
653+
storage:
654+
flowfileRepo:
655+
capacity: 2Gi
656+
provenanceRepo:
657+
capacity: 2Gi
658+
databaseRepo:
659+
capacity: 2Gi
660+
contentRepo:
661+
capacity: 2Gi
662+
stateRepo:
663+
capacity: 2Gi
664+
roleConfig:
665+
listenerClass: my-listener-class
666+
roleGroups:
667+
default:
668+
replicas: 2
669+
envOverrides:
670+
COMMON_VAR: group-value
671+
GROUP_VAR: group-value
672+
configOverrides:
673+
nifi.properties:
674+
nifi.diagnostics.on.shutdown.enabled: "false"
675+
nifi.diagnostics.on.shutdown.max.filecount: "20"
676+
podOverrides:
677+
spec:
678+
containers:
679+
- name: nifi
680+
resources:
681+
requests:
682+
cpu: 700m
683+
limits:
684+
cpu: 1200m
685+
"#})
686+
.expect("Failed to parse NifiClusterSpec YAML")
599687
}
600688
}
601689
}

0 commit comments

Comments
 (0)