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: add support for enterprise and child organizations #77

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jakedipity
Copy link
Contributor

This begins support for terraform management of enterprise and child organizations:

  • Allows the provider to accept an enterprise key to indicate an enterprise organization.
  • Enterprise organizations can attach and detach child organizations.

Ref: LOG-13116
Signed-off-by: Jacob Hull [email protected]

copy(opts, args)
sk, ul := opts[0], opts[1]
sk, ul, tp := opts[0], opts[1], opts[2]
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think of renaming these variables to something that imparts meaning? From the following fmt.Sprintf, it looks like sk => serviceKey would make sense. I have no idea what the other two variables would be (the crux of the issue).

logdna/data_source_alert.go Show resolved Hide resolved
logdna/meta.go Show resolved Hide resolved
Comment on lines +64 to +72
func buildSchemaMap(a []TerraformInfo) map[string]*schema.Resource {
m := make(map[string]*schema.Resource)

for _, e := range a {
m[e.name] = e.schema
}

return m
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
func buildSchemaMap(a []TerraformInfo) map[string]*schema.Resource {
m := make(map[string]*schema.Resource)
for _, e := range a {
m[e.name] = e.schema
}
return m
}
func buildSchemaMap(tfInfoList []TerraformInfo) map[string]*schema.Resource {
schemaMap := make(map[string]*schema.Resource)
for _, info := range tfInfoList {
schemaMap[info.name] = info.schema
}
return schemaMap
}

Mainly, the a doesn't impart any information to the reader. Renaming the m and e variables would also really help the next person to look at this code.

@jakedipity jakedipity force-pushed the jakedipity/LOG-13116 branch 4 times, most recently from 1b28fa9 to 3a399a0 Compare January 12, 2023 17:32
@jakedipity jakedipity force-pushed the jakedipity/LOG-13116 branch from 3a399a0 to dd9048b Compare January 17, 2023 18:49
@jakedipity jakedipity requested review from jsumners and removed request for jsumners February 14, 2023 21:26
@jsumners
Copy link
Contributor

@jakedipity Mezmo laid me off on January 19. Please request a review from someone else.

@gjanco
Copy link
Contributor

gjanco commented Feb 14, 2023

@jakedipity , you could add @seeruyy

@jakedipity
Copy link
Contributor Author

Yeah sorry, that was a misclick on my part.

This begins support for terraform management of enterprise and child
organizations:
* Allows the provider to accept an enterprise key to indicate an
  enterprise organization.
* Enterprise organizations can attach and detach child organizations.

Ref: LOG-13116
Signed-off-by: Jacob Hull <[email protected]>
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