Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'list' object has no attribute 'startswith' #3

Open
dmitry-mightydevops opened this issue May 28, 2022 · 1 comment

Comments

@dmitry-mightydevops
Copy link

➜ git commit -m "feat: add k8s pre-commit validator"
check for added large files..............................................Passed
check for merge conflicts................................................Passed
forbid new submodules................................(no files to check)Skipped
don't commit to branch...................................................Passed
check for broken symlinks............................(no files to check)Skipped
mixed line ending........................................................Passed
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed
check for case conflicts.................................................Passed
k8svalidate..............................................................Failed
- hook id: k8svalidate
- exit code: 1

Traceback (most recent call last):
  File "/home/dmitry/.cache/pre-commit/repop8pq32lu/py_env-python3.9/bin/k8svalidate", line 117, in <module>
    rc = main()
  File "/home/dmitry/.cache/pre-commit/repop8pq32lu/py_env-python3.9/bin/k8svalidate", line 95, in main
    utils.validate(doc, version, args.strict)
  File "/home/dmitry/.cache/pre-commit/repop8pq32lu/py_env-python3.9/lib/python3.9/site-packages/kubernetes_validate/utils.py", line 61, in validate
    if desired_version.startswith('v'):
AttributeError: 'list' object has no attribute 'startswith'

my precommit config

repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
  rev: v4.2.0
  hooks:
    # Git style
    - id: check-added-large-files
    - id: check-merge-conflict
    - id: forbid-new-submodules
    - id: no-commit-to-branch
    - id: check-symlinks
    - id: mixed-line-ending
      args: [--fix=auto]

    # Common errors
    - id: end-of-file-fixer
    - id: trailing-whitespace
      args: [--markdown-linebreak-ext=md]

    # Cross platform
    - id: check-case-conflict

- repo: https://github.com/Agilicus/pre-commit-hook-k8svalidate.git
  rev: v0.1.0
  hooks:
    - id: k8svalidate
      args: [--kubernetes-version, "1.22", --exclude, "**/*.patch.yaml"]
      files: .yaml$
@donbowman
Copy link
Contributor

hmm, i will take a look

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

No branches or pull requests

2 participants