Skip to content

Commit

Permalink
[api] Adding LimitadorRef to RateLimit
Browse files Browse the repository at this point in the history
* Created NamespacedName type just to add serialization details
  • Loading branch information
didierofrivia committed Jun 16, 2022
1 parent 658d319 commit bfccce3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/v1alpha1/ratelimit_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ type RateLimitSpec struct {
Namespace string `json:"namespace"`
Seconds int `json:"seconds"`
Variables []string `json:"variables"`
// +optional
LimitadorRef NamespacedName `json:"limitador-ref,omitempty"`
}

// RateLimitStatus defines the observed state of RateLimit
Expand Down Expand Up @@ -62,6 +64,11 @@ type RateLimitList struct {
Items []RateLimit `json:"items"`
}

type NamespacedName struct {
Namespace string `json:"namespace,omitempty"`
Name string `json:"name,omitempty"`
}

func init() {
SchemeBuilder.Register(&RateLimit{}, &RateLimitList{})
}
16 changes: 16 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

0 comments on commit bfccce3

Please sign in to comment.