Skip to content

grafana, loki and prometheus-server addons fail to render on KubeVela v1.11 (CUE v0.14) #805

Open

Description

@RaphaelFakhri

Description

On KubeVela v1.11.0, which builds against CUE v0.14.1, the grafana, loki and prometheus-server addons can't be enabled. Their app templates join lists with +:

policies: commonPolicies + [{ ... }]
workflow: steps: [{ ... }] + postDeploySteps

CUE v0.11 removed list arithmetic, so the addon's CUE fails to compile:

output.spec.policies: Addition of lists is superseded by list.Concat; see https://cuelang.org/e/v0.11-list-arithmetic

The CUE compatibility upgrade that rewrites + into list.Concat (kubevela#6983, the fix for #786) runs on definition templates only. vela addon enable builds template.cue and resources/*.cue in pkg/addon/render.go with cuecontext.New().BuildInstance, and nothing upgrades them first. The same failure was fixed for velaux in #788.

Affected spots:

  • addons/grafana/template.cue: components, policies, workflow.steps
  • addons/loki/template.cue: components, policies, workflow.steps
  • addons/loki/resources/loki.cue: volumeMounts.emptyDir
  • addons/loki/resources/agent-promtail.cue: traits
  • addons/prometheus-server/template.cue: policies, workflow.steps

Steps to reproduce

  1. Install KubeVela v1.11.0.
  2. Run vela addon enable grafana (or loki, prometheus-server).

To reproduce without a cluster, compile an addon's package main files with cue v0.14.1:

cd addons/prometheus-server
cue vet -c=false template.cue parameter.cue resources/*.cue

Expected behavior

The addons render and enable as they do on KubeVela v1.10.

Environment

KubeVela v1.11.0 (CUE v0.14.1). The addon e2e test doesn't catch this because all three addons are listed in test/e2e-test/addon-test/PENDING.

Activity

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

Metadata

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