Skip to content

Commit

Permalink
Simple Route status implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
  • Loading branch information
sunjayBhatia committed Nov 10, 2022
1 parent 9b11370 commit caa275a
Show file tree
Hide file tree
Showing 10 changed files with 212 additions and 84 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ generate-crd-yaml:
.PHONY: generate-gateway-yaml
generate-gateway-yaml:
@echo "Generating Gateway API CRD YAML documents..."
@kubectl kustomize -o examples/gateway/00-crds.yaml "github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=${GATEWAY_API_VERSION}"
@kubectl kustomize -o examples/gateway/00-crds.yaml "github.com/sunjayBhatia/gateway-api/config/crd/experimental?ref=${GATEWAY_API_VERSION}"
@echo "Generating Gateway API webhook documents..."
@curl -s -o examples/gateway/00-namespace.yaml https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/${GATEWAY_API_VERSION}/config/webhook/0-namespace.yaml
@curl -s -o examples/gateway/01-admission_webhook.yaml https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/${GATEWAY_API_VERSION}/config/webhook/admission_webhook.yaml
Expand Down
60 changes: 51 additions & 9 deletions examples/gateway/00-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3081,8 +3081,8 @@ spec:
if all conditions are satisfied. \n For example, the match
below will match a HTTP request only if its path starts
with `/foo` AND it contains the `version: v1` header: \n
``` match: path: value: \"/foo\" headers: - name:
\"version\" value \"v1\" ```"
``` match: \n \tpath: \t value: \"/foo\" \theaders: \t-
name: \"version\" \t value \"v1\" \n ```"
properties:
headers:
description: Headers specifies HTTP request header matchers.
Expand Down Expand Up @@ -3467,8 +3467,8 @@ spec:
required:
- spec
type: object
served: true
storage: true
served: false
storage: false
subresources:
status: {}
- additionalPrinterColumns:
Expand Down Expand Up @@ -3534,8 +3534,8 @@ spec:
items:
description: "Hostname is the fully qualified domain name of a network
host. This matches the RFC 1123 definition of a hostname with
2 notable exceptions: \n 1. IPs are not allowed. 2. A hostname
may be prefixed with a wildcard label (`*.`). The wildcard label
2 notable exceptions: \n 1. IPs are not allowed. 2. A hostname
may be prefixed with a wildcard label (`*.`). The wildcard label
must appear by itself as the first label. \n Hostname can be \"precise\"
which is a domain name without the terminating dot of a network
host (e.g. \"foo.example.com\") or \"wildcard\", which is a domain
Expand Down Expand Up @@ -4683,8 +4683,8 @@ spec:
if all conditions are satisfied. \n For example, the match
below will match a HTTP request only if its path starts
with `/foo` AND it contains the `version: v1` header: \n
``` match: path: value: \"/foo\" headers: - name:
\"version\" value \"v1\" ```"
``` match: \n \tpath: \t value: \"/foo\" \theaders: \t-
name: \"version\" \t value \"v1\" \n ```"
properties:
headers:
description: Headers specifies HTTP request header matchers.
Expand Down Expand Up @@ -4969,6 +4969,48 @@ spec:
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$
type: string
effectivePolicyConfigurations:
description: EffectivePolicyConfigurations is a list of policies
in effect on this Route.
items:
properties:
policyType:
description: PolicyGroupKind indicates the group and kind
of a Policy resource.
properties:
group:
description: Group is the group of the Policy.
maxLength: 253
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
kind:
description: Kind is the kind of the Route.
maxLength: 63
minLength: 1
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
type: string
required:
- kind
type: object
policyValue:
type: string
sectionName:
description: "SectionName is the name of a section in
a Kubernetes resource. \n This validation is based off
of the corresponding Kubernetes validation: https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L208
\n Valid values include: \n * \"example.com\" * \"foo.example.com\"
\n Invalid values include: \n * \"example.com/bar\"
- \"/\" is an invalid character"
maxLength: 253
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
required:
- policyType
- policyValue
- sectionName
type: object
type: array
parentRef:
description: ParentRef corresponds with a ParentRef in the spec
that this RouteParentStatus struct describes the status of.
Expand Down Expand Up @@ -5070,7 +5112,7 @@ spec:
- spec
type: object
served: true
storage: false
storage: true
subresources:
status: {}
status:
Expand Down
60 changes: 51 additions & 9 deletions examples/render/contour-gateway-provisioner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8425,8 +8425,8 @@ spec:
if all conditions are satisfied. \n For example, the match
below will match a HTTP request only if its path starts
with `/foo` AND it contains the `version: v1` header: \n
``` match: path: value: \"/foo\" headers: - name:
\"version\" value \"v1\" ```"
``` match: \n \tpath: \t value: \"/foo\" \theaders: \t-
name: \"version\" \t value \"v1\" \n ```"
properties:
headers:
description: Headers specifies HTTP request header matchers.
Expand Down Expand Up @@ -8811,8 +8811,8 @@ spec:
required:
- spec
type: object
served: true
storage: true
served: false
storage: false
subresources:
status: {}
- additionalPrinterColumns:
Expand Down Expand Up @@ -8878,8 +8878,8 @@ spec:
items:
description: "Hostname is the fully qualified domain name of a network
host. This matches the RFC 1123 definition of a hostname with
2 notable exceptions: \n 1. IPs are not allowed. 2. A hostname
may be prefixed with a wildcard label (`*.`). The wildcard label
2 notable exceptions: \n 1. IPs are not allowed. 2. A hostname
may be prefixed with a wildcard label (`*.`). The wildcard label
must appear by itself as the first label. \n Hostname can be \"precise\"
which is a domain name without the terminating dot of a network
host (e.g. \"foo.example.com\") or \"wildcard\", which is a domain
Expand Down Expand Up @@ -10027,8 +10027,8 @@ spec:
if all conditions are satisfied. \n For example, the match
below will match a HTTP request only if its path starts
with `/foo` AND it contains the `version: v1` header: \n
``` match: path: value: \"/foo\" headers: - name:
\"version\" value \"v1\" ```"
``` match: \n \tpath: \t value: \"/foo\" \theaders: \t-
name: \"version\" \t value \"v1\" \n ```"
properties:
headers:
description: Headers specifies HTTP request header matchers.
Expand Down Expand Up @@ -10313,6 +10313,48 @@ spec:
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$
type: string
effectivePolicyConfigurations:
description: EffectivePolicyConfigurations is a list of policies
in effect on this Route.
items:
properties:
policyType:
description: PolicyGroupKind indicates the group and kind
of a Policy resource.
properties:
group:
description: Group is the group of the Policy.
maxLength: 253
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
kind:
description: Kind is the kind of the Route.
maxLength: 63
minLength: 1
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
type: string
required:
- kind
type: object
policyValue:
type: string
sectionName:
description: "SectionName is the name of a section in
a Kubernetes resource. \n This validation is based off
of the corresponding Kubernetes validation: https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L208
\n Valid values include: \n * \"example.com\" * \"foo.example.com\"
\n Invalid values include: \n * \"example.com/bar\"
- \"/\" is an invalid character"
maxLength: 253
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
required:
- policyType
- policyValue
- sectionName
type: object
type: array
parentRef:
description: ParentRef corresponds with a ParentRef in the spec
that this RouteParentStatus struct describes the status of.
Expand Down Expand Up @@ -10414,7 +10456,7 @@ spec:
- spec
type: object
served: true
storage: false
storage: true
subresources:
status: {}
status:
Expand Down
60 changes: 51 additions & 9 deletions examples/render/contour-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9149,8 +9149,8 @@ spec:
if all conditions are satisfied. \n For example, the match
below will match a HTTP request only if its path starts
with `/foo` AND it contains the `version: v1` header: \n
``` match: path: value: \"/foo\" headers: - name:
\"version\" value \"v1\" ```"
``` match: \n \tpath: \t value: \"/foo\" \theaders: \t-
name: \"version\" \t value \"v1\" \n ```"
properties:
headers:
description: Headers specifies HTTP request header matchers.
Expand Down Expand Up @@ -9535,8 +9535,8 @@ spec:
required:
- spec
type: object
served: true
storage: true
served: false
storage: false
subresources:
status: {}
- additionalPrinterColumns:
Expand Down Expand Up @@ -9602,8 +9602,8 @@ spec:
items:
description: "Hostname is the fully qualified domain name of a network
host. This matches the RFC 1123 definition of a hostname with
2 notable exceptions: \n 1. IPs are not allowed. 2. A hostname
may be prefixed with a wildcard label (`*.`). The wildcard label
2 notable exceptions: \n 1. IPs are not allowed. 2. A hostname
may be prefixed with a wildcard label (`*.`). The wildcard label
must appear by itself as the first label. \n Hostname can be \"precise\"
which is a domain name without the terminating dot of a network
host (e.g. \"foo.example.com\") or \"wildcard\", which is a domain
Expand Down Expand Up @@ -10751,8 +10751,8 @@ spec:
if all conditions are satisfied. \n For example, the match
below will match a HTTP request only if its path starts
with `/foo` AND it contains the `version: v1` header: \n
``` match: path: value: \"/foo\" headers: - name:
\"version\" value \"v1\" ```"
``` match: \n \tpath: \t value: \"/foo\" \theaders: \t-
name: \"version\" \t value \"v1\" \n ```"
properties:
headers:
description: Headers specifies HTTP request header matchers.
Expand Down Expand Up @@ -11037,6 +11037,48 @@ spec:
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$
type: string
effectivePolicyConfigurations:
description: EffectivePolicyConfigurations is a list of policies
in effect on this Route.
items:
properties:
policyType:
description: PolicyGroupKind indicates the group and kind
of a Policy resource.
properties:
group:
description: Group is the group of the Policy.
maxLength: 253
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
kind:
description: Kind is the kind of the Route.
maxLength: 63
minLength: 1
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
type: string
required:
- kind
type: object
policyValue:
type: string
sectionName:
description: "SectionName is the name of a section in
a Kubernetes resource. \n This validation is based off
of the corresponding Kubernetes validation: https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L208
\n Valid values include: \n * \"example.com\" * \"foo.example.com\"
\n Invalid values include: \n * \"example.com/bar\"
- \"/\" is an invalid character"
maxLength: 253
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
required:
- policyType
- policyValue
- sectionName
type: object
type: array
parentRef:
description: ParentRef corresponds with a ParentRef in the spec
that this RouteParentStatus struct describes the status of.
Expand Down Expand Up @@ -11138,7 +11180,7 @@ spec:
- spec
type: object
served: true
storage: false
storage: true
subresources:
status: {}
status:
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ require (
sigs.k8s.io/gateway-api v0.5.1
sigs.k8s.io/kustomize/kyaml v0.10.17
)

replace sigs.k8s.io/gateway-api => github.com/sunjayBhatia/gateway-api v0.0.0-20221107210021-3a96f4e00fc9
Loading

0 comments on commit caa275a

Please sign in to comment.