Skip to content

Commit 31bc693

Browse files
ulucinarsergenyalcin
authored andcommitted
Unknown options are no longer skipped and result in an error while struct tag parsing
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com> Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
1 parent 67b7989 commit 31bc693

8 files changed

Lines changed: 34 additions & 694 deletions

File tree

pkg/config/resource.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
xpresource "github.com/crossplane/crossplane-runtime/pkg/resource"
1717
fwresource "github.com/hashicorp/terraform-plugin-framework/resource"
1818
rschema "github.com/hashicorp/terraform-plugin-framework/resource/schema"
19-
"github.com/hashicorp/terraform-plugin-go/tfprotov6"
2019
"github.com/hashicorp/terraform-plugin-go/tftypes"
2120
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
2221
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
@@ -686,6 +685,13 @@ func (m SchemaElementOptions) SetAddToObservation(el string) {
686685
m[el].AddToObservation = true
687686
}
688687

688+
// AddToObservation returns true if the schema element at the specified path
689+
// should be added to the CRD type's Observation type.
690+
// Deprecated: Use SchemaElementOptions.AddToObservation instead.
691+
func (m SchemaElementOptions) AddToObservation(el string) bool {
692+
return m[el] != nil && m[el].AddToObservation
693+
}
694+
689695
// TFListConversionPaths returns the Resource's runtime Terraform list
690696
// conversion paths in fieldpath syntax.
691697
func (r *Resource) TFListConversionPaths() []string {

0 commit comments

Comments
 (0)