Skip to content

Commit 0eead06

Browse files
Adjust types definition to reflect what is optional
This change adds optional and removes omitempty according to our usage of the resource. Change-Id: I958db19eb448dc0cf55b93a20fda4c0dbd3f7f0c
1 parent 84c9ee4 commit 0eead06

File tree

6 files changed

+28
-28
lines changed

6 files changed

+28
-28
lines changed

api/v1/softwarefactory_types.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type FluentBitForwarderSpec struct {
3939
// Run fluent bit sidecars in debug mode. This will output forwarded payloads and additional info in the sidecar's logs. Defaults to false.
4040
Debug *bool `json:"debug,omitempty"`
4141
// The Host for the Fluent Bit Forward Input to forward logs to.
42-
ForwardInputHost string `json:"forwardInputHost,omitempty"`
42+
ForwardInputHost string `json:"forwardInputHost"`
4343
// The (optional) port of the forward input, defaults to 24224.
4444
// +kubebuilder:default:=24224
4545
ForwardInputPort int32 `json:"forwardInputPort,omitempty"`
@@ -532,15 +532,15 @@ type NodepoolSpec struct {
532532
}
533533

534534
type ZookeeperSpec struct {
535-
Storage StorageSpec `json:"storage"`
535+
Storage StorageSpec `json:"storage,omitempty"`
536536
// Memory/CPU Limit
537537
// +kubebuilder:validation:Optional
538538
// +kubebuilder:default={"memory": "2Gi", "cpu": "500m"}
539539
Limits *LimitsSpec `json:"limits"`
540540
}
541541

542542
type CodesearchSpec struct {
543-
Storage StorageSpec `json:"storage"`
543+
Storage StorageSpec `json:"storage,omitempty"`
544544
// Memory/CPU Limit
545545
// +kubebuilder:validation:Optional
546546
// +kubebuilder:default={"memory": "2Gi", "cpu": "500m"}
@@ -560,9 +560,9 @@ type LimitsSpec struct {
560560

561561
type MariaDBSpec struct {
562562
// Storage parameters related to mariaDB's data
563-
DBStorage StorageSpec `json:"dbStorage"`
563+
DBStorage StorageSpec `json:"dbStorage,omitempty"`
564564
// Storage parameters related to the database's logging
565-
LogStorage StorageSpec `json:"logStorage"`
565+
LogStorage StorageSpec `json:"logStorage,omitempty"`
566566
// Memory/CPU Limit
567567
// +kubebuilder:validation:Optional
568568
// +kubebuilder:default={"memory": "2Gi", "cpu": "500m"}

config/crd/bases/sf.softwarefactory-project.io_softwarefactories.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ spec:
7272
to 24224.
7373
format: int32
7474
type: integer
75+
required:
76+
- forwardInputHost
7577
type: object
7678
codesearch:
7779
description: Codesearch service spec
@@ -123,8 +125,6 @@ spec:
123125
required:
124126
- size
125127
type: object
126-
required:
127-
- storage
128128
type: object
129129
config-location:
130130
description: Config repository spec
@@ -313,9 +313,6 @@ spec:
313313
required:
314314
- size
315315
type: object
316-
required:
317-
- dbStorage
318-
- logStorage
319316
type: object
320317
nodepool:
321318
description: Nodepool services spec
@@ -493,8 +490,6 @@ spec:
493490
required:
494491
- size
495492
type: object
496-
required:
497-
- storage
498493
type: object
499494
zuul:
500495
description: Zuul service spec

schemas/Codesearch.dhall

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{ Type =
2-
{ storage : (./Storage.dhall).Type
3-
, enabled : Optional Bool
2+
{ enabled : Optional Bool
43
, limits : Optional (./Limits.dhall).Type
4+
, storage : Optional (./Storage.dhall).Type
55
}
6-
, default = { enabled = None Bool, limits = None (./Limits.dhall).Type }
6+
, default =
7+
{ enabled = None Bool
8+
, limits = None (./Limits.dhall).Type
9+
, storage = None (./Storage.dhall).Type
10+
}
711
}

schemas/FluentBitLogForwarding.dhall

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{ Type =
2-
{ debug : Optional Bool
3-
, forwardInputHost : Optional Text
2+
{ forwardInputHost : Text
3+
, debug : Optional Bool
44
, forwardInputPort : Optional Natural
55
}
6-
, default =
7-
{ debug = None Bool
8-
, forwardInputHost = None Text
9-
, forwardInputPort = None Natural
10-
}
6+
, default = { debug = None Bool, forwardInputPort = None Natural }
117
}

schemas/Mariadb.dhall

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{ Type =
2-
{ dbStorage : (./Storage.dhall).Type
3-
, logStorage : (./Storage.dhall).Type
2+
{ dbStorage : Optional (./Storage.dhall).Type
43
, limits : Optional (./Limits.dhall).Type
4+
, logStorage : Optional (./Storage.dhall).Type
55
}
6-
, default.limits = None (./Limits.dhall).Type
6+
, default =
7+
{ dbStorage = None (./Storage.dhall).Type
8+
, limits = None (./Limits.dhall).Type
9+
, logStorage = None (./Storage.dhall).Type
10+
}
711
}

schemas/Zookeeper.dhall

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{ Type =
2-
{ storage : (./Storage.dhall).Type
3-
, limits : Optional (./Limits.dhall).Type
2+
{ limits : Optional (./Limits.dhall).Type
3+
, storage : Optional (./Storage.dhall).Type
44
}
5-
, default.limits = None (./Limits.dhall).Type
5+
, default =
6+
{ limits = None (./Limits.dhall).Type, storage = None (./Storage.dhall).Type }
67
}

0 commit comments

Comments
 (0)