mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +00:00
The tests in apply_test follows the general pattern of other tests. We load from a file in test/fixtures and mock the API server in the function closure in the HttpClient call. In PATCH request rount-tripper we check that the kubectl apply implementation worked as expected. References #40841
10 lines
393 B
YAML
10 lines
393 B
YAML
apiVersion: "unit-test.test.com/v1"
|
|
kind: Widget
|
|
metadata:
|
|
name: "widget"
|
|
namespace: "test"
|
|
annotations:
|
|
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"unit-test.test.com/v1\",\"key\":\"value\",\"kind\":\"Widget\",\"metadata\":{\"annotations\":{},\"labels\":{\"foo\":\"bar\"},\"name\":\"widget\",\"namespace\":\"test\"}}\n"
|
|
labels:
|
|
foo: bar
|
|
key: "value" |