Upgrade k8s package verison (#5358)
* upgrade k8s package version Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io> * Script upgrade and code formatting. Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io> Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>
This commit is contained in:
17
vendor/helm.sh/helm/v3/pkg/engine/engine.go
vendored
17
vendor/helm.sh/helm/v3/pkg/engine/engine.go
vendored
@@ -97,7 +97,7 @@ const warnStartDelim = "HELM_ERR_START"
|
||||
const warnEndDelim = "HELM_ERR_END"
|
||||
const recursionMaxNums = 1000
|
||||
|
||||
var warnRegex = regexp.MustCompile(warnStartDelim + `(.*)` + warnEndDelim)
|
||||
var warnRegex = regexp.MustCompile(warnStartDelim + `((?s).*)` + warnEndDelim)
|
||||
|
||||
func warnWrap(warn string) string {
|
||||
return warnStartDelim + warn + warnEndDelim
|
||||
@@ -344,13 +344,20 @@ func allTemplates(c *chart.Chart, vals chartutil.Values) map[string]renderable {
|
||||
//
|
||||
// As it recurses, it also sets the values to be appropriate for the template
|
||||
// scope.
|
||||
func recAllTpls(c *chart.Chart, templates map[string]renderable, vals chartutil.Values) {
|
||||
func recAllTpls(c *chart.Chart, templates map[string]renderable, vals chartutil.Values) map[string]interface{} {
|
||||
subCharts := make(map[string]interface{})
|
||||
chartMetaData := struct {
|
||||
chart.Metadata
|
||||
IsRoot bool
|
||||
}{*c.Metadata, c.IsRoot()}
|
||||
|
||||
next := map[string]interface{}{
|
||||
"Chart": c.Metadata,
|
||||
"Chart": chartMetaData,
|
||||
"Files": newFiles(c.Files),
|
||||
"Release": vals["Release"],
|
||||
"Capabilities": vals["Capabilities"],
|
||||
"Values": make(chartutil.Values),
|
||||
"Subcharts": subCharts,
|
||||
}
|
||||
|
||||
// If there is a {{.Values.ThisChart}} in the parent metadata,
|
||||
@@ -362,7 +369,7 @@ func recAllTpls(c *chart.Chart, templates map[string]renderable, vals chartutil.
|
||||
}
|
||||
|
||||
for _, child := range c.Dependencies() {
|
||||
recAllTpls(child, templates, next)
|
||||
subCharts[child.Name()] = recAllTpls(child, templates, next)
|
||||
}
|
||||
|
||||
newParentID := c.ChartFullPath()
|
||||
@@ -376,6 +383,8 @@ func recAllTpls(c *chart.Chart, templates map[string]renderable, vals chartutil.
|
||||
basePath: path.Join(newParentID, "templates"),
|
||||
}
|
||||
}
|
||||
|
||||
return next
|
||||
}
|
||||
|
||||
// isTemplateValid returns true if the template is valid for the chart type
|
||||
|
||||
@@ -63,7 +63,7 @@ func NewLookupFunction(config *rest.Config) lookupFunc {
|
||||
}
|
||||
return obj.UnstructuredContent(), nil
|
||||
}
|
||||
//this will return a list
|
||||
// this will return a list
|
||||
obj, err := client.List(context.Background(), metav1.ListOptions{})
|
||||
if err != nil {
|
||||
if apierrors.IsNotFound(err) {
|
||||
@@ -112,7 +112,7 @@ func getAPIResourceForGVK(gvk schema.GroupVersionKind, config *rest.Config) (met
|
||||
return res, err
|
||||
}
|
||||
for _, resource := range resList.APIResources {
|
||||
//if a resource contains a "/" it's referencing a subresource. we don't support suberesource for now.
|
||||
// if a resource contains a "/" it's referencing a subresource. we don't support suberesource for now.
|
||||
if resource.Kind == gvk.Kind && !strings.Contains(resource.Name, "/") {
|
||||
res = resource
|
||||
res.Group = gvk.Group
|
||||
|
||||
Reference in New Issue
Block a user