mirror of
https://github.com/helm/helm.git
synced 2026-04-22 06:37:10 -04:00
Merge a97ed11efd into 4d4642b83f
This commit is contained in:
commit
7d4042faef
1 changed files with 23 additions and 0 deletions
|
|
@ -412,6 +412,29 @@ func (cfg *Configuration) renderResources(ch *chart.Chart, values common.Values,
|
|||
return hs, b, notes, nil
|
||||
}
|
||||
|
||||
// ensureKubeCompatibility verifies the chart's kubeVersion requirement.
|
||||
func ensureKubeCompatibility(ch *chart.Chart, caps *common.Capabilities) error {
|
||||
if ch == nil || caps == nil {
|
||||
return nil
|
||||
}
|
||||
meta := ch.Metadata
|
||||
if meta == nil {
|
||||
return nil
|
||||
}
|
||||
kubeReq := meta.KubeVersion
|
||||
if kubeReq == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
kubeVer := caps.KubeVersion.String()
|
||||
|
||||
if chartutil.IsCompatibleRange(kubeReq, kubeVer) {
|
||||
return nil
|
||||
}
|
||||
|
||||
return fmt.Errorf("chart requires kubeVersion: %s which is incompatible with Kubernetes %s", kubeReq, kubeVer)
|
||||
}
|
||||
|
||||
// RESTClientGetter gets the rest client
|
||||
type RESTClientGetter interface {
|
||||
ToRESTConfig() (*rest.Config, error)
|
||||
|
|
|
|||
Loading…
Reference in a new issue