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

MinItems and MaxItems of Block are not set and causing diff error when to initialize mux server #594

Closed
k-yomo opened this issue Dec 18, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@k-yomo
Copy link
Contributor

k-yomo commented Dec 18, 2022

Module version

v1.0.0

Relevant provider source code

// Block returns the *tfprotov5.SchemaNestedBlock equivalent of a Block.
// Errors will be tftypes.AttributePathErrors based on `path`. `name` is the
// name of the attribute.
func Block(ctx context.Context, name string, path *tftypes.AttributePath, b fwschema.Block) (*tfprotov5.SchemaNestedBlock, error) {

Expected Behavior

MinItems and MaxItems are set

Actual Behavior

MinItems and MaxItems are not set and it causes below diff error between sdk v2 provider and framework provider.

2022/12/18 13:52:14 initialize mux server: got a different provider schema across servers. Provider schemas must be identical across providers. Diff:   &tfprotov5.Schema{
  	Version: 0,
  	Block: &tfprotov5.SchemaBlock{
  		Version:    0,
  		Attributes: nil,
  		BlockTypes: []*tfprotov5.SchemaNestedBlock{
  			&{
  				... // 2 identical fields
  				Nesting:  s"LIST",
  				MinItems: 0,
- 				MaxItems: 0,
+ 				MaxItems: 1,
  			},
  		},
  		Description:     "",
  		DescriptionKind: s"PLAIN",
  		Deprecated:      false,
  	},
  }

https://github.com/elastic/terraform-provider-elasticstack/actions/runs/3725132416/jobs/6317745179

Steps to Reproduce

	servers := []func() tfprotov5.ProviderServer{
		sdkv2Provider.GRPCProvider,
		fwProvider,
	}

	muxServer, err := tf5muxserver.NewMuxServer(ctx, servers...)
	if err != nil {
		return nil, fmt.Errorf("initialize mux server: %w", err)
	}

References

@k-yomo k-yomo added the bug Something isn't working label Dec 18, 2022
@k-yomo
Copy link
Contributor Author

k-yomo commented Dec 18, 2022

Close since it seems mux side issue
hashicorp/terraform-plugin-mux#117 (comment)

@k-yomo k-yomo closed this as completed Dec 18, 2022
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant