Skip to content

FR: Add spec.values to the HelmChart CRD for structured YAML support #218

Open
@aofei

Description

@aofei

Introduction

Currently, the HelmChart CRD supports specifying Chart values via spec.valuesContent as a raw string. While effective, this method lacks the ability to leverage YAML syntax checking when editing manifests with editors. This proposal suggests an enhancement to the HelmChart CRD to address this limitation.

The primary goal of this proposal is to introduce a new field, spec.values, to the HelmChart CRD. This field will allow users to provide Chart values as a YAML document rather than a raw string. This enhancement aims to improve the user experience by enabling YAML syntax validation during the editing process.

Proposed Changes

1. Introduction of spec.values

Add a new field spec.values to the HelmChart CRD. This field should accept a YAML document representing the Chart values.

2. Precedence rule

In cases where both spec.values and spec.valuesContent are provided, spec.valuesContent will take precedence (just like spec.chart and spec.chartContent). This ensures backward compatibility and provides flexibility for users who prefer the raw string format.

3. Implementation

Perhaps introduce a new field Values to the pkg/apis/helm.cattle.io/v1. HelmChartSpec struct:

import "encoding/json"

type HelmChartSpec struct {
	// ...
	Values *json.RawMessage `json:"values,omitempty"`
}

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