Skip to content

Commit

Permalink
DSCI CRD: allow default as a value for logmode (#1271)
Browse files Browse the repository at this point in the history
default is a separate mode in the sources, not just selection of one
of the others, so allow it explicitly.

There is no difference if it is set to "" explicitly or not set
since "" is a string default value.

In the current code as soon as devFlags are present, the mode is
taken in use, so it is reset to default even if it is not set which
does not look right (I would expect leave it untouched if is not
set). If it is fixed, then it will be impossible to reset logging
mode to default from devel or prod: if "" is considered as "not set
explicitly", then there is no value for default, the object checker
rejects values not in list.

Signed-off-by: Yauheni Kaliuta <[email protected]>
  • Loading branch information
ykaliuta authored Oct 2, 2024
1 parent d788daf commit eb6ba18
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apis/dscinitialization/v1/dscinitialization_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type DevFlags struct {
// Custom manifests uri for odh-manifests
// +optional
ManifestsUri string `json:"manifestsUri,omitempty"`
// +kubebuilder:validation:Enum=devel;development;prod;production
// +kubebuilder:validation:Enum=devel;development;prod;production;default
// +kubebuilder:default="production"
LogMode string `json:"logmode,omitempty"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ spec:
- development
- prod
- production
- default
type: string
manifestsUri:
description: Custom manifests uri for odh-manifests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ spec:
- development
- prod
- production
- default
type: string
manifestsUri:
description: Custom manifests uri for odh-manifests
Expand Down
2 changes: 1 addition & 1 deletion docs/api-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ _Appears in:_
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `manifestsUri` _string_ | Custom manifests uri for odh-manifests | | |
| `logmode` _string_ | | production | Enum: [devel development prod production] <br /> |
| `logmode` _string_ | | production | Enum: [devel development prod production default] <br /> |


#### Monitoring
Expand Down

0 comments on commit eb6ba18

Please sign in to comment.