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

[Draft] Add plugin framework conflics_with and at_least_one_of to instance #181

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

Conversation

Iduoad
Copy link

@Iduoad Iduoad commented Dec 5, 2024

I added declarative validator built-in the provider framework instead of imperatively checking in Validate function.

@Iduoad
Copy link
Author

Iduoad commented Dec 5, 2024

Closes #180

Copy link
Collaborator

@breml breml left a comment

Choose a reason for hiding this comment

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

If we would conclude to move ahead with this PR, please also remove the function atMostOneOf, since it is no longer used anywhere.

@@ -116,6 +117,21 @@ func (r InstanceResource) Schema(_ context.Context, _ resource.SchemaRequest, re
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
},
Validators: []validator.String{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please check the formatting with gofmt. In Go indentation is done with tab (and not spaces).

path.MatchRoot("source_file"),
}...
),
stringvalidator.AtLeastOneOf(
Copy link
Collaborator

Choose a reason for hiding this comment

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

The current implementation enforces atMostOneOf, which is not the same as AtLeastOneOf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants