Skip to content

Conversation

@carolynvs
Copy link
Member

  • Read config from porter on stdin
  • Fallback to AZURE_STORAGE_CONNECTION_STRING

Relies on getporter/porter#776

* Read config from porter on stdin
* Fallback to AZURE_STORAGE_CONNECTION_STRING
@carolynvs carolynvs marked this pull request as ready for review January 22, 2020 20:42
@carolynvs carolynvs requested a review from vdice January 22, 2020 20:42
@carolynvs
Copy link
Member Author

I've rebased this after all the work we've done with vanity imports and go mods. PTAL @vdice

"os"
"regexp"

"get.porter.sh/plugin/azure/pkg/azure/config"
Copy link
Member Author

Choose a reason for hiding this comment

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

I wrote this originally in Oct and in hindsight I hate that I named this package config too. It makes it hard to tell if I'm using porter's config or this one. Do you have suggestions for differentiating the package name and/or the Config struct name?

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps just name the import as azureconfig or some such when used? And/or AzureConfig as the struct?

@carolynvs
Copy link
Member Author

I realize this needs tests but I really don't want to hold up this even longer and it's not being used yet. You okay with merging this if it's good and making progress on how to test a plugin in a follow-up PR?

@carolynvs
Copy link
Member Author

I feel like I need a "how to test this stuff group hug" 🤗

Copy link
Member

@vdice vdice left a comment

Choose a reason for hiding this comment

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

LGTM

"os"
"regexp"

"get.porter.sh/plugin/azure/pkg/azure/config"
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps just name the import as azureconfig or some such when used? And/or AzureConfig as the struct?


err = json.Unmarshal(b, &p.Config)
if err != nil {
return errors.Wrapf(err, "error unmarshaling stdin %q as azure.Config", string(b))
Copy link
Member

Choose a reason for hiding this comment

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

azure.Config may need updating depending on what we settle on for pkg/import/struct name. Or, perhaps we remove mention of the internal struct name itself... or generify? (just made that one up.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Go's push to not repeat yourself (stuttering) causes more problems IMO. I'm going to try azureconfig.Config and see how that works.

@carolynvs carolynvs merged commit 44c12d7 into getporter:master Jan 22, 2020
@carolynvs carolynvs deleted the config branch January 22, 2020 21:39
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.

3 participants