Skip to content

Commit

Permalink
Merge pull request #168 from maplain/gatewaystatus-optiona-fields
Browse files Browse the repository at this point in the history
Mark fields in Condition required
  • Loading branch information
k8s-ci-robot authored May 8, 2020
2 parents 11bbfec + 9dfdb75 commit 16eee39
Show file tree
Hide file tree
Showing 6 changed files with 216 additions and 206 deletions.
20 changes: 14 additions & 6 deletions api/v1alpha1/gateway_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,18 +269,22 @@ const (
// GatewayCondition is an error status for a given route.
type GatewayCondition struct {
// Type indicates the type of condition.
// +required
Type GatewayConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=GatewayConditionType"`
// Status describes the current state of this condition. Can be "True",
// "False", or "Unknown".
// +required
Status core.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"`
// Message is a human-understandable message describing the condition.
// +optional
// This field may be empty.
// +required
Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"`
// Reason indicates why the condition is in this state.
// +optional
// This field must not be empty.
// +required
Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"`
// LastTransitionTime indicates the last time this condition changed.
// +optional
// +required
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,5,opt,name=lastTransitionTime"`
}

Expand Down Expand Up @@ -321,18 +325,22 @@ const (
// ListenerCondition is an error status for a given listener.
type ListenerCondition struct {
// Type indicates the type of condition.
// +required
Type ListenerConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ListenerConditionType"`
// Status describes the current state of this condition. Can be "True",
// "False", or "Unknown".
// +required
Status core.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"`
// Message is a human-understandable message describing the condition.
// +optional
// This field may be empty.
// +required
Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"`
// Reason indicates why the condition is in this state.
// +optional
// This field must not be empty.
// +required
Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"`
// LastTransitionTime indicates the last time this condition changed.
// +optional
// +required
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,5,opt,name=lastTransitionTime"`
}

Expand Down
16 changes: 10 additions & 6 deletions api/v1alpha1/gatewayclass_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,26 +148,30 @@ type GatewayClassStatus struct {
// Support: Core, unless otherwise specified.
type GatewayClassCondition struct {
// Type of this condition.
// +required
Type GatewayClassConditionType `json:"type" protobuf:"bytes,1,opt,name=type"`
// Status of this condition.
// +required
Status GatewayClassConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status"`

// Reason is a machine consumable string for the last
// transition. It should be a one-word, CamelCase
// string. Reason will be defined by the controller.
//
// Support: Custom; values will be controller-specific.
// This field must not be empty.
//
// +optional
Reason *string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"`
// +required
Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"`
// Message is a human readable reason for last transition.
// This field may be empty.
//
// +optional
Message *string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"`
// +required
Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"`
// LastTransitionTime is the time of the last change to this condition.
//
// +optional
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,5,opt,name=lastTransitionTime"`
// +required
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,5,opt,name=lastTransitionTime"`
}

// +kubebuilder:object:root=true
Expand Down
Loading

0 comments on commit 16eee39

Please sign in to comment.