Skip to content

Commit d14cc6a

Browse files
committed
make enum untagged
1 parent 41ba13c commit d14cc6a

2 files changed

Lines changed: 29 additions & 20 deletions

File tree

crates/stackable-operator/crds/DummyCluster.yaml

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -85,32 +85,42 @@ spec:
8585
Since git-sync v4.x.x this field is mapped to the flag `--ref`.
8686
type: string
8787
credentials:
88-
anyOf:
89-
- required:
90-
- basicAuthSecretName
91-
- required:
92-
- sshPrivateKeySecretName
9388
description: An optional secret used for git access.
9489
nullable: true
90+
oneOf:
91+
- required:
92+
- basicAuth
93+
- required:
94+
- ssh
9595
properties:
96-
basicAuthSecretName:
97-
description: |-
98-
The name of the Secret used to access the repository via Basic Authentication if it is not public.
96+
basicAuth:
97+
properties:
98+
basicAuthSecretName:
99+
description: |-
100+
The name of the Secret used to access the repository via Basic Authentication if it is not public.
99101
100-
The referenced Secret must include two fields: `user` and `password`.
101-
The `password` field can either be an actual password (not recommended) or a GitHub token,
102-
as described in the git-sync [documentation].
102+
The referenced Secret must include two fields: `user` and `password`.
103+
The `password` field can either be an actual password (not recommended) or a GitHub token,
104+
as described in the git-sync [documentation].
103105
104-
[documentation]: https://github.com/kubernetes/git-sync/tree/v4.2.4?tab=readme-ov-file#manual
105-
type: string
106-
sshPrivateKeySecretName:
107-
description: |-
108-
The name of the Secret used for SSH access to the repository.
106+
[documentation]: https://github.com/kubernetes/git-sync/tree/v4.2.4?tab=readme-ov-file#manual
107+
type: string
108+
required:
109+
- basicAuthSecretName
110+
type: object
111+
ssh:
112+
properties:
113+
sshPrivateKeySecretName:
114+
description: |-
115+
The name of the Secret used for SSH access to the repository.
109116
110-
The referenced Secret must include two fields: `key` and `knownHosts`.
117+
The referenced Secret must include two fields: `key` and `knownHosts`.
111118
112-
[documentation]: https://github.com/kubernetes/git-sync/tree/v4.2.4?tab=readme-ov-file#manual
113-
type: string
119+
[documentation]: https://github.com/kubernetes/git-sync/tree/v4.2.4?tab=readme-ov-file#manual
120+
type: string
121+
required:
122+
- sshPrivateKeySecretName
123+
type: object
114124
type: object
115125
depth:
116126
default: 1

crates/stackable-operator/src/crd/git_sync/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ pub mod versioned {
6060
}
6161

6262
#[derive(strum::Display, Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
63-
#[serde(untagged)]
6463
#[serde(rename_all = "camelCase")]
6564
#[schemars(rename_all = "camelCase")]
6665
pub enum Credentials {

0 commit comments

Comments
 (0)