Skip to content

added PodSecurityContext #4865

added PodSecurityContext

added PodSecurityContext #4865

Triggered via pull request February 20, 2024 21:19
Status Failure
Total duration 3m 31s
Artifacts

knative-style.yaml

on: pull_request
style  /  changes
4s
style / changes
style  /  ...  /  Auto-format and Check
13s
style / Golang / Auto-format and Check
style  /  ...  /  Lint
3m 4s
style / Golang / Lint
style  /  ...  /  Do Not Submit
7s
style / Golang / Do Not Submit
style  /  ...  /  shell
0s
style / suggester / shell
style  /  ...  /  yaml
0s
style / suggester / yaml
style  /  ...  /  github_actions
0s
style / suggester / github_actions
Matrix: style / Golang / Boilerplate Check
Fit to window
Zoom out
Zoom in

Annotations

9 errors and 16 warnings
style / Golang / Auto-format and Check: cmd/create.go#L1
Please run goimports. diff --git a/cmd/create.go b/cmd/create.go index 11da512..f308c4e 100644 --- a/cmd/create.go +++ b/cmd/create.go @@ -178,11 +178,11 @@ func newCreateConfig(cmd *cobra.Command, args []string, newClient ClientFactory) dirName string absolutePath string ) - client, done := newClient(ClientConfig{Verbose: cfg.Verbose}) + client, done := newClient(ClientConfig{Verbose: cfg.Verbose}) defer done() // IN confirm mode. If also in an interactive terminal, run prompts. - if len(args)<1 { + if len(args) < 1 { createdCfg, err := cfg.prompt(client) if err != nil { return createdCfg, err @@ -190,7 +190,7 @@ func newCreateConfig(cmd *cobra.Command, args []string, newClient ClientFactory) fmt.Println("Command:") fmt.Println(singleCommand(cmd, args, createdCfg)) return createdCfg, nil - }else { + } else { path = args[0] }
style / Golang / Auto-format and Check: pkg/functions/function.go#L1
Please run goimports. diff --git a/pkg/functions/function.go b/pkg/functions/function.go index 459f8cc..dd9c587 100644 --- a/pkg/functions/function.go +++ b/pkg/functions/function.go @@ -141,7 +141,7 @@ type RunSpec struct { // Env variables to be set Envs Envs `yaml:"envs,omitempty"` - + // PodSecurityContext to be set for read and write permission PodSecurityContext PodSecurityContext `yaml:"podSecurityContext, omitempty"` // StartTimeout specifies that this function should have a custom timeout
style / Golang / Auto-format and Check: pkg/knative/deployer.go#L1
Please run goimports. diff --git a/pkg/knative/deployer.go b/pkg/knative/deployer.go index 19e201e..84e8460 100644 --- a/pkg/knative/deployer.go +++ b/pkg/knative/deployer.go @@ -435,7 +435,7 @@ func generateNewService(f fn.Function, decorator DeployDecorator) (*v1.Service, for k, v := range annotations { revisionAnnotations[k] = v } - PodSecurityContext := getPodSecurityContext(f.Run) + PodSecurityContext := getPodSecurityContext(f.Run) service := &v1.Service{ ObjectMeta: metav1.ObjectMeta{ Name: f.Name, @@ -1077,12 +1077,12 @@ func setServiceOptions(template *v1.RevisionTemplateSpec, options fn.Options) er return servingclientlib.UpdateRevisionTemplateAnnotations(template, toUpdate, toRemove) } -func getPodSecurityContext(RunSpec fn.RunSpec) *corev1.PodSecurityContext{ - return &corev1.PodSecurityContext{ - RunAsUser: RunSpec.PodSecurityContext.RunAsUser, - RunAsGroup: RunSpec.PodSecurityContext.RunAsGroup, +func getPodSecurityContext(RunSpec fn.RunSpec) *corev1.PodSecurityContext { + return &corev1.PodSecurityContext{ + RunAsUser: RunSpec.PodSecurityContext.RunAsUser, + RunAsGroup: RunSpec.PodSecurityContext.RunAsGroup, RunAsNonRoot: RunSpec.PodSecurityContext.RunAsNonRoot, - FSGroup: RunSpec.PodSecurityContext.FSGroup, + FSGroup: RunSpec.PodSecurityContext.FSGroup, } -} \ No newline at end of file +}
style / Golang / Auto-format and Check
Process completed with exit code 1.
style / Golang / Lint: pkg/functions/function.go#L144
[trailing whitespace] reported by reviewdog 🐶 Raw Output: pkg/functions/function.go:144:
style / Golang / Lint: schema/func_yaml-schema.json#L373
[trailing whitespace] reported by reviewdog 🐶 Raw Output: schema/func_yaml-schema.json:373:
style / Golang / Lint
Process completed with exit code 1.
style / Golang / Lint: pkg/knative/deployer.go#L1088
[EOF Newline] reported by reviewdog 🐶 Missing newline Raw Output: pkg/knative/deployer.go:1088: Missing newline
style / Golang / Lint
Process completed with exit code 1.
style / changes
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: dorny/paths-filter@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
style / Golang / Do Not Submit
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
style / Golang / Boilerplate Check (sh)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/setup-go@v4, actions/checkout@v3, andstor/file-existence-action@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
style / Golang / Boilerplate Check (sh)
The following actions uses node12 which is deprecated and will be forced to run on node16: andstor/file-existence-action@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
style / Golang / Boilerplate Check (sh)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
style / Golang / Boilerplate Check (sh)
Restore cache failed: Dependencies file is not found in /home/runner/work/func/func. Supported file pattern: go.sum
style / Golang / Auto-format and Check
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/setup-go@v4, actions/checkout@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
style / Golang / Auto-format and Check
Restore cache failed: Dependencies file is not found in /home/runner/work/func/func. Supported file pattern: go.sum
style / Golang / Boilerplate Check (go)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/setup-go@v4, actions/checkout@v3, andstor/file-existence-action@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
style / Golang / Boilerplate Check (go)
The following actions uses node12 which is deprecated and will be forced to run on node16: andstor/file-existence-action@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
style / Golang / Boilerplate Check (go)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
style / Golang / Boilerplate Check (go)
Restore cache failed: Dependencies file is not found in /home/runner/work/func/func. Supported file pattern: go.sum
style / Golang / Lint
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/setup-go@v4, actions/checkout@v3, andstor/file-existence-action@v1, golangci/golangci-lint-action@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
style / Golang / Lint
The following actions uses node12 which is deprecated and will be forced to run on node16: andstor/file-existence-action@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
style / Golang / Lint
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
style / Golang / Lint
Restore cache failed: Dependencies file is not found in /home/runner/work/func/func. Supported file pattern: go.sum