diff --git a/api/krusty/fnplugin_test.go b/api/krusty/fnplugin_test.go index fba2938da7b..9b8cf840573 100644 --- a/api/krusty/fnplugin_test.go +++ b/api/krusty/fnplugin_test.go @@ -7,7 +7,6 @@ import ( "testing" "github.com/stretchr/testify/assert" - "sigs.k8s.io/kustomize/api/internal/utils" "sigs.k8s.io/kustomize/api/krusty" kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest" "sigs.k8s.io/kustomize/kyaml/filesys" @@ -669,10 +668,6 @@ generators: m, err := b.Run( fSys, tmpDir.String()) - if utils.IsErrTimeout(err) { - // Don't fail on timeouts. - t.SkipNow() - } assert.NoError(t, err) yml, err := m.AsYaml() assert.NoError(t, err) diff --git a/api/krusty/testdata/charts/helloworld-chart/Chart.yaml b/api/krusty/testdata/charts/helloworld-chart/Chart.yaml index 042041d3b95..de4012af9da 100644 --- a/api/krusty/testdata/charts/helloworld-chart/Chart.yaml +++ b/api/krusty/testdata/charts/helloworld-chart/Chart.yaml @@ -1,21 +1,6 @@ apiVersion: v2 name: helloworld-chart description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. appVersion: 1.16.0 diff --git a/api/krusty/testdata/charts/helloworld-chart/values.yaml b/api/krusty/testdata/charts/helloworld-chart/values.yaml index 904ee169bc8..e81d4bf57dd 100644 --- a/api/krusty/testdata/charts/helloworld-chart/values.yaml +++ b/api/krusty/testdata/charts/helloworld-chart/values.yaml @@ -1,68 +1,27 @@ -# Default values for helloworld-chart. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - replicaCount: 1 - image: repository: nginx pullPolicy: IfNotPresent - imagePullSecrets: [] nameOverride: "" fullnameOverride: "" - serviceAccount: - # Specifies whether a service account should be created create: true - # Annotations to add to the service account annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template name: - podSecurityContext: {} - # fsGroup: 2000 - securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - service: type: ClusterIP port: 80 - ingress: enabled: false annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" hosts: - host: chart-example.local paths: [] tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - nodeSelector: {} - tolerations: [] - affinity: {} diff --git a/kyaml/runfn/runfn.go b/kyaml/runfn/runfn.go index 0a9a67ccb60..0aaa58850ba 100644 --- a/kyaml/runfn/runfn.go +++ b/kyaml/runfn/runfn.go @@ -468,11 +468,19 @@ func (r *RunFns) ffp(spec runtimeutil.FunctionSpec, api *yaml.RNode, currentUser if err != nil { return nil, err } + + // storage mounts can either come from kustomize fn run --mounts, + // or from the declarative function mounts field + storageMounts := spec.Container.StorageMounts + if len(storageMounts) == 0 { + storageMounts = r.StorageMounts + } + c := container.NewContainer( runtimeutil.ContainerSpec{ Image: spec.Container.Image, Network: spec.Container.Network, - StorageMounts: spec.Container.StorageMounts, + StorageMounts: storageMounts, Env: spec.Container.Env, }, uidgid,