Skip to content

Commit

Permalink
fix linting and pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Bially committed Mar 5, 2024
1 parent 38905df commit ec828db
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ jobs:
dep ensure
fi
- name: Build
run: go build -v -o otc-auth .
run: go build -v -o waf-cert-uploader
- name: Upload the built binary executable for testing
uses: actions/upload-artifact@v2
with:
name: build
path: otc-auth
path: waf-cert-uploader
test:
needs: build
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ jobs:
with:
push: true
tags: |
ghcr.io/iits-consulting/otc-auth:latest
ghcr.io/iits-consulting/otc-auth:${{ env.RELEASE_VERSION }}
ghcr.io/iits-consulting/waf-cert-uploader:latest
ghcr.io/iits-consulting/waf-cert-uploader:${{ env.RELEASE_VERSION }}
6 changes: 3 additions & 3 deletions controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ func HandleUploadCertToWaf(writer http.ResponseWriter, httpRequest *http.Request
return
}

writeResponseObjectToConnection(writer, err, *responseBytes)
writeResponseObjectToConnection(writer, *responseBytes)
}

func writeResponseObjectToConnection(writer http.ResponseWriter, err error, responseBytes []byte) {
_, err = writer.Write(responseBytes)
func writeResponseObjectToConnection(writer http.ResponseWriter, responseBytes []byte) {
_, err := writer.Write(responseBytes)
if err != nil {
log.Println("http reply failed", err)
}
Expand Down
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
)

type ServerParameters struct {
port int // webhook server port
certFile string // path to the x509 certificate for https
keyFile string // path to the x509 private key matching `CertFile`
}
Expand Down
18 changes: 18 additions & 0 deletions service/waf_client_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,29 @@ var getAuthOptionsFromMountedSecret = func() error {
return errors.New("environment variable for the credentials mount path was not found")
}
username, err := os.ReadFile(credentialsMountPath + "username")
if err != nil {
return err
}
password, err := os.ReadFile(credentialsMountPath + "password")
if err != nil {
return err
}
accessKey, err := os.ReadFile(credentialsMountPath + "accessKey")
if err != nil {
return err
}
secretKey, err := os.ReadFile(credentialsMountPath + "secretKey")
if err != nil {
return err
}
otcAccountName, err := os.ReadFile(credentialsMountPath + "otcAccountName")
if err != nil {
return err
}
projectName, err := os.ReadFile(credentialsMountPath + "projectName")
if err != nil {
return err
}
region := strings.Split(string(projectName), "_")[0]

if err != nil {
Expand Down

0 comments on commit ec828db

Please sign in to comment.