Open Prajyot-Parab opened 1 year ago
/good-first-issue
@Prajyot-Parab: This request has been marked as suitable for new contributors.
Please ensure that the issue body includes answers to the following questions:
For more details on the requirements of such an issue, please see here and ensure that they are met.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue
command.
/assign @yuanning6
I'd love to help fix this issue! Can I get some guide about where to start?
@yuanning6 You can start by checking the other linters we have - https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/.golangci.yml
can run make lint
target to see the behavior
we want to do same thing for yaml files to avoid issues such as https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/commit/7cd7fcc1c0448df9caae393fa63720a874b36c85
@Prajyot-Parab Thank you so much for your guidance!
I found yamllint is a popular tool to lint yaml files, can I start with this? And should I make the lint rules very strict or kind of loose?
@Prajyot-Parab Thank you so much for your guidance!
I found yamllint is a popular tool to lint yaml files, can I start with this? And should I make the lint rules very strict or kind of loose?
Yes you can start with whatever is the relevant tool, lets start with loose rules and we will make them stricter going ahead as and when required.
@Prajyot-Parab Sure! I did some implementations and made a PR https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/pull/1521, it's just for you to have an overview and see if I'm on the right direction. Please let me know any changes I should make!
@Prajyot-Parab Sure! I did some implementations and made a PR #1521, it's just for you to have an overview and see if I'm on the right direction. Please let me know any changes I should make!
I will take a look at this today, thanks!
@Prajyot-Parab Sure! I did some implementations and made a PR #1521, it's just for you to have an overview and see if I'm on the right direction. Please let me know any changes I should make!
I will take a look at this today, thanks!
Thank you! :))
The tool used for listing yaml is yamlint
can be installed via https://yamllint.readthedocs.io/en/stable/quickstart.html#installing-yamllint
Checking on how to consume this in CI or if there is a better to which can be installed and used easily.
/cc @priyanshikhetwani
/assign
yamllint will check YAML files for formatting issues, syntax errors, and key-value pair problems.
1:1 warning missing document start "---" (document-start) 12:10 error trailing spaces (trailing-spaces) 18:14 error too many spaces after colon (colons) 38:15 error too many spaces after colon (colons) 56:21 error too many spaces after colon (colons) 61:21 error too many spaces after colon (colons) 169:1 error trailing spaces (trailing-spaces)
KubeLinter will check Kubernetes YAML files and Helm charts for misconfigurations and programming errors.
/Users/priyanshikhetwani/Desktop/cluster-api-provider_ibmcloud/cluster-api-provider-ibmcloud/config/default/manager_credentials_patch.yaml: (object: system/controller-manager apps/v1, Kind=Deployment) container "manager" is not set to runAsNonRoot (check: run-as-non-root, remediation: Set runAsUser to a non-zero number and runAsNonRoot to true in your pod or container securityContext. Refer to https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ for details.)
/Users/priyanshikhetwani/Desktop/cluster-api-provider_ibmcloud/cluster-api-provider-ibmcloud/config/default/manager_credentials_patch.yaml: (object: system/controller-manager apps/v1, Kind=Deployment) container "manager" has cpu request 0 (check: unset-cpu-requirements, remediation: Set CPU requests and limits for your container based on its requirements. Refer to https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits for details.)
For this issue, we can use yamllint but for longer run kube-linter can be helpful as well. Exploring more so i can find some tool for both the usecases.
@priyanshikhetwani do you think for basic syntax checks, we can get started with using yamllint?
/kind bug /area provider/ibmcloud
What steps did you take and what happened:
What did you expect to happen:
Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]
Environment:
kubectl version
):/etc/os-release
):