-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update error handling to propagate cleanly the nested exception
Signed-off-by: Kevin Conner <[email protected]>
- Loading branch information
Showing
4 changed files
with
135 additions
and
6 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,23 @@ | ||
apiVersion: admissionregistration.k8s.io/v1alpha1 | ||
kind: ValidatingAdmissionPolicy | ||
metadata: | ||
name: "test-variable-access" | ||
spec: | ||
failurePolicy: Fail | ||
matchConstraints: | ||
resourceRules: | ||
- apiGroups: ["apps"] | ||
apiVersions: ["v1"] | ||
operations: ["CREATE", "UPDATE"] | ||
resources: ["deployments"] | ||
variables: | ||
- name: foo | ||
expression: "'foo' in object.spec.template.metadata.labels ? object.spec.template.metadata.labels['foo'] : 'default'" | ||
- name: containers | ||
# deliberately misspelling 'spec' as 'spc' | ||
expression: "object.spec.template.spc.containers" | ||
validations: | ||
- expression: variables.foo == 'default' && variables.containers.all(c, c.image.startsWith("test")) | ||
auditAnnotations: | ||
- key: "foo-label" | ||
valueExpression: "'Label for foo is set to ' + variables.foo" |
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,61 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
deployment.kubernetes.io/revision: "1" | ||
creationTimestamp: "2023-10-02T15:26:06Z" | ||
generation: 1 | ||
labels: | ||
app: kubernetes-bootcamp | ||
name: kubernetes-bootcamp | ||
namespace: default | ||
resourceVersion: "246826" | ||
uid: dcdda63b-1611-467d-8927-43e3c73bc963 | ||
spec: | ||
progressDeadlineSeconds: 600 | ||
replicas: 1 | ||
revisionHistoryLimit: 10 | ||
selector: | ||
matchLabels: | ||
app: kubernetes-bootcamp | ||
strategy: | ||
rollingUpdate: | ||
maxSurge: 25% | ||
maxUnavailable: 25% | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app: kubernetes-bootcamp | ||
spec: | ||
containers: | ||
- image: gcr.io/google-samples/kubernetes-bootcamp:v1 | ||
imagePullPolicy: IfNotPresent | ||
name: kubernetes-bootcamp | ||
resources: {} | ||
terminationMessagePath: /dev/termination-log | ||
terminationMessagePolicy: File | ||
dnsPolicy: ClusterFirst | ||
restartPolicy: Always | ||
schedulerName: default-scheduler | ||
securityContext: {} | ||
terminationGracePeriodSeconds: 30 | ||
status: | ||
conditions: | ||
- lastTransitionTime: "2023-10-02T15:26:08Z" | ||
lastUpdateTime: "2023-10-02T15:26:08Z" | ||
message: Deployment does not have minimum availability. | ||
reason: MinimumReplicasUnavailable | ||
status: "False" | ||
type: Available | ||
- lastTransitionTime: "2023-10-02T15:26:07Z" | ||
lastUpdateTime: "2023-10-02T15:26:10Z" | ||
message: ReplicaSet "kubernetes-bootcamp-855d5cc575" is progressing. | ||
reason: ReplicaSetUpdated | ||
status: "True" | ||
type: Progressing | ||
observedGeneration: 1 | ||
replicas: 1 | ||
unavailableReplicas: 1 | ||
updatedReplicas: 1 |
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