Skip to content

Commit

Permalink
cleanup: change env-prefix to SBOM
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Kotzbauer <[email protected]>
  • Loading branch information
ckotzbauer committed Jan 29, 2022
1 parent a30856d commit 2e0c59e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ All parameters are cli-flags.
| `pod-label-selector` | `false` | `""` | Kubernetes Label-Selector for pods. |
| `namespace-label-selector` | `false` | `""` | Kubernetes Label-Selector for namespaces. |

The flags can be configured as args or as environment-variables prefixed with `SGO_` to inject sensitive configs as secret values.
The flags can be configured as args or as environment-variables prefixed with `SBOM_` to inject sensitive configs as secret values.

#### Example Helm-Config

Expand All @@ -89,7 +89,7 @@ args:
cron: "0 30 * * * *"

envVars:
- name: SGO_GIT_ACCESS_TOKEN
- name: SBOM_GIT_ACCESS_TOKEN
valueFrom:
secretKeyRef:
name: "sbom-operator"
Expand Down
2 changes: 1 addition & 1 deletion deploy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
- image: ghcr.io/ckotzbauer/sbom-operator:latest
name: operator
env:
- name: SGO_GIT_ACCESS_TOKEN
- name: SBOM_GIT_ACCESS_TOKEN
valueFrom:
secretKeyRef:
name: "sbom-operator"
Expand Down
2 changes: 1 addition & 1 deletion internal/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func BindFlags(cmd *cobra.Command, args []string) {
// flagToEnvVar converts command flag name to equivalent environment variable name
func flagToEnvVar(flag string) string {
envVarSuffix := strings.ToUpper(strings.ReplaceAll(flag, "-", "_"))
return fmt.Sprintf("%s_%s", "SGO", envVarSuffix)
return fmt.Sprintf("%s_%s", "SBOM", envVarSuffix)
}

//SetUpLogs set the log output ans the log level
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func init() {
}

func initConfig() {
viper.SetEnvPrefix("SGO")
viper.SetEnvPrefix("SBOM")
viper.AutomaticEnv()
}

Expand Down

0 comments on commit 2e0c59e

Please sign in to comment.