Skip to content

Commit 1396149

Browse files
authored
Run pre-commit hooks to fix python test imports (#3221)
* Run pre-commit hooks to fix python test imports * Add context.minimum_version
1 parent 20934ae commit 1396149

File tree

108 files changed

+385
-497
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+385
-497
lines changed

internal/certmanager/cm_controller.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,16 @@ func (c *CmController) processItem(ctx context.Context, key string) error {
127127
// example, the following Certificate "cert-1" is controlled by the VirtualServer
128128
// "vs-1":
129129
//
130-
// kind: Certificate
131-
// metadata: Note that the owner
132-
// namespace: cert-1 reference does not
133-
// ownerReferences: have a namespace,
134-
// - controller: true since owner refs
135-
// apiVersion: networking.x-k8s.io/v1alpha1 only work inside
136-
// kind: VirtualServer the same namespace.
137-
// name: vs-1
138-
// blockOwnerDeletion: true
139-
// uid: 7d3897c2-ce27-4144-883a-e1b5f89bd65a
130+
// kind: Certificate
131+
// metadata: Note that the owner
132+
// namespace: cert-1 reference does not
133+
// ownerReferences: have a namespace,
134+
// - controller: true since owner refs
135+
// apiVersion: networking.x-k8s.io/v1alpha1 only work inside
136+
// kind: VirtualServer the same namespace.
137+
// name: vs-1
138+
// blockOwnerDeletion: true
139+
// uid: 7d3897c2-ce27-4144-883a-e1b5f89bd65a
140140
func certificateHandler(queue workqueue.RateLimitingInterface) func(obj interface{}) {
141141
return func(obj interface{}) {
142142
crt, ok := obj.(*cmapi.Certificate)

internal/certmanager/helper.go

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,26 @@ var (
4949
// apiVersion: k8s.nginx.org/v1
5050
// kind: VirtualServer
5151
// spec:
52-
// <...>
53-
// tls:
54-
// <...>
55-
// cert-manager:
56-
// common-name: example.com
57-
// duration: 2160h
58-
// renew-before: 1440h
59-
// usages: "digital signature,key encipherment"
52+
//
53+
// <...>
54+
// tls:
55+
// <...>
56+
// cert-manager:
57+
// common-name: example.com
58+
// duration: 2160h
59+
// renew-before: 1440h
60+
// usages: "digital signature,key encipherment"
6061
//
6162
// is mapped to the following Certificate:
6263
//
63-
// kind: Certificate
64-
// spec:
65-
// commonName: example.com
66-
// duration: 2160h
67-
// renewBefore: 1440h
68-
// usages:
69-
// - digital signature
70-
// - key encipherment
64+
// kind: Certificate
65+
// spec:
66+
// commonName: example.com
67+
// duration: 2160h
68+
// renewBefore: 1440h
69+
// usages:
70+
// - digital signature
71+
// - key encipherment
7172
func translateVsSpec(crt *cmapi.Certificate, vsCmSpec *vsapi.CertManager) error {
7273
var errs []string
7374
if crt == nil {

internal/certmanager/sync.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,10 @@ func certNeedsUpdate(a, b *cmapi.Certificate) bool {
274274
// Certificate created for the given VirtualServer resource. We look up the following
275275
// VS TLS Cert-Manager fields:
276276
//
277-
// cluster-issuer
278-
// issuer
279-
// issuer-kind
280-
// issuer-group
277+
// cluster-issuer
278+
// issuer
279+
// issuer-kind
280+
// issuer-group
281281
func issuerForVirtualServer(vs *vsapi.VirtualServer) (name, kind, group string, err error) {
282282
var errs []string
283283
vsCmSpec := vs.Spec.TLS.CertManager

internal/configs/version1/nginx.ingress.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ server {
9696

9797
{{range $location := $server.Locations}}
9898
location {{$location.Path}} {
99-
set $service "{{$location.ServiceName}}";
99+
set $service "{{$location.ServiceName}}";
100100
{{with $location.MinionIngress}}
101101
# location for minion {{$location.MinionIngress.Namespace}}/{{$location.MinionIngress.Name}}
102102
set $resource_name "{{$location.MinionIngress.Name}}";

internal/configs/version2/nginx.transportserver.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ server {
4747
proxy_next_upstream_timeout {{ $s.ProxyNextUpstreamTimeout }};
4848
proxy_next_upstream_tries {{ $s.ProxyNextUpstreamTries }};
4949
{{ end }}
50-
}
50+
}

perf-tests/requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
PyYAML==6.0
2-
requests==2.28.1
1+
certifi==2022.9.24
2+
cffi==1.15.1
33
kubernetes==25.3.0
4+
locust==2.13.0
45
pytest==7.2.0
5-
cffi==1.15.1
6-
certifi==2022.9.24
7-
urllib3==1.26.12
86
pytest-html==3.2.0
97
pytest-repeat==0.9.1
10-
locust==2.13.0
8+
PyYAML==6.0
9+
requests==2.28.1
10+
urllib3==1.26.12

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ pythonpath = [
1717
".",
1818
"tests/suite",
1919
"tests/suite/grpc",
20+
"tests/suite/fixtures",
21+
"tests/suite/utils",
2022
]
2123
addopts = "--tb=native -ra --disable-warnings -x -l --profile -v"
2224
log_cli = true

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
NS_COUNT,
1717
NUM_REPLICAS,
1818
)
19-
from suite.resources_utils import get_first_pod_name
19+
from suite.utils.resources_utils import get_first_pod_name
2020

2121

2222
def pytest_addoption(parser) -> None:
@@ -111,7 +111,7 @@ def pytest_addoption(parser) -> None:
111111

112112

113113
# import fixtures into pytest global namespace
114-
pytest_plugins = ["suite.fixtures", "suite.ic_fixtures", "suite.custom_resource_fixtures"]
114+
pytest_plugins = ["suite.fixtures.fixtures", "suite.fixtures.ic_fixtures", "suite.fixtures.custom_resource_fixtures"]
115115

116116

117117
def pytest_collection_modifyitems(config, items) -> None:

tests/kind/kind-config-template.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/requirements.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
PyYAML==6.0
2-
requests==2.28.1
1+
certifi==2022.9.24
2+
cffi==1.15.1
3+
flaky==3.7.0
34
forcediphttpsadapter==1.0.2
5+
grpcio==1.50.0
6+
grpcio-tools==1.50.0
47
kubernetes==25.3.0
5-
pytest==7.2.0
6-
cffi==1.15.1
8+
mock==4.0.3
9+
more-itertools==9.0.0
710
pyOpenSSL==22.1.0
8-
certifi==2022.9.24
9-
urllib3==1.26.12
11+
pytest==7.2.0
1012
pytest-html==3.2.0
1113
pytest-profiling==1.7.0
12-
more-itertools==9.0.0
13-
mock==4.0.3
14-
grpcio==1.50.0
15-
grpcio-tools==1.50.0
16-
flaky==3.7.0
14+
PyYAML==6.0
15+
requests==2.28.1
16+
urllib3==1.26.12

0 commit comments

Comments
 (0)