Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Fix Typo in InCluster Job Example #310

Merged

Conversation

J12934
Copy link
Contributor

@J12934 J12934 commented Oct 12, 2020

Description

Found a small typo in the in-cluster job example.
Should be automountServiceAccountToken not automountServiceAccount.

pbpaste | kubectl apply -f -
error: error validating "STDIN": error validating data: ValidationError(Job.spec.template.spec): unknown field "automountServiceAccount" in io.k8s.api.core.v1.PodSpec; if you choose to ignore these errors, turn validation off with --validate=false

Also I think it would be best to set this to true, as kubeaudit actually needs the token and the rest of the CA mounted alongside it to communicate with the API Server. It'll fail otherwise even in clusters without RBAC enabled (at least in Docker Desktops for Mac's Kubernetes cluster), see logs below:

time="2020-10-12T10:07:28Z" level=fatal msg="Error auditing cluster in local mode" error="invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable"
Type of change
  • Documentation fix 📚
How Has This Been Tested?
  • Run locally on Docker Desktop Kubernetes Cluster
Checklist:
  • I have 🎩 my changes (A 🎩 specifically includes pulling down changes, setting them up, and manually testing the changed features and potential side effects to make sure nothing is broken)
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The test coverage did not decrease
  • I have signed the appropriate Contributor License Agreement

@ghost
Copy link

ghost commented Oct 12, 2020

Thanks for opening this pull request! Please check out our contributing guidelines and sign the CLA.

@genevieveluyt
Copy link
Contributor

genevieveluyt commented Oct 13, 2020

Good catch! We definitely want to provide a working example so I think we should add a service account

apiVersion: v1
kind: ServiceAccount
metadata:
  name: kubeaudit
  namespace: default

remove automountServiceAccountToken (let it default to true) and set serviceAccountName: kubeaudit

@J12934
Copy link
Contributor Author

J12934 commented Oct 13, 2020

Ah yes, good idea 👍
I've updated the PR.

Copy link
Contributor

@genevieveluyt genevieveluyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect thank you!

@genevieveluyt genevieveluyt merged commit e429a88 into Shopify:master Oct 13, 2020
@ghost
Copy link

ghost commented Oct 13, 2020

Congrats on merging your first pull request, keep em coming!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants