Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Come up with a standard to pass configuration to the deployed application #115

Merged
merged 13 commits into from
Oct 3, 2023

Conversation

spchortis
Copy link
Contributor

Closes #104

@spchortis spchortis marked this pull request as draft September 26, 2023 14:38
@spchortis spchortis marked this pull request as ready for review September 27, 2023 11:08
Comment on lines 167 to 173
envVarList, err := loadEnvFile(envFile)
if err != nil {
return err
}

serviceManifest.Spec.Template.Spec.Containers[0].Env = append(serviceManifest.Spec.Template.Spec.Containers[0].Env, envVarList...)

Copy link
Member

Choose a reason for hiding this comment

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

I think it could be beneficial to move this in the loadManifest function, by doing this you could also test this better by calling loadManifest with different inputs and testing the result manifest structure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved to load manifest function.
in terms of testing I took out couple of cases that were checking load env file functionality & added sample env file as attribute to loadmanifest test case.

return nil, fmt.Errorf("Error loading %v file: %v", envFile, err)
}
} else {
log.Info(fmt.Sprintf("Environment variables file %s found! Loading..", envFile))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
log.Info(fmt.Sprintf("Environment variables file %s found! Loading..", envFile))
log.Infof("Environment variables file %s found! Loading..", envFile)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had checked on their page for Infof and couldn't find anything related.. And then they had that for formatting messages with log.Info, that is why I went with it. Since Infof is working, switching to that one..

Copy link
Member

Choose a reason for hiding this comment

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

That's interesting, should we contribute back to their repo and add the Infof?

Copy link
Member

@LucaLanziani LucaLanziani left a comment

Choose a reason for hiding this comment

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

Well done @spchortis sorry for the lengthy review cycle ;)

@spchortis spchortis merged commit f1b3c2b into main Oct 3, 2023
2 checks passed
@spchortis spchortis deleted the chore/app_config branch October 3, 2023 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Come up with a standard to pass configuration to the deployed application
2 participants