-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(kubernetes): fix in ServiceAccountTokens check (#3717)
handle edge-case of spec not a dict
- Loading branch information
1 parent
5ea552e
commit 825e8e8
Showing
2 changed files
with
25 additions
and
0 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
23 changes: 23 additions & 0 deletions
23
tests/kubernetes/checks/example_ServiceAccountTokens/ServiceAccountTokensUNKNOWN.yaml
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: apps/v1 #we know that all the communication in k8s happen through api. | ||
#what we want to create | ||
#inside kind you need to define type of api you want to execute. | ||
kind: Deployment #pod#service | ||
metadata: #using metada and name we define the name of deployment | ||
name: myapp-deployment #a deployment name myapp-deployment is created using .metadata.name field | ||
labels: | ||
app: myapp | ||
spec: #inside your deployment we need to provide spec how this deployment api will launch your pod | ||
replicas: 3 #it will create three pod | ||
selector: #the .spec.selector file define ho the deployment find which pod to manage. | ||
matchLabels: #.spec.selector.matchlabel it is euqivalent to map ke,value. something called as match expression | ||
app: myapp | ||
template: #container template deploy in three pod | ||
metadata: | ||
name: myapp-pod #using metadata name | ||
labels: | ||
app: myapp #this label should match with pod label. | ||
spec: #we define container spec | ||
- name: myapp-container | ||
image: nginx | ||
ports: | ||
- containerPort: 80 |