Skip to content

Commit

Permalink
Make all ContourConfiguration CRD fields optional (#4451)
Browse files Browse the repository at this point in the history
Removes all kubebuilder defaults from ContourConfiguration
fields and switches them to pointers with the `omitempty`
JSON tag to make them all fully optional. Defaults
are then applied internally by Contour.

Signed-off-by: Steve Kriss <krisss@vmware.com>
  • Loading branch information
skriss authored Apr 11, 2022
1 parent 1e2beab commit a4478d6
Show file tree
Hide file tree
Showing 25 changed files with 1,940 additions and 3,315 deletions.
225 changes: 153 additions & 72 deletions apis/projectcontour/v1alpha1/contourconfig.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apis/projectcontour/v1alpha1/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ func (e *EnvoyConfig) Validate() error {
}

// endpointsInConfict returns error if different protocol are configured to use single port.
func endpointsInConfict(health HealthConfig, metrics MetricsConfig) error {
if metrics.TLS != nil && health.Address == metrics.Address && health.Port == metrics.Port {
func endpointsInConfict(health *HealthConfig, metrics *MetricsConfig) error {
if health != nil && metrics != nil && metrics.TLS != nil && health.Address == metrics.Address && health.Port == metrics.Port {
return fmt.Errorf("cannot use single port for health over HTTP and metrics over HTTPS")
}
return nil
Expand Down
170 changes: 142 additions & 28 deletions apis/projectcontour/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions changelogs/unreleased/4451-skriss-minor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## All ContourConfiguration CRD fields are now optional

To better manage configuration defaults, all `ContourConfiguration` CRD fields are now optional without defaults.
Instead, Contour itself will apply defaults to any relevant fields that have not been specified by the user when it starts up, similarly to how processing of the Contour `ConfigMap` works today.
The default values that Contour uses are documented in the `ContourConfiguration` CRD's API documentation.
Loading

0 comments on commit a4478d6

Please sign in to comment.