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

Bump SDK version, absorb breaking changes from name change in enum package #862

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions apstra/blueprint/blueprint.go
Original file line number Diff line number Diff line change
Expand Up @@ -845,9 +845,9 @@ func (o *Blueprint) FabricSettings(ctx context.Context, diags *diag.Diagnostics)
}

if utils.HasValue(o.EvpnType5Routes) {
result.EvpnGenerateType5HostRoutes = &enum.FeatureSwitchEnumDisabled
result.EvpnGenerateType5HostRoutes = &enum.FeatureSwitchDisabled
if o.EvpnType5Routes.ValueBool() {
result.EvpnGenerateType5HostRoutes = &enum.FeatureSwitchEnumEnabled
result.EvpnGenerateType5HostRoutes = &enum.FeatureSwitchEnabled
}
}

Expand All @@ -864,30 +864,30 @@ func (o *Blueprint) FabricSettings(ctx context.Context, diags *diag.Diagnostics)
}

if utils.HasValue(o.JunosEvpnMaxNexthopAndInterfaceNumber) {
result.JunosEvpnMaxNexthopAndInterfaceNumber = &enum.FeatureSwitchEnumDisabled
result.JunosEvpnMaxNexthopAndInterfaceNumber = &enum.FeatureSwitchDisabled
if o.JunosEvpnMaxNexthopAndInterfaceNumber.ValueBool() {
result.JunosEvpnMaxNexthopAndInterfaceNumber = &enum.FeatureSwitchEnumEnabled
result.JunosEvpnMaxNexthopAndInterfaceNumber = &enum.FeatureSwitchEnabled
}
}

if utils.HasValue(o.JunosEvpnRoutingInstanceModeMacVrf) {
result.JunosEvpnRoutingInstanceVlanAware = &enum.FeatureSwitchEnumDisabled
result.JunosEvpnRoutingInstanceVlanAware = &enum.FeatureSwitchDisabled
if o.JunosEvpnRoutingInstanceModeMacVrf.ValueBool() {
result.JunosEvpnRoutingInstanceVlanAware = &enum.FeatureSwitchEnumEnabled
result.JunosEvpnRoutingInstanceVlanAware = &enum.FeatureSwitchEnabled
}
}

if utils.HasValue(o.JunosExOverlayEcmp) {
result.JunosExOverlayEcmp = &enum.FeatureSwitchEnumDisabled
result.JunosExOverlayEcmp = &enum.FeatureSwitchDisabled
if o.JunosExOverlayEcmp.ValueBool() {
result.JunosExOverlayEcmp = &enum.FeatureSwitchEnumEnabled
result.JunosExOverlayEcmp = &enum.FeatureSwitchEnabled
}
}

if utils.HasValue(o.JunosGracefulRestart) {
result.JunosGracefulRestart = &enum.FeatureSwitchEnumDisabled
result.JunosGracefulRestart = &enum.FeatureSwitchDisabled
if o.JunosGracefulRestart.ValueBool() {
result.JunosGracefulRestart = &enum.FeatureSwitchEnumEnabled
result.JunosGracefulRestart = &enum.FeatureSwitchEnabled
}
}

Expand All @@ -908,9 +908,9 @@ func (o *Blueprint) FabricSettings(ctx context.Context, diags *diag.Diagnostics)
}

if utils.HasValue(o.OptimizeRoutingZoneFootprint) {
result.OptimiseSzFootprint = &enum.FeatureSwitchEnumDisabled
result.OptimiseSzFootprint = &enum.FeatureSwitchDisabled
if o.OptimizeRoutingZoneFootprint.ValueBool() {
result.OptimiseSzFootprint = &enum.FeatureSwitchEnumEnabled
result.OptimiseSzFootprint = &enum.FeatureSwitchEnabled
}
}

Expand Down Expand Up @@ -961,10 +961,10 @@ func boolAttrValueFromBoolPtr(b *bool) types.Bool {
return types.BoolValue(*b)
}

func boolAttrValueFromFeatureswitchEnumPtr(fs *enum.FeatureSwitchEnum) types.Bool {
func boolAttrValueFromFeatureswitchEnumPtr(fs *enum.FeatureSwitch) types.Bool {
if fs == nil {
return types.BoolNull()
}

return types.BoolValue(fs.Value == enum.FeatureSwitchEnumEnabled.Value)
return types.BoolValue(fs.Value == enum.FeatureSwitchEnabled.Value)
}
2 changes: 1 addition & 1 deletion apstra/data_source_datacenter_blueprint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestDatasourceDatacenterBlueprint(t *testing.T) {
},
// DefaultSviL3Mtu: nil,
EsiMacMsb: utils.ToPtr(uint8(4)),
EvpnGenerateType5HostRoutes: &enum.FeatureSwitchEnumEnabled,
EvpnGenerateType5HostRoutes: &enum.FeatureSwitchEnabled,
ExternalRouterMtu: utils.ToPtr(uint16(9002)),
// FabricL3Mtu: nil,
Ipv6Enabled: utils.ToPtr(true),
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ go 1.22.5

require (
github.com/IBM/netaddr v1.5.0
github.com/Juniper/apstra-go-sdk v0.0.0-20240913170103-3840c5e77a4a
github.com/Juniper/apstra-go-sdk v0.0.0-20240918143008-25a5d4a34fbe
github.com/chrismarget-j/go-licenses v0.0.0-20240224210557-f22f3e06d3d4
github.com/google/go-cmp v0.6.0
github.com/hashicorp/go-version v1.7.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/IBM/netaddr v1.5.0 h1:IJlFZe1+nFs09TeMB/HOP4+xBnX2iM/xgiDOgZgTJq0=
github.com/IBM/netaddr v1.5.0/go.mod h1:DDBPeYgbFzoXHjSz9Jwk7K8wmWV4+a/Kv0LqRnb8we4=
github.com/Juniper/apstra-go-sdk v0.0.0-20240913170103-3840c5e77a4a h1:oyQStXZ9gUnqyZIW+bcGlwIAnuC/lVtVTYQnD9I4RaI=
github.com/Juniper/apstra-go-sdk v0.0.0-20240913170103-3840c5e77a4a/go.mod h1:qXNVTdnVa40aMTOsBTnKoFNYT5ftga2NAkGJhx4o6bY=
github.com/Juniper/apstra-go-sdk v0.0.0-20240918143008-25a5d4a34fbe h1:n1zsTKXDjjyMvEtWm19L7xfXVFl3W7e/p/LJrt6AAlQ=
github.com/Juniper/apstra-go-sdk v0.0.0-20240918143008-25a5d4a34fbe/go.mod h1:qXNVTdnVa40aMTOsBTnKoFNYT5ftga2NAkGJhx4o6bY=
github.com/Kunde21/markdownfmt/v3 v3.1.0 h1:KiZu9LKs+wFFBQKhrZJrFZwtLnCCWJahL+S+E/3VnM0=
github.com/Kunde21/markdownfmt/v3 v3.1.0/go.mod h1:tPXN1RTyOzJwhfHoon9wUr4HGYmWgVxSQN6VBJDkrVc=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
Expand Down
Loading