Skip to content

Commit

Permalink
e2e-test: add e2e tests and CRDs for ApisixTls v2 (#1014)
Browse files Browse the repository at this point in the history
Signed-off-by: Ling Samuel <lingsamuelgrace@gmail.com>
  • Loading branch information
lingsamuel authored May 12, 2022
1 parent bac9813 commit cd5063f
Show file tree
Hide file tree
Showing 10 changed files with 538 additions and 142 deletions.
2 changes: 1 addition & 1 deletion pkg/kube/apisix/apis/config/v2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ type ApisixConsumerBasicAuth struct {
// ApisixConsumerBasicAuthValue defines the in-place username and password configuration for basic auth.
type ApisixConsumerBasicAuthValue struct {
Username string `json:"username" yaml:"username"`
Password string `json:"password" yaml:"username"`
Password string `json:"password" yaml:"password"`
}

// ApisixConsumerKeyAuth defines the configuration for the key auth.
Expand Down
248 changes: 247 additions & 1 deletion samples/deploy/crd/v1/ApisixRoute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ spec:
type: integer
- name: v2beta3
served: true
storage: true
storage: false
subresources:
status: { }
additionalPrinterColumns:
Expand Down Expand Up @@ -518,3 +518,249 @@ spec:
type: string
observedGeneration:
type: integer
- name: v2
served: true
storage: true
subresources:
status: { }
additionalPrinterColumns:
- jsonPath: .spec.http[].match.hosts
name: Hosts
type: string
priority: 0
- jsonPath: .spec.http[].match.paths
name: URIs
type: string
priority: 0
- jsonPath: .spec.http[].backends[].serviceName
name: Target Service(HTTP)
type: string
priority: 1
- jsonPath: .spec.tcp[].match.ingressPort
name: Ingress Server Port(TCP)
type: integer
priority: 1
- jsonPath: .spec.tcp[].match.backend.serviceName
name: Target Service(TCP)
type: string
priority: 1
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
priority: 0
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
anyOf:
- required: [ "http" ]
- required: [ "stream" ]
properties:
http:
type: array
minItems: 1
items:
type: object
required: [ "name", "match", "backends" ]
properties:
name:
type: string
minLength: 1
priority:
type: integer
timeout:
type: object
properties:
connect:
type: string
send:
type: string
read:
type: string
match:
type: object
required:
- paths
properties:
paths:
type: array
minItems: 1
items:
type: string
pattern: "^/[a-zA-Z0-9\\-._~%!$&'()+,;=:@/]*\\*?$"
hosts:
type: array
minItems: 1
items:
type: string
pattern: "^\\*?[0-9a-zA-Z-._]+$"
methods:
type: array
minItems: 1
items:
type: string
enum: [ "CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "TRACE" ]
remoteAddrs:
type: array
minItems: 1
items:
type: string
exprs:
type: array
minItems: 1
items:
type: object
properties:
subject:
type: object
properties:
scope:
type: string
enum: [ "Cookie", "Header", "Path", "Query" ]
name:
type: string
minLength: 1
required:
- scope
op:
type: string
enum:
- Equal
- NotEqual
- GreaterThan
- LessThan
- In
- NotIn
- RegexMatch
- RegexNotMatch
- RegexMatchCaseInsensitive
- RegexNotMatchCaseInsensitive
value:
type: string
set:
type: array
items:
type: string
oneOf:
- required: [ "subject", "op", "value" ]
- required: [ "subject", "op", "set" ]
websocket:
type: boolean
plugin_config_name:
type: string
minLength: 1
backends:
type: array
minItems: 1
items:
type: object
properties:
serviceName:
type: string
minLength: 1
servicePort:
type: integer
minimum: 1
maximum: 65535
resolveGranularity:
type: string
enum: [ "endpoint", "service" ]
weight:
type: integer
minimum: 0
subset:
type: string
required:
- serviceName
- servicePort
plugins:
type: array
items:
type: object
properties:
name:
type: string
minLength: 1
enable:
type: boolean
config:
type: object
x-kubernetes-preserve-unknown-fields: true # we have to enable it since plugin config
required:
- name
- enable
authentication:
type: object
properties:
enable:
type: boolean
type:
type: string
enum: [ "basicAuth", "keyAuth" ]
keyAuth:
type: object
properties:
header:
type: string
required:
- enable
stream:
type: array
minItems: 1
items:
type: object
required: [ "name", "match", "backend", "protocol" ]
properties:
"protocol":
type: string
enum: [ "TCP", "UDP" ]
name:
type: string
minLength: 1
match:
type: object
properties:
ingressPort:
type: integer
minimum: 1
maximum: 65535
required:
- ingressPort
backend:
type: object
properties:
serviceName:
type: string
minLength: 1
servicePort:
type: integer
minimum: 1
maximum: 65535
resolveGranularity:
type: string
enum: [ "endpoint", "service" ]
subset:
type: string
required:
- serviceName
- servicePort
status:
type: object
properties:
conditions:
type: array
items:
type: object
properties:
"type":
type: string
reason:
type: string
status:
type: string
message:
type: string
observedGeneration:
type: integer
Loading

0 comments on commit cd5063f

Please sign in to comment.