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

Add import support to consul_config_entry #319

Merged
merged 5 commits into from
Dec 13, 2022

Conversation

remilapeyre
Copy link
Collaborator

Related to #316

Copy link
Contributor

@dhiaayachi dhiaayachi left a comment

Choose a reason for hiding this comment

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

👋 @remilapeyre
I had few questions about that one, specifically around partition and namespace handling.

return nil, fmt.Errorf(`expected path of the form "<kind>/<name>" or "<kind>/<name>/<partition>/<namespace>"`)
}

d.SetId(fmt.Sprintf("%s-%s", kind, name))
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't partition and namespace be added to the ID to ensure uniqueness?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The ID does not need to be unique. For config entries there is no ID that exist so we can use any placeholder there. We have other resources that not have a unique ID either, there is some examples at: #318 (comment)

Comment on lines 287 to 290
`consul_config_entry` can be imported using the syntax `<kind>/<name>` if the
config entry is in the default partition and default namespace, or
`<kind>/<name>/<partition>/<namespace>` for config entries in a non-default
partition or namespace:
Copy link
Contributor

Choose a reason for hiding this comment

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

What about providing foo/bar/default/default is it equivalent to foo/bar?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes it Is equivalent. Looking at it now it seems to me like <partition>/<namespace>/<kind>/<name> might make more sense here.

Copy link
Contributor

@dhiaayachi dhiaayachi Dec 13, 2022

Choose a reason for hiding this comment

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

I agree, that would be more inline with consul annotations around namespace and partition. Can we change it to reflect this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

@remilapeyre remilapeyre merged commit cbb7ef5 into hashicorp:master Dec 13, 2022
@remilapeyre remilapeyre deleted the remilapeyre/issue316 branch December 13, 2022 13:43
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.

None yet

2 participants