Skip to content

Add support for resource.Quantity functions #449

@kvaps

Description

@kvaps

The discussion originally started in Helm repository helm/helm#11376
I think this repo is better place to continue this feature consideration

The implementation of resource.Quantity in Kubernetes is quite complex, far more than just parsing suffixes. Re-implementing and maintaining all of its edge cases as custom Helm functions would be difficult, so I believe it's better to expose the existing functionality through Sprig instead.

This feature is both common and widely used across Kubernetes resources, and it already has comprehensive test coverage:

https://github.com/kubernetes/apimachinery/blob/173776a0582da70432e19d16eca025c451600ae8/pkg/api/resource/quantity.go#L33-L94

A Helm template alone can't match the capabilities provided in the following code

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