Skip to content

Commit

Permalink
Response to review comments: add gosec, add comment to main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
jgwest committed May 26, 2022
1 parent 846dbf9 commit f287ecc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ jobs:
cd $GITHUB_WORKSPACE/appstudio-controller
make gosec
- name: "Ensure 'appstudio-shared' passes 'go-sec' - run 'make gosec' to identify issues"
run: |
cd $GITHUB_WORKSPACE/appstudio-shared
make gosec
- name: "Ensure 'backend' passes 'go-lint' - run 'make lint' to identify issues"
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.40.1
Expand Down
12 changes: 12 additions & 0 deletions appstudio-shared/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package main

import (
"flag"
"fmt"
"os"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
Expand Down Expand Up @@ -48,6 +49,17 @@ func init() {
}

func main() {

// NOTE: This code will never execute: it was generated by the kubebuilder scaffolding, and is (seemingly?) required
// in order to perform certain kubebuilder operations.
//
// To prevent it from runnign, I have added the following statement.
if fmt.Errorf("this could should not execute") != nil {
fmt.Println("Appstudio-shared code should not be invoked directly.")
os.Exit(1)
return
}

var metricsAddr string
var enableLeaderElection bool
var probeAddr string
Expand Down

0 comments on commit f287ecc

Please sign in to comment.