Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Add default collector port configuration #378

Merged

Conversation

fabriziosestito
Copy link
Member

Adds default collector port configuration in the web side and changes the port number to 8081

Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @fabriziosestito ,

Now that I see this, I have some doubts with the cobra/viper relationship.
I see that, we use the viper.GetString("host") option to retrieve the value, and not the value it self attached in StringVar.
Now, we have 2 flags attached to -p flag. How does this work?
Are cobra and viper intelligent enough to know to get the values from the short flags?
What happens when you use the -p flag?

cmd/web/web.go Outdated
@@ -49,6 +49,7 @@ func NewWebCmd() *cobra.Command {
serveCmd.Flags().StringVar(&dbPassword, "db-password", "postgres", "The database password")
serveCmd.Flags().StringVar(&dbName, "db-name", "trento", "The database name that the application will use")

serveCmd.Flags().IntVarP(&port, "collector-port", "p", 8081, "The port for the data collector service to listen on")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that this port actually is not used, but it wouldn't be better, for sake of being easier to understand, to have other variable? Like collectorPort.
And in fact, would are attached to the short flag p. Doesn't this create a collision?

Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go go!

@fabriziosestito fabriziosestito merged commit 9f9404c into trento-project:main Oct 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants