Skip to content

Commit ee1f802

Browse files
formatted the code also made some fixes
1 parent f56dce1 commit ee1f802

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

cmd/create.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -567,4 +567,4 @@ func RuntimeTemplateOptions(client *fn.Client) (string, error) {
567567
}
568568
writer.Flush()
569569
return builder.String(), nil
570-
}
570+
}

pkg/functions/function.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ type RunSpec struct {
167167

168168
// Env variables to be set
169169
Envs Envs `yaml:"envs,omitempty"`
170-
170+
171171
// PodSecurityContext to be set for read and write permission
172172
PodSecurityContext PodSecurityContext `yaml:"podSecurityContext, omitempty"`
173173
// StartTimeout specifies that this function should have a custom timeout

pkg/functions/function_security.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package functions
22

33
type PodSecurityContext struct {
4-
RunAsUser *int64 `yaml:"RunAsUser,omitempty"`
5-
RunAsGroup *int64 `yaml:"RunAsGroup,omitempty"`
6-
RunAsNonRoot *bool `yaml:"RunAsNonRoot,omitempty"`
7-
FSGroup *int64 `yaml:"FSGroup,omitempty"`
4+
RunAsUser *int64 `yaml:"RunAsUser,omitempty"`
5+
RunAsGroup *int64 `yaml:"RunAsGroup,omitempty"`
6+
RunAsNonRoot *bool `yaml:"RunAsNonRoot,omitempty"`
7+
FSGroup *int64 `yaml:"FSGroup,omitempty"`
88
}

pkg/knative/deployer.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ func generateNewService(f fn.Function, decorator DeployDecorator, daprInstalled
461461
for k, v := range annotations {
462462
revisionAnnotations[k] = v
463463
}
464-
PodSecurityContext := getPodSecurityContext(f.Run)
464+
PodSecurityContext := getPodSecurityContext(f.Run)
465465
service := &v1.Service{
466466
ObjectMeta: metav1.ObjectMeta{
467467
Name: f.Name,
@@ -1110,12 +1110,12 @@ func setServiceOptions(template *v1.RevisionTemplateSpec, options fn.Options) er
11101110
return servingclientlib.UpdateRevisionTemplateAnnotations(template, toUpdate, toRemove)
11111111
}
11121112

1113-
func getPodSecurityContext(RunSpec fn.RunSpec) *corev1.PodSecurityContext{
1114-
return &corev1.PodSecurityContext{
1115-
RunAsUser: RunSpec.PodSecurityContext.RunAsUser,
1116-
RunAsGroup: RunSpec.PodSecurityContext.RunAsGroup,
1113+
func getPodSecurityContext(RunSpec fn.RunSpec) *corev1.PodSecurityContext {
1114+
return &corev1.PodSecurityContext{
1115+
RunAsUser: RunSpec.PodSecurityContext.RunAsUser,
1116+
RunAsGroup: RunSpec.PodSecurityContext.RunAsGroup,
11171117
RunAsNonRoot: RunSpec.PodSecurityContext.RunAsNonRoot,
1118-
FSGroup: RunSpec.PodSecurityContext.FSGroup,
1118+
FSGroup: RunSpec.PodSecurityContext.FSGroup,
11191119
}
11201120

1121-
}
1121+
}

schema/func_yaml-schema.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
},
1818
"type": "object",
19-
"description// with containerized docker runner and deployed Knative service integration": "BuilderImages define optional explicit builder images to use by\nbuilder implementations in leau of the in-code defaults. They key\nis the builder's short name. For example:\nbuilderImages:\n pack: example.com/user/my-pack-node-builder\n s2i: example.com/user/my-s2i-node-builder"
19+
"description": "BuilderImages define optional explicit builder images to use by\nbuilder implementations in leau of the in-code defaults. They key\nis the builder's short name. For example:\nbuilderImages:\n pack: example.com/user/my-pack-node-builder\n s2i: example.com/user/my-s2i-node-builder"
2020
},
2121
"buildpacks": {
2222
"items": {

0 commit comments

Comments
 (0)