-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from trussio/feature/assert-admission-hooks
PR 1: Feature/assert admission hooks
- Loading branch information
Showing
10 changed files
with
323 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
run: nginx-labels | ||
name: nginx-labels | ||
namespace: applications | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
run: nginx-labels | ||
template: | ||
metadata: | ||
labels: | ||
run: nginx-labels | ||
spec: | ||
containers: | ||
- image: nginx | ||
name: nginx-labels | ||
resources: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: hello-world | ||
namespace: applications | ||
labels: | ||
app: hello-world | ||
spec: | ||
ports: | ||
- name: 8765-8765 | ||
port: 8765 | ||
protocol: TCP | ||
targetPort: 8765 | ||
selector: | ||
app: hello-world | ||
type: LoadBalancer | ||
status: | ||
loadBalancer: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
object: | ||
kind: Pod | ||
metadata: | ||
# name: nginx-7db9fccd9b-jlpw4 | ||
namespace: default | ||
kind: pod | ||
label: | ||
key: run | ||
value: nginx | ||
file: ./something.yaml | ||
|
||
tests: | ||
- type: AssertJSONPath | ||
jsonPath: ".spec.nodeName" | ||
value: "docker-desktop" | ||
- type: AssertValidation | ||
action: "CREATE" # Allowed actions: CREATE, UPDATE, DELETE | ||
# filePath: "/Users/cherukat/go/src/github.com/anchorageio/anchorctl/samples/fixtures/loadbalancer.yaml" | ||
filePath: "./samples/fixtures/loadbalancer.yaml" | ||
expectedError: "Internal error occurred: admission webhook \"webhook.openpolicyagent.org\" denied the request: External Loadbalancers cannot be deployed in this cluster" | ||
- type: AssertMutation | ||
action: "CREATE" # Allowed actions: CREATE, UPDATE | ||
filePath: "./samples/fixtures/deploy.yaml" | ||
jsonPath: ".metadata.labels.function" | ||
value: "wutnow" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.