Skip to content

Commit

Permalink
fix: address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rkpattnaik780 authored and wtrocki committed Apr 26, 2022
1 parent e134e8b commit 0741aa2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docs/commands/rhoas_generate-config.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 22 additions & 20 deletions pkg/cmd/generate/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ var (
`)

templateJSON = heredoc.Doc(`
{
{{if .KafkaHost}}"kafkaHost":"{{.KafkaHost}}",
{{end}}{{if .RegistryURL}}"serviceRegistryUrl":"{{.RegistryURL}}",
"serviceRegistryCorePath":"` + registrycmdutil.REGISTRY_CORE_PATH + `",
"serviceRegistryCompatPath":"` + registrycmdutil.REGISTRY_COMPAT_PATH + `",
{{end}}"rhoasClientID":"{{.ClientID}}",
"rhoasClientSecret":"{{.ClientSecret}}",
"rhoasOauthTokenUrl":"{{.TokenURL}}"
{
{{if .KafkaHost}}"kafkaHost":"{{.KafkaHost}}",
{{end}}{{if .RegistryURL}}"serviceRegistryUrl":"{{.RegistryURL}}",
"serviceRegistryCorePath":"` + registrycmdutil.REGISTRY_CORE_PATH + `",
"serviceRegistryCompatPath":"` + registrycmdutil.REGISTRY_COMPAT_PATH + `",
{{end}}"rhoasClientID":"{{.ClientID}}",
"rhoasClientSecret":"{{.ClientSecret}}",
"rhoasOauthTokenUrl":"{{.TokenURL}}"
}
`)

Expand All @@ -52,18 +52,20 @@ var (
apiVersion: v1
kind: Secret
metadata:
name: {{.Name}}
name: {{.Name}}
type: Opaque
stringData:
{{if .KafkaHost}}## Kafka Configuration
KAFKA_HOST: {{.KafkaHost}}{{end}}
{{if .RegistryURL}}## Service Registry Configuration
SERVICE_REGISTRY_URL: {{.RegistryURL}}
SERVICE_REGISTRY_CORE_PATH: ` + registrycmdutil.REGISTRY_CORE_PATH + `
SERVICE_REGISTRY_COMPAT_PATH: ` + registrycmdutil.REGISTRY_COMPAT_PATH + `
{{end}}
## Authentication Configuration
RHOAS_CLIENT_ID: {{.ClientID}}
RHOAS_CLIENT_SECRET: {{.ClientSecret}}
RHOAS_OAUTH_TOKEN_URL: {{.TokenURL}}`)
{{if .KafkaHost}}## Kafka Configuration
KAFKA_HOST: {{.KafkaHost}}
{{end}}
{{if .RegistryURL}}## Service Registry Configuration
SERVICE_REGISTRY_URL: {{.RegistryURL}}
SERVICE_REGISTRY_COMPAT_PATH: ` + registrycmdutil.REGISTRY_COMPAT_PATH + `
SERVICE_REGISTRY_CORE_PATH: ` + registrycmdutil.REGISTRY_CORE_PATH + `
{{end}}
## Authentication Configuration
RHOAS_CLIENT_ID: {{.ClientID}}
RHOAS_CLIENT_SECRET: {{.ClientSecret}}
RHOAS_OAUTH_TOKEN_URL: {{.TokenURL}}
`)
)
2 changes: 1 addition & 1 deletion pkg/core/localize/locales/en/cmd/generate_config.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ one='Type of configuration file to be generated'

[generate.common.flag.fileLocation.description]
description = 'Description for --output-file flag'
one = 'Sets a custom file location to save the credentials'
one = 'Sets a custom file location to save the configurations'


[generate.log.info.noSevices]
Expand Down

0 comments on commit 0741aa2

Please sign in to comment.