Skip to content

Commit bda2305

Browse files
remvoe redundant pf writeonly interface
1 parent 4abc06e commit bda2305

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

pkg/pf/internal/pfutils/attr.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,13 @@ type AttrLike interface {
4545
IsOptional() bool
4646
IsRequired() bool
4747
IsSensitive() bool
48+
IsWriteOnly() bool
4849
GetDeprecationMessage() string
4950
GetDescription() string
5051
GetMarkdownDescription() string
5152
GetType() attr.Type
5253
}
5354

54-
type AttrLikeWithWriteOnly interface {
55-
AttrLike
56-
IsWriteOnly() bool
57-
}
58-
5955
func FromProviderAttribute(x pschema.Attribute) Attr {
6056
return FromAttrLike(x)
6157
}

pkg/pf/internal/schemashim/attr_schema.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,7 @@ func (s *attrSchema) Sensitive() bool {
142142
}
143143

144144
func (s *attrSchema) WriteOnly() bool {
145-
schema, ok := s.attr.(pfutils.AttrLikeWithWriteOnly)
146-
if ok {
147-
return schema.IsWriteOnly()
148-
}
149-
return false
145+
return s.attr.IsWriteOnly()
150146
}
151147

152148
func (*attrSchema) SetElement(config interface{}) (interface{}, error) {

pkg/pf/internal/schemashim/object_pseudoresource.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ func (tupElementAttr) IsOptional() bool { return false }
180180
func (tupElementAttr) IsRequired() bool { return true }
181181
func (tupElementAttr) IsSensitive() bool { return false }
182182
func (tupElementAttr) IsComputed() bool { return false }
183+
func (tupElementAttr) IsWriteOnly() bool { return false }
183184

184185
func (t tupElementAttr) GetType() attr.Type { return t.e }
185186

0 commit comments

Comments
 (0)