From 3f72597adb065b57bebdc438359469db40064e89 Mon Sep 17 00:00:00 2001 From: Chris Marget Date: Fri, 4 Oct 2024 10:16:15 -0400 Subject: [PATCH 1/2] add apstra 5.0.0 to list of supported versions --- apstra/compatibility/api_versions.go | 16 ++++++++++------ apstra/compatibility/api_versions_test.go | 15 +++++++++++---- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/apstra/compatibility/api_versions.go b/apstra/compatibility/api_versions.go index 230caf6c..cf8141c6 100644 --- a/apstra/compatibility/api_versions.go +++ b/apstra/compatibility/api_versions.go @@ -16,20 +16,24 @@ func SupportedApiVersions() []string { apiversions.Apstra421, apiversions.Apstra4211, apiversions.Apstra422, + apiversions.Apstra500, } sdkVersions := compatibility.SupportedApiVersions() - return utils.SliceIntersectionOfAB(providerVersions, sdkVersions) + bothVersions := utils.SliceIntersectionOfAB(providerVersions, sdkVersions) + + sort.Slice(bothVersions, func(i, j int) bool { + iv := version.Must(version.NewVersion(bothVersions[i])) + jv := version.Must(version.NewVersion(bothVersions[j])) + return iv.LessThan(jv) + }) + + return bothVersions } func SupportedApiVersionsPretty() string { supportedVers := SupportedApiVersions() - sort.Slice(supportedVers, func(i, j int) bool { - iv := version.Must(version.NewVersion(supportedVers[i])) - jv := version.Must(version.NewVersion(supportedVers[j])) - return iv.LessThan(jv) - }) stop := len(supportedVers) - 1 for i := range supportedVers { diff --git a/apstra/compatibility/api_versions_test.go b/apstra/compatibility/api_versions_test.go index 4d8d3ae5..8224e3e6 100644 --- a/apstra/compatibility/api_versions_test.go +++ b/apstra/compatibility/api_versions_test.go @@ -8,10 +8,11 @@ import ( func TestSupportedApiVersions(t *testing.T) { expected := []string{ - apiversions.Apstra410, - apiversions.Apstra411, - apiversions.Apstra412, apiversions.Apstra420, + apiversions.Apstra421, + apiversions.Apstra4211, + apiversions.Apstra422, + apiversions.Apstra500, } result := SupportedApiVersions() @@ -22,7 +23,13 @@ func TestSupportedApiVersions(t *testing.T) { } func TestSupportedApiVersionsPretty(t *testing.T) { - expected := apiversions.Apstra410 + ", " + apiversions.Apstra411 + ", " + apiversions.Apstra412 + ", " + apiversions.Apstra420 + ", " + apiversions.Apstra421 + ", " + apiversions.Apstra4211 + ", and " + apiversions.Apstra422 + expected := + apiversions.Apstra420 + ", " + + apiversions.Apstra421 + ", " + + apiversions.Apstra4211 + ", " + + apiversions.Apstra422 + ", and " + + apiversions.Apstra500 + result := SupportedApiVersionsPretty() if expected != result { t.Fatalf("expected %q; got %q", expected, result) From 99d7fc4730f5dbd54e6dd18d51342042bca3276c Mon Sep 17 00:00:00 2001 From: Chris Marget Date: Fri, 4 Oct 2024 10:17:02 -0400 Subject: [PATCH 2/2] make docs --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 0b0f6d2c..2ba84e3c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,7 +12,7 @@ It covers day 0 and day 1 operations (design and deployment), and a growing list Use the navigation tree to the left to read about the available resources and data sources. -This release has been tested with Apstra versions 4.2.0, 4.2.1, 4.2.1.1, and 4.2.2. +This release has been tested with Apstra versions 4.2.0, 4.2.1, 4.2.1.1, 4.2.2, and 5.0.0. Some example projects which make use of this provider can be found [here](https://github.com/Juniper/terraform-apstra-examples).