-
Notifications
You must be signed in to change notification settings - Fork 15
Provider 0.7.0 release #305
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
Conversation
gen/templates/data_source.go
Outdated
| Computed: true, | ||
| {{- end}} | ||
| {{- if or (eq .Type "List") (eq .Type "Set")}} | ||
| {{- if or .Id .Reference}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we fix/restore the indentation here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
gen/templates/data_source.go
Outdated
| {{- end}} | ||
| Computed: true, | ||
| {{- if or (eq .Type "List") (eq .Type "Set")}} | ||
| {{- else if or (eq .Type "Int64List") (eq .Type "Int64Set")}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
gen/templates/data_source.go
Outdated
| MarkdownDescription: "{{.Description}}", | ||
| {{- if or (eq .Type "StringList") (eq .Type "StringSet")}} | ||
| ElementType: types.StringType, | ||
| {{- else if or (eq .Type "Int64List") (eq .Type "Int64Set")}} | ||
| ElementType: types.Int64Type, | ||
| {{- else if or (eq .Type "Int64List") (eq .Type "Int64Set")}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
gen/templates/model.go
Outdated
| @@ -76,6 +76,7 @@ type {{camelCase .Name}}Data struct { | |||
| {{- if or (eq .Type "List") (eq .Type "Set")}} | |||
| type {{$name}}{{toGoName .TfName}} struct { | |||
| {{- range .Attributes}} | |||
| {{- if and .TfName .Type}} | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why specifically are we adding this check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed. It was used when testing very nested lists.
gen/templates/resource.go
Outdated
| Validators: []validator.String{ | ||
| stringvalidator.OneOf("all", "attributes"), | ||
| }, | ||
| {{- if and (not .NoDelete) (not .NoDeleteAttributes)}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
gen/templates/resource.go
Outdated
| {{- end}} | ||
| {{- if len .EnumValues}} | ||
| Validators: []validator.String{ | ||
| {{- else}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
gen/templates/resource.go
Outdated
| @@ -251,6 +260,130 @@ func (r *{{camelCase .Name}}Resource) Schema(ctx context.Context, req resource.S | |||
| {{- else if and (len .DefaultValue) (eq .Type "String")}} | |||
| Default: stringdefault.StaticString("{{.DefaultValue}}"), | |||
| {{- end}} | |||
| {{- if or (eq .Type "List") (eq .Type "Set")}} | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
gen/templates/resource_test.go
Outdated
| @@ -259,7 +345,7 @@ func testAccIosxr{{camelCase .Name}}Config_minimum() string { | |||
|
|
|||
| func testAccIosxr{{camelCase .Name}}Config_all() string { | |||
| config := `resource "iosxr_{{snakeCase $name}}" "test" {` + "\n" | |||
| {{- if and (not .NoDelete) (not .NoDeleteAttributes) .DefaultDeleteAttributes}} | |||
| {{- if and (not .NoDelete) (not .NoDeleteAttributes) (not .DefaultDeleteAttributes)}} | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we changing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was to have acceptance tests always test the mode that we set as default for the resource. But if you prefer to always have datasource tests use attributes and resource tests to use all, then I will revert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted the change for now.
Overview
Provider version 0.7.0.
🎯 Highlights
Definitions
➕ Added
terraform-provider-iosxr/CHANGELOG.md🔄 Modified
iosxr_segment_routing_teon-demand-colors intoiosxr_segment_routing_te_on_demand_colorresource and data sourceiosxr_mpls_ldpintoiosxr_mpls_ldp,iosxr_mpls_ldp_address_family,iosxr_mpls_ldp_interface,iosxr_mpls_ldp_mldp,iosxr_mpls_ldp_vrfresource and data source➖ Removed
iosxr_logging_source_interfaceintoiosxr_loggingresource and data sourceiosxr_evpn_groupintoiosxr_evpnresource and data sourceiosxr_segment_routing_te_policy_candidate_pathintoiosxr_segment_routing_te_policyresource and data sourceiosxr_snmp_server_viewintoiosxr_snmp_serverresource and data sourceiosxr_l2vpn_xconnect_group_p2pintoiosxr_l2vpn_xconnect_groupresource and data sourceiosxr_l2vpn_bridge_groupintoiosxr_l2vpn_bridge_group_bridge_domainresource and data sourceTesting Environment
🧪 Test Results
All tests pass for relevant attributes per-platform.
Additional Changes (schema/generator/templates)
sensitiveattribute to schemainclude_exampleto schema to support examples with test_tagsfast_reroute_per_prefix_tiebreaker_srlg_disjointtofast_reroute_per_prefix_tiebreaker_srlg_disjoint_indexiniosxr_router_ospf_area_interfaceresource and data sourcefast_reroute_per_prefix_tiebreaker_node_protectingtofast_reroute_per_prefix_tiebreaker_node_protecting_indexiniosxr_router_ospf_area_interfaceresource and data sourcefast_reroute_per_prefix_ti_lfatofast_reroute_per_prefix_ti_lfa_enableiniosxr_router_ospf_area_interfaceresource and data sourcedampening_decay_half_life_valuetodampening_decay_half_lifeiniosxr_interfaceresource and data sourcelocal_as_replace_astolocal_as_no_prepend_replace_asiniosxr_router_bgp_neighbor_groupresource and data sourcelocal_as_dual_astolocal_as_no_prepend_replace_as_dual_asiniosxr_router_bgp_neighbor_groupresource and data sourcebuffered_logging_buffer_sizetobuffered_sizeiniosxr_loggingresource and data sourceencapsulation_mpls_load_balancing_flow_label_code_one7toencapsulation_mpls_load_balancing_flow_label_code_17iniosxr_l2vpn_pw_classresource and data sourceencapsulation_mpls_load_balancing_flow_label_code_one7_disabletoencapsulation_mpls_load_balancing_flow_label_code_17_disableiniosxr_l2vpn_pw_classresource and data sourceencapsulation_mpls_transport_mode_passthroughtoencapsulation_mpls_transport_mode_vlan_passthroughiniosxr_l2vpn_pw_classresource and data sourcebgp_rdattributes for consistency with other definitions iniosxr_evpn_eviresource and data sourcepcc_source_addresstopcc_source_address_ipv4iniosxr_segment_routing_teresource and data sourcepce_peerstopce_peers_ipv4iniosxr_segment_routing_teresource and data sourceunencrypted_stringstotraps_unencrypted_stringsiniosxr_snmp_server_vrf_hostresource and data sourcehello_keychain_send_onlytokeychain_send_onlyiniosxr_router_isis_interfaceresource and data sourcehello_keychain_nametokeychain_nameiniosxr_router_isis_interfaceresource and data sourcehello_password_hmac_md5_send_onlytohmac_md5_send_onlyiniosxr_router_isis_interfaceresource and data sourcehello_password_hmac_md5_encryptedtohmac_md5_encryptediniosxr_router_isis_interfaceresource and data sourcehello_password_text_send_onlytotext_send_onlyiniosxr_router_isis_interfaceresource and data sourcehello_password_text_encryptedtotext_encryptediniosxr_router_isis_interfaceresource and data sourcerpl-tag-settorpliniosxr_tag_setresource and data sourcelsp_password_levelstolsp_password_accept_levelsiniosxr_router_isisresource and data source🔗 Related Issues
Checklist: