Skip to content

Yamlls: Property metrics is not allowed. #155

@Rom888

Description

@Rom888

cat hpa.yaml

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: dd
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: dd
  minReplicas: 2
  maxReplicas: {{ .Values.autoscaling.maxReplicas }}
  metrics:
    - type: External

I see this wrong diagnostics with the code above:

  1. Yamlls: Property metrics is not allowed. yaml-schema: https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.32.1-standalone-strict/_definitions.json [513]

But there are no errors without {{ }}:

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: dd
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: dd
  minReplicas: 2
  maxReplicas: 3
  metrics:
    - type: External

ubuntu, nvim
helm-ls v0.4.1
helm-ls.nvim
filetype=helm
nvim lsp config:

vim.lsp.config('helm_ls', {
  cmd = { 'helm_ls', 'serve' },
  filetypes = { 'helm', 'yaml.helm-values' },
  root_markers = { 'Chart.yaml' },
  capabilities = {
    workspace = {
      didChangeWatchedFiles = {
        dynamicRegistration = true,
      },
    },
  },
})
vim.lsp.enable('helm_ls')

The values.lint.yaml doesn't change anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions