Skip to content

[installer] Tidy up omitempty in config #8436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions install/installer/example-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ containerRegistry:
inCluster: true
database:
inCluster: true
domain: gitpod.example.com
imagePullSecrets: null
disableDefinitelyGp: false
domain: ""
jaegerOperator:
inCluster: true
kind: Full
Expand All @@ -21,13 +21,15 @@ objectStorage:
inCluster: true
observability:
logLevel: info
openVSX:
url: https://open-vsx.org
repository: eu.gcr.io/gitpod-core-dev/build
workspace:
resources:
requests:
cpu: "1"
memory: 2Gi
runtime:
containerdRuntimeDir: /run/containerd/io.containerd.runtime.v2.task/k8s.io
containerdRuntimeDir: /var/lib/containerd/io.containerd.runtime.v2.task/k8s.io
containerdSocket: /run/containerd/containerd.sock
fsShiftMethod: fuse
7 changes: 4 additions & 3 deletions install/installer/pkg/config/v1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func (v version) Defaults(in interface{}) error {
cfg.Workspace.Runtime.ContainerDSocket = "/run/containerd/containerd.sock"
cfg.Workspace.Runtime.ContainerDRuntimeDir = "/var/lib/containerd/io.containerd.runtime.v2.task/k8s.io"
cfg.OpenVSX.URL = "https://open-vsx.org"
cfg.DisableDefinitelyGP = false

return nil
}
Expand All @@ -78,7 +79,7 @@ type Config struct {

Certificate ObjectRef `json:"certificate" validate:"required"`

ImagePullSecrets []ObjectRef `json:"imagePullSecrets"`
ImagePullSecrets []ObjectRef `json:"imagePullSecrets,omitempty"`

Workspace Workspace `json:"workspace" validate:"required"`

Expand All @@ -90,7 +91,7 @@ type Config struct {

SSHGatewayHostKey *ObjectRef `json:"sshGatewayHostKey,omitempty"`

DisableDefinitelyGP bool `json:"disableDefinitelyGp,omitempty"`
DisableDefinitelyGP bool `json:"disableDefinitelyGp"`

Experimental *experimental.Config `json:"experimental,omitempty"`
}
Expand Down Expand Up @@ -172,7 +173,7 @@ const (
type ContainerRegistry struct {
InCluster *bool `json:"inCluster,omitempty" validate:"required"`
External *ContainerRegistryExternal `json:"external,omitempty" validate:"required_if=InCluster false"`
S3Storage *S3Storage `json:"s3storage"`
S3Storage *S3Storage `json:"s3storage,omitempty"`
}

type ContainerRegistryExternal struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type TracingSampleType string

type Tracing struct {
SamplerType *TracingSampleType `json:"samplerType,omitempty" validate:"omitempty,tracing_sampler_type"`
SamplerParam *float64 `json:"samplerParam,omitEmpty" validate:"required_with=SamplerType"`
SamplerParam *float64 `json:"samplerParam,omitempty" validate:"required_with=SamplerType"`
}

// Values taken from https://github.com/jaegertracing/jaeger-client-go/blob/967f9c36f0fa5a2617c9a0993b03f9a3279fadc8/config/config.go#L71
Expand Down