Skip to content

Commit

Permalink
Merge pull request #471 from jbdoumenjou/fix-gatewayclass-default-status
Browse files Browse the repository at this point in the history
fix GatewayClassStatus default value
  • Loading branch information
k8s-ci-robot authored Nov 23, 2020
2 parents 3015e30 + c26755e commit 51f266f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion apis/v1alpha1/gatewayclass_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type GatewayClass struct {
// Spec for this GatewayClass.
Spec GatewayClassSpec `json:"spec,omitempty"`
// Status of the GatewayClass.
// +kubebuilder:default={conditions: {{type: "InvalidParameters", status: "Unknown", message: "Waiting for controller", reason: "Waiting", lastTransitionTime: "1970-01-01T00:00:00Z"}}}
// +kubebuilder:default={conditions: {{type: "Admitted", status: "False", message: "Waiting for controller", reason: "Waiting", lastTransitionTime: "1970-01-01T00:00:00Z"}}}
Status GatewayClassStatus `json:"status,omitempty"`
}

Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml

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

18 changes: 9 additions & 9 deletions docs-src/gatewayclass.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,23 @@ kind: GatewayClass
...
status:
conditions:
- type: InvalidParameters
status: Unknown
- type: Admitted
status: False
...
```

A new `GatewayClass` will start with the `InvalidParameters` condition set to
`Unknown`. At this point the controller has not seen the configuration. Once the
A new `GatewayClass` will start with the `Admitted` condition set to
`False`. At this point the controller has not seen the configuration. Once the
controller has processed the configuration, the condition will be set to
`False`:
`True`:

```yaml
kind: GatewayClass
...
status:
conditions:
- type: InvalidParameters
status: False
- type: Admitted
status: True
...
```

Expand All @@ -107,8 +107,8 @@ kind: GatewayClass
...
status:
conditions:
- type: InvalidParameters
status: True
- type: Admitted
status: False
Reason: BadFooBar
Message: "foobar" is an FooBar.
```
Expand Down
18 changes: 9 additions & 9 deletions docs/gatewayclass/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -686,21 +686,21 @@ <h3 id="gatewayclass-status">GatewayClass status</h3>
...
status:
conditions:
- type: InvalidParameters
status: Unknown
- type: Admitted
status: False
...
</code></pre>

<p>A new <code>GatewayClass</code> will start with the <code>InvalidParameters</code> condition set to
<code>Unknown</code>. At this point the controller has not seen the configuration. Once the
<p>A new <code>GatewayClass</code> will start with the <code>Admitted</code> condition set to
<code>False</code>. At this point the controller has not seen the configuration. Once the
controller has processed the configuration, the condition will be set to
<code>False</code>:</p>
<code>True</code>:</p>
<pre><code class="yaml">kind: GatewayClass
...
status:
conditions:
- type: InvalidParameters
status: False
- type: Admitted
status: True
...
</code></pre>

Expand All @@ -710,8 +710,8 @@ <h3 id="gatewayclass-status">GatewayClass status</h3>
...
status:
conditions:
- type: InvalidParameters
status: True
- type: Admitted
status: False
Reason: BadFooBar
Message: &quot;foobar&quot; is an FooBar.
</code></pre>
Expand Down

0 comments on commit 51f266f

Please sign in to comment.