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

kubeaudit autofix: triple dash issue in multiline string #582

Open
@til69

Description

ISSUE TYPE
  • Bug Report
  • Feature Idea

BUG REPORT

SUMMARY

--- gets mis-interpreted and is an issue at least in the first occurring multiline string

ENVIRONMENT
  • Kubeaudit version: 0.22.1
  • Kubeaudit install method: Binary
STEPS TO REPRODUCE

manifest.yaml

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: multiline-issue
data:
  k1: |
    ---
    This gets messed up
  k2: |
    --
    This is fine
  k3: |
    -----BEGIN CERTIFICATE-----
    It's an issue in certificates, too...
    -----END CERTIFICATE-----
kubeaudit autofix -f manifest.yaml -o out.yaml
EXPECTED RESULTS

out.yaml

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: multiline-issue
data:
  k1: |
    ---
    This gets messed up
  k2: |
    --
    This is fine
  k3: |
    -----BEGIN CERTIFICATE-----
    It's an issue in certificates, too...
    -----END CERTIFICATE-----
ACTUAL RESULTS

out.yaml

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: multiline-issue
data:
  k1: ""

    ---
    This gets messed up
  k2: |
    --
    This is fine
  k3: |
    -----BEGIN CERTIFICATE-----
    It's an issue in certificates, too...
    -----END CERTIFICATE-----

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions