Skip to content

Commit

Permalink
suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
natasha41575 committed Feb 25, 2022
1 parent d08c209 commit 3807213
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 62 deletions.
5 changes: 0 additions & 5 deletions api/krusty/fnplugin_test.go
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
15 changes: 0 additions & 15 deletions 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
41 changes: 0 additions & 41 deletions 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: {}
10 changes: 9 additions & 1 deletion kyaml/runfn/runfn.go
Expand Up @@ -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,
Expand Down

0 comments on commit 3807213

Please sign in to comment.