From 398ae39c6969d3d1ae0054fcb21bd4b9cbabae54 Mon Sep 17 00:00:00 2001 From: Devarajan P Ramaswamy Date: Mon, 15 Feb 2021 10:43:17 +0530 Subject: [PATCH] added upstream istio flavor (#8) --- README.md | 1 + api/manifest.proto | 2 +- api/manifest_util.go | 13 +++-- api/manifest_util_test.go | 57 +++++++++++++++++-- cmd/check_upgrade.go | 2 +- cmd/fetch.go | 5 +- cmd/list.go | 11 ++-- cmd/prune.go | 2 +- cmd/switch.go | 2 +- .../getistio_check-upgrade/_index.md | 2 +- .../reference/getistio_fetch/_index.md | 5 +- .../reference/getistio_list/_index.md | 11 ++-- .../reference/getistio_prune/_index.md | 2 +- .../reference/getistio_switch/_index.md | 2 +- e2e/e2e_test.go | 1 + manifest.json | 14 +++++ src/checkupgrade/check_upgrade.go | 6 +- src/checkupgrade/check_upgrade_test.go | 12 ++-- src/manifest/checker_endoflife_test.go | 3 +- src/manifest/checker_security_patch_test.go | 4 ++ src/manifest/manifest_test.go | 13 +++++ 21 files changed, 132 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index ea949d7..a8f3258 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Considering that some of Service-Mesh customers needs to support elevated securi - _tetrate_ tracks the upstream Istio and may have additional patches applied - _tetratefips_ a FIPS compliant version of tetrate flavor +- _istio_ is upstream built Istio The above functionality is achieved via elegant transparent approach, where the existing setup and tools are fully leveraged to provide additional functionality and enterprise desired feature sets and controls: diff --git a/api/manifest.proto b/api/manifest.proto index 4662d24..c004f62 100644 --- a/api/manifest.proto +++ b/api/manifest.proto @@ -30,7 +30,7 @@ message Manifest { message IstioDistribution { // Distributions are tagged with `x.y.z-${flavor}-v${flavor_version}` where - // - ${flavor} is either "tetrate" or "tetratefips" + // - ${flavor} is either "tetrate" or "tetratefips" or istio // - ${flavor_version} is ""numeric"" and the version of that distribution string version = 1; string flavor = 2; // note that intentionally use string instead of enum here diff --git a/api/manifest_util.go b/api/manifest_util.go index e2cc64c..18654a3 100644 --- a/api/manifest_util.go +++ b/api/manifest_util.go @@ -10,6 +10,7 @@ import ( const ( IstioDistributionFlavorTetrate = "tetrate" IstioDistributionFlavorTetrateFIPS = "tetratefips" + IstioDistributionFlavorIstio = "istio" ) func (x *Manifest) GetEOLDates() (map[string]time.Time, error) { @@ -70,7 +71,9 @@ func (x *IstioDistribution) Group() (string, error) { return fmt.Sprintf("%s.%s-%s", ts[0], ts[1], x.Flavor), nil } -func (x *IstioDistribution) IsOfficial() bool { +func (x *IstioDistribution) IsUpstream() bool { + // manifest.json denotes upstream by flavor 'istio'. Whereas the actual upstream images + // in the cluster is of the form 'x.y.z' with no flavor set return x.Flavor == "" } @@ -108,8 +111,8 @@ func (x *IstioDistribution) GreaterThan(y *IstioDistribution) (bool, error) { func IstioDistributionFromString(in string) (*IstioDistribution, error) { if !strings.Contains(in, "-") { - // handle the official version schema: 'x.y.z' - if err := verifyOfficialVersionString(in); err != nil { + // handle the upstream version schema: 'x.y.z' + if err := verifyUpstreamVersionString(in); err != nil { return nil, err } @@ -121,7 +124,7 @@ func IstioDistributionFromString(in string) (*IstioDistribution, error) { return nil, fmt.Errorf("invalid version schema: %s", in) } - if err := verifyOfficialVersionString(parts[0]); err != nil { + if err := verifyUpstreamVersionString(parts[0]); err != nil { return nil, err } @@ -143,7 +146,7 @@ func parseFlavor(in string) (string, int64, error) { return flavor, flavorVersion, nil } -func verifyOfficialVersionString(in string) error { +func verifyUpstreamVersionString(in string) error { ts := strings.Split(in, ".") if len(ts) != 3 { return fmt.Errorf("invalid vesion: cannot parse %s in the form of 'x.y.z'", in) diff --git a/api/manifest_util_test.go b/api/manifest_util_test.go index 5dc15b6..0eb17f9 100644 --- a/api/manifest_util_test.go +++ b/api/manifest_util_test.go @@ -75,6 +75,14 @@ func TestIstioDistribution_ToString(t *testing.T) { }, exp: "1.7.7-tetratefips-v15", }, + { + in: &IstioDistribution{ + Version: "1.8.3", + Flavor: IstioDistributionFlavorIstio, + FlavorVersion: 0, + }, + exp: "1.8.3-istio-v0", + }, } { assert.Equal(t, c.exp, c.in.ToString()) } @@ -107,6 +115,14 @@ func TestIstioDistributionEqual(t *testing.T) { }, exp: true, }, + { + in: &IstioDistribution{ + Version: "1.8.3", + Flavor: IstioDistributionFlavorIstio, + FlavorVersion: 0, + }, + exp: false, + }, } { assert.Equal(t, c.exp, c.in.Equal(operand)) } @@ -153,6 +169,7 @@ func TestIstioDistribution_Group(t *testing.T) { }{ {exp: "1.3-tetrate", in: &IstioDistribution{Version: "1.3.1", Flavor: "tetrate"}}, {exp: "1.7-tetratefips", in: &IstioDistribution{Version: "1.7.6", Flavor: "tetratefips"}}, + {exp: "1.8-istio", in: &IstioDistribution{Version: "1.8.3", Flavor: "istio"}}, } { actual, err := c.in.Group() require.NoError(t, err) @@ -160,10 +177,10 @@ func TestIstioDistribution_Group(t *testing.T) { } } -func TestIstioDistribution_IsOfficial(t *testing.T) { - assert.True(t, (&IstioDistribution{Flavor: ""}).IsOfficial()) - assert.False(t, (&IstioDistribution{Flavor: "tetrate"}).IsOfficial()) - assert.False(t, (&IstioDistribution{Flavor: "tetratefips"}).IsOfficial()) +func TestIstioDistribution_IsUpstream(t *testing.T) { + assert.True(t, (&IstioDistribution{Flavor: "istio"}).IsUpstream()) + assert.False(t, (&IstioDistribution{Flavor: "tetrate"}).IsUpstream()) + assert.False(t, (&IstioDistribution{Flavor: "tetratefips"}).IsUpstream()) } func TestIstioDistribution_GreaterThan(t *testing.T) { @@ -204,6 +221,7 @@ func TestIstioDistribution_Equal(t *testing.T) { {Version: "1.2.300", Flavor: "tetrate", FlavorVersion: 4}, {Version: "1.2.3", Flavor: "tetratefips", FlavorVersion: 4}, {Version: "1.2.3", Flavor: "tetrate", FlavorVersion: 1}, + {Version: "1.2.3", Flavor: "istio", FlavorVersion: 4}, } { require.False(t, base.Equal(c), fmt.Sprintf("%d-th", i)) } @@ -220,6 +238,8 @@ func TestIstioDistributionFromString(t *testing.T) { exp: &IstioDistribution{Version: "1.7.3", Flavor: "tetrate", FlavorVersion: 0}}, {in: "1.1000.3-tetratefips-v1", exp: &IstioDistribution{Version: "1.1000.3", Flavor: "tetratefips", FlavorVersion: 1}}, + {in: "1.8.3-istio-v0", + exp: &IstioDistribution{Version: "1.8.3", Flavor: "istio", FlavorVersion: 0}}, {in: "1.7.30-tetratefips-v100", exp: &IstioDistribution{Version: "1.7.30", Flavor: "tetratefips", FlavorVersion: 100}}, {in: "2001.7.3-tetrate-v0", @@ -253,6 +273,7 @@ func Test_parseFlavor(t *testing.T) { }{ {in: "tetrate-v0", flavor: "tetrate", flavorVersion: 0}, {in: "tetratefips-v100", flavor: "tetratefips", flavorVersion: 100}, + {in: "istio-v0", flavor: "istio", flavorVersion: 0}, } { flavor, flavorVersion, err := parseFlavor(c.in) require.NoError(t, err) @@ -285,6 +306,13 @@ func TestGetLatestDistribution(t *testing.T) { name: "ok", maniest: &Manifest{ IstioDistributions: []*IstioDistribution{ + { + Version: "1.8.3", + Flavor: IstioDistributionFlavorIstio, + FlavorVersion: 0, + K8SVersions: []string{"1.17"}, + IsSecurityPatch: false, + }, { Version: "1.8.2", Flavor: IstioDistributionFlavorTetrateFIPS, @@ -349,6 +377,13 @@ func TestGetLatestDistribution(t *testing.T) { K8SVersions: []string{"1.16"}, IsSecurityPatch: false, }, + { + Version: "1.8.3", + Flavor: IstioDistributionFlavorIstio, + FlavorVersion: 0, + K8SVersions: []string{"1.16"}, + IsSecurityPatch: false, + }, }, }, current: &IstioDistribution{ @@ -392,6 +427,13 @@ func TestGetLatestDistribution(t *testing.T) { K8SVersions: []string{"1.16"}, IsSecurityPatch: false, }, + { + Version: "1.8.3", + Flavor: IstioDistributionFlavorIstio, + FlavorVersion: 0, + K8SVersions: []string{"1.18"}, + IsSecurityPatch: false, + }, }, }, current: &IstioDistribution{ @@ -435,6 +477,13 @@ func TestGetLatestDistribution(t *testing.T) { K8SVersions: []string{"1.16"}, IsSecurityPatch: true, }, + { + Version: "1.8.4", + Flavor: IstioDistributionFlavorIstio, + FlavorVersion: 0, + K8SVersions: []string{"1.17"}, + IsSecurityPatch: true, + }, }, }, current: &IstioDistribution{ diff --git a/cmd/check_upgrade.go b/cmd/check_upgrade.go index eeca714..e6f4fe7 100644 --- a/cmd/check_upgrade.go +++ b/cmd/check_upgrade.go @@ -47,7 +47,7 @@ $ getistio check-upgrade - There is the available patch for the minor version 1.7-tetrate. We recommend upgrading all 1.7-tetrate versions -> 1.7.4-tetrate-v1 - There is the available patch for the minor version 1.8-tetrate which includes **security upgrades**. We strongly recommend upgrading all 1.8-tetrate versions -> 1.8.1-tetrate-v1 -In the above example, we call names in the form of x.y-${flavor} "minor version", where x.y is Istio's official minor and ${flavor} is the flavor of the distribution. +In the above example, we call names in the form of x.y-${flavor} "minor version", where x.y is Istio's upstream minor and ${flavor} is the flavor of the distribution. Please refer to 'getistio fetch --help' or 'getistio list --help' for more information.`, PreRunE: func(cmd *cobra.Command, args []string) error { if getistio.GetActiveConfig().IstioDistribution == nil { diff --git a/cmd/fetch.go b/cmd/fetch.go index 1c82379..291fa22 100644 --- a/cmd/fetch.go +++ b/cmd/fetch.go @@ -53,6 +53,9 @@ $ getistio fetch --version 1.7.4 --flavor tetratefips # Fetch the latest "tetrate flavored" istioctl of version=1.7.4 $ getistio fetch --version 1.7.4 +# Fetch the istioctl of version=1.8.3 flavor=istio flavor-version=0 +$ getistio fetch --version 1.8.3 --flavor istio + # Fetch the latest "tetrate flavored" istioctl @@ -95,7 +98,7 @@ For more information, please refer to "getistio list --help" command. flags := cmd.Flags() flags.SortFlags = false flags.StringVarP(&flagVersion, "version", "", "", "Version of istioctl e.g. \"--version 1.7.4\"") - flags.StringVarP(&flagFlavor, "flavor", "", "", "Flavor of istioctl, e.g. \"--flavor tetrate\" or --flavor tetratefips\"") + flags.StringVarP(&flagFlavor, "flavor", "", "", "Flavor of istioctl, e.g. \"--flavor tetrate\" or --flavor tetratefips\" or --flavor istio\"") flags.IntVarP(&flagFlavorVersion, "flavor-version", "", -1, "Version of the flavor, e.g. \"--version 1\"") return cmd } diff --git a/cmd/list.go b/cmd/list.go index 683873c..3ddfe53 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -42,18 +42,19 @@ ISTIO VERSION FLAVOR FLAVOR VERSION K8S VERSIONS The following is the explanation of each column: [ISTIO VERSION] -The official tagged version of Istio on which the distribution is built. +The upstream tagged version of Istio on which the distribution is built. [FLAVOR] -The kind of the distribution. As of now, there's one flavor which is called "tetrate", -and "tetratefips" flavor will be added shortly. +The kind of the distribution. As of now, there are three flavors "tetrate", +"tetratefips" and "istio". -- "tetrate" flavor equals the official Istio except it is built by Tetrate. +- "tetrate" flavor equals the upstream Istio except it is built by Tetrate. - "tetratefips" flavor is FIPS-compliant, and can be used for installing FIPS-compliant control plain and data plain built by Tetrate. +- "istio" flavor is the upstream build. Flavor version for upstream build will always be '0' [FLAVOR VERSION] The flavor's version. A flavor version 0 maps to the distribution that is built on -exactly the same source code of the corresponding official Istio version. +exactly the same source code of the corresponding upstream Istio version. [K8S VERSIONS] Supported k8s versions for the distribution diff --git a/cmd/prune.go b/cmd/prune.go index dde4d27..9824aa0 100644 --- a/cmd/prune.go +++ b/cmd/prune.go @@ -53,7 +53,7 @@ $ getistio prune --version 1.7.4 --flavor tetrate --flavor-version 0 flags := cmd.Flags() flags.SortFlags = false flags.StringVarP(&flagVersion, "version", "", "", "Version of istioctl e.g. 1.7.4") - flags.StringVarP(&flagFlavor, "flavor", "", "", "Flavor of istioctl, e.g. \"tetrate\" or \"tetratefips\"") + flags.StringVarP(&flagFlavor, "flavor", "", "", "Flavor of istioctl, e.g. \"tetrate\" or \"tetratefips\" or \"istio\"") flags.IntVarP(&flagFlavorVersion, "flavor-version", "", -1, "Version of the flavor, e.g. 1") return cmd } diff --git a/cmd/switch.go b/cmd/switch.go index 6fc2584..a6863aa 100644 --- a/cmd/switch.go +++ b/cmd/switch.go @@ -49,7 +49,7 @@ $ getistio switch --version 1.7.4 --flavor tetrate --flavor-version=1`, flags := cmd.Flags() flags.SortFlags = false flags.StringVarP(&flagVersion, "version", "", "", "Version of istioctl e.g. 1.7.4") - flags.StringVarP(&flagFlavor, "flavor", "", "", "Flavor of istioctl, e.g. \"tetrate\" or \"tetratefips\"") + flags.StringVarP(&flagFlavor, "flavor", "", "", "Flavor of istioctl, e.g. \"tetrate\" or \"tetratefips\" or \"istio\"") flags.IntVarP(&flagFlavorVersion, "flavor-version", "", -1, "Version of the flavor, e.g. 1") _ = cmd.MarkFlagRequired("version") diff --git a/doc/en/getistio-cli/reference/getistio_check-upgrade/_index.md b/doc/en/getistio-cli/reference/getistio_check-upgrade/_index.md index c50c66e..2cbcf45 100644 --- a/doc/en/getistio-cli/reference/getistio_check-upgrade/_index.md +++ b/doc/en/getistio-cli/reference/getistio_check-upgrade/_index.md @@ -21,7 +21,7 @@ $ getistio check-upgrade - There is the available patch for the minor version 1.7-tetrate. We recommend upgrading all 1.7-tetrate versions -> 1.7.4-tetrate-v1 - There is the available patch for the minor version 1.8-tetrate which includes **security upgrades**. We strongly recommend upgrading all 1.8-tetrate versions -> 1.8.1-tetrate-v1 -In the above example, we call names in the form of x.y-${flavor} "minor version", where x.y is Istio's official minor and ${flavor} is the flavor of the distribution. +In the above example, we call names in the form of x.y-${flavor} "minor version", where x.y is Istio's upstream minor and ${flavor} is the flavor of the distribution. Please refer to 'getistio fetch --help' or 'getistio list --help' for more information. ``` diff --git a/doc/en/getistio-cli/reference/getistio_fetch/_index.md b/doc/en/getistio-cli/reference/getistio_fetch/_index.md index e681b6e..5bff76f 100644 --- a/doc/en/getistio-cli/reference/getistio_fetch/_index.md +++ b/doc/en/getistio-cli/reference/getistio_fetch/_index.md @@ -30,6 +30,9 @@ $ getistio fetch --version 1.7.4 --flavor tetratefips # Fetch the latest "tetrate flavored" istioctl of version=1.7.4 $ getistio fetch --version 1.7.4 +# Fetch the istioctl of version=1.8.3 flavor=istio flavor-version=0 +$ getistio fetch --version 1.8.3 --flavor istio + # Fetch the latest "tetrate flavored" istioctl @@ -50,7 +53,7 @@ For more information, please refer to "getistio list --help" command. ``` --version string Version of istioctl e.g. "--version 1.7.4" - --flavor string Flavor of istioctl, e.g. "--flavor tetrate" or --flavor tetratefips" + --flavor string Flavor of istioctl, e.g. "--flavor tetrate" or --flavor tetratefips" or --flavor istio" --flavor-version int Version of the flavor, e.g. "--version 1" (default -1) -h, --help help for fetch ``` diff --git a/doc/en/getistio-cli/reference/getistio_list/_index.md b/doc/en/getistio-cli/reference/getistio_list/_index.md index f8ed198..bd3bc9c 100644 --- a/doc/en/getistio-cli/reference/getistio_list/_index.md +++ b/doc/en/getistio-cli/reference/getistio_list/_index.md @@ -26,18 +26,19 @@ ISTIO VERSION FLAVOR FLAVOR VERSION K8S VERSIONS The following is the explanation of each column: [ISTIO VERSION] -The official tagged version of Istio on which the distribution is built. +The upstream tagged version of Istio on which the distribution is built. [FLAVOR] -The kind of the distribution. As of now, there's one flavor which is called "tetrate", -and "tetratefips" flavor will be added shortly. +The kind of the distribution. As of now, there are three flavors "tetrate", +"tetratefips" and "istio". -- "tetrate" flavor equals the official Istio except it is built by Tetrate. +- "tetrate" flavor equals the upstream Istio except it is built by Tetrate. - "tetratefips" flavor is FIPS-compliant, and can be used for installing FIPS-compliant control plain and data plain built by Tetrate. +- "istio" flavor is the upstream build. Flavor version for upstream build will always be '0' [FLAVOR VERSION] The flavor's version. A flavor version 0 maps to the distribution that is built on -exactly the same source code of the corresponding official Istio version. +exactly the same source code of the corresponding upstream Istio version. [K8S VERSIONS] Supported k8s versions for the distribution diff --git a/doc/en/getistio-cli/reference/getistio_prune/_index.md b/doc/en/getistio-cli/reference/getistio_prune/_index.md index 81783b1..b05f4d0 100644 --- a/doc/en/getistio-cli/reference/getistio_prune/_index.md +++ b/doc/en/getistio-cli/reference/getistio_prune/_index.md @@ -24,7 +24,7 @@ $ getistio prune --version 1.7.4 --flavor tetrate --flavor-version 0 ``` --version string Version of istioctl e.g. 1.7.4 - --flavor string Flavor of istioctl, e.g. "tetrate" or "tetratefips" + --flavor string Flavor of istioctl, e.g. "tetrate" or "tetratefips" or "istio" --flavor-version int Version of the flavor, e.g. 1 (default -1) -h, --help help for prune ``` diff --git a/doc/en/getistio-cli/reference/getistio_switch/_index.md b/doc/en/getistio-cli/reference/getistio_switch/_index.md index baac616..596319f 100644 --- a/doc/en/getistio-cli/reference/getistio_switch/_index.md +++ b/doc/en/getistio-cli/reference/getistio_switch/_index.md @@ -20,7 +20,7 @@ $ getistio switch --version 1.7.4 --flavor tetrate --flavor-version=1 ``` --version string Version of istioctl e.g. 1.7.4 - --flavor string Flavor of istioctl, e.g. "tetrate" or "tetratefips" + --flavor string Flavor of istioctl, e.g. "tetrate" or "tetratefips" or "istio" --flavor-version int Version of the flavor, e.g. 1 (default -1) -h, --help help for switch ``` diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 3380eac..7cafc6c 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -202,6 +202,7 @@ func list(t *testing.T) { require.NoError(t, cmd.Run()) exp := `ISTIO VERSION FLAVOR FLAVOR VERSION K8S VERSIONS + 1.8.3 istio 0 1.16,1.17,1.18 *1.8.2 tetrate 0 1.16,1.17,1.18 1.8.2 tetratefips 0 1.16,1.17,1.18 1.8.1 tetrate 0 1.16,1.17,1.18 diff --git a/manifest.json b/manifest.json index 2930916..a1e876d 100644 --- a/manifest.json +++ b/manifest.json @@ -4,6 +4,20 @@ "1.6": "2020-11-21" }, "istio_distributions": [ + { + "version": "1.8.3", + "flavor": "istio", + "flavor_version": 0, + "k8s_versions": [ + "1.16", + "1.17", + "1.18" + ], + "release_notes": [ + "https://istio.io/latest/news/releases/1.8.x/announcing-1.8.2/" + ], + "is_security_patch": false + }, { "version": "1.8.2", "flavor": "tetrate", diff --git a/src/checkupgrade/check_upgrade.go b/src/checkupgrade/check_upgrade.go index 556f01c..1c3f9a9 100644 --- a/src/checkupgrade/check_upgrade.go +++ b/src/checkupgrade/check_upgrade.go @@ -218,9 +218,9 @@ func getDataPlaneVersions(info *[]istioversion.ProxyInfo) (map[string]*api.Istio func findLowestPatchVersionsInGroup(in []*api.IstioDistribution) (map[string]*api.IstioDistribution, error) { ret := make(map[string]*api.IstioDistribution, len(in)) for _, d := range in { - if d.IsOfficial() { - logger.Warnf("the official istio distributions are not supported by check-upgrade command: %s. "+ - "Please install distributions listed in `getistio list` command\n", d.Version) + if d.IsUpstream() { + logger.Warnf("the upstream istio distributions are not supported by check-upgrade command: %s. "+ + "Please install distributions with tetrate flavor listed in `getistio list` command\n", d.Version) continue } diff --git a/src/checkupgrade/check_upgrade_test.go b/src/checkupgrade/check_upgrade_test.go index ab2adcd..7ba6048 100644 --- a/src/checkupgrade/check_upgrade_test.go +++ b/src/checkupgrade/check_upgrade_test.go @@ -164,7 +164,7 @@ func Test_printGetistioCheck(t *testing.T) { } }) - t.Run("only official versions", func(t *testing.T) { + t.Run("only upstream versions", func(t *testing.T) { for i, c := range []istioversion.Version{ { DataPlaneVersion: &[]istioversion.ProxyInfo{ @@ -196,7 +196,7 @@ func Test_printGetistioCheck(t *testing.T) { }) actual := buf.String() - assert.Contains(t, actual, "Please install distributions listed in `getistio list` command") + assert.Contains(t, actual, "Please install distributions with tetrate flavor listed in `getistio list` command") assert.Contains(t, actual, "nothing to check") t.Log(actual) }) @@ -495,7 +495,7 @@ func Test_getControlPlaneVersions(t *testing.T) { require.Error(t, err) }) - t.Run("official version", func(t *testing.T) { + t.Run("upstream version", func(t *testing.T) { in := istioversion.MeshInfo{{Info: istioversion.BuildInfo{ Version: "1.7.1", }}} @@ -505,7 +505,7 @@ func Test_getControlPlaneVersions(t *testing.T) { require.NoError(t, err) }) - assert.Contains(t, buf.String(), "Please install distributions listed in") + assert.Contains(t, buf.String(), "Please install distributions with tetrate flavor listed in") t.Log(buf.String()) }) @@ -577,14 +577,14 @@ func Test_getDataPlaneVersions(t *testing.T) { require.Error(t, err) }) - t.Run("official version", func(t *testing.T) { + t.Run("upstream version", func(t *testing.T) { in := []istioversion.ProxyInfo{{IstioVersion: "1.7.1"}} buf := logger.ExecuteWithLock(func() { _, err := getDataPlaneVersions(&in) require.NoError(t, err) }) - assert.Contains(t, buf.String(), "Please install distributions listed in") + assert.Contains(t, buf.String(), "Please install distributions with tetrate flavor listed in") t.Log(buf.String()) }) diff --git a/src/manifest/checker_endoflife_test.go b/src/manifest/checker_endoflife_test.go index b04ca00..15ae669 100644 --- a/src/manifest/checker_endoflife_test.go +++ b/src/manifest/checker_endoflife_test.go @@ -42,6 +42,7 @@ func Test_endOfLifeChecker(t *testing.T) { IstioDistributions: []*api.IstioDistribution{ {Version: "1.8.1", Flavor: api.IstioDistributionFlavorTetrate, FlavorVersion: 0}, {Version: "1.9.10", Flavor: api.IstioDistributionFlavorTetrateFIPS, FlavorVersion: 0}, + {Version: "1.9.0", Flavor: api.IstioDistributionFlavorIstio, FlavorVersion: 0}, }, IstioMinorVersionsEolDates: map[string]string{ "1.7": "2020-10-10", @@ -81,7 +82,7 @@ func Test_endOfLifeChecker(t *testing.T) { t.Run("warn", func(t *testing.T) { now := time.Date(2020, 11, 5, 0, 0, 0, 0, time.Local) - exp := `[WARNING] Your current active minor version %s is reaching the end of life on 2020-10-10. We strongly recommend you to upgrade to the available higher minor versions: 1.8.1-tetrate-v0, 1.9.10-tetratefips-v0.` + exp := `[WARNING] Your current active minor version %s is reaching the end of life on 2020-10-10. We strongly recommend you to upgrade to the available higher minor versions: 1.8.1-tetrate-v0, 1.9.10-tetratefips-v0, 1.9.0-istio-v0.` for _, c := range []struct { version, minorVersion string }{{version: "1.7.1", minorVersion: "1.7"}, {version: "1.6.100", minorVersion: "1.6"}} { diff --git a/src/manifest/checker_security_patch_test.go b/src/manifest/checker_security_patch_test.go index 7d4d159..789514c 100644 --- a/src/manifest/checker_security_patch_test.go +++ b/src/manifest/checker_security_patch_test.go @@ -95,11 +95,13 @@ func Test_constructLatestVersionsMap(t *testing.T) { { in: []*api.IstioDistribution{ {Version: "1.8.10", FlavorVersion: 5, Flavor: "tetratefips"}, + {Version: "1.8.4", FlavorVersion: 0, Flavor: "istio"}, {Version: "1.7.10", FlavorVersion: 1, Flavor: "tetrate"}, {Version: "1.7.8", FlavorVersion: 1, Flavor: "tetrate"}, }, exp: map[string]*api.IstioDistribution{ "1.8-tetratefips": {FlavorVersion: 5, Flavor: "tetratefips", Version: "1.8.10"}, + "1.8-istio": {FlavorVersion: 0, Flavor: "istio", Version: "1.8.4"}, "1.7-tetrate": {FlavorVersion: 1, Flavor: "tetrate", Version: "1.7.10"}, }, }, @@ -108,11 +110,13 @@ func Test_constructLatestVersionsMap(t *testing.T) { {Version: "1.8.10", FlavorVersion: 5, Flavor: "tetratefips"}, {Version: "1.7.10", FlavorVersion: 1, Flavor: "tetrate"}, {Version: "1.7.8", FlavorVersion: 3, Flavor: "tetratefips"}, + {Version: "1.9.0", FlavorVersion: 0, Flavor: "istio"}, }, exp: map[string]*api.IstioDistribution{ "1.8-tetratefips": {FlavorVersion: 5, Flavor: "tetratefips", Version: "1.8.10"}, "1.7-tetrate": {FlavorVersion: 1, Flavor: "tetrate", Version: "1.7.10"}, "1.7-tetratefips": {FlavorVersion: 3, Flavor: "tetratefips", Version: "1.7.8"}, + "1.9-istio": {FlavorVersion: 0, Flavor: "istio", Version: "1.9.0"}, }, }, } { diff --git a/src/manifest/manifest_test.go b/src/manifest/manifest_test.go index afd15cf..90f111c 100644 --- a/src/manifest/manifest_test.go +++ b/src/manifest/manifest_test.go @@ -40,6 +40,11 @@ func TestFetchManifest(t *testing.T) { Flavor: api.IstioDistributionFlavorTetrateFIPS, FlavorVersion: 0, }, + { + Version: "1.7.7", + Flavor: api.IstioDistributionFlavorIstio, + FlavorVersion: 0, + }, { Version: "1.7.5", Flavor: api.IstioDistributionFlavorTetrate, @@ -60,6 +65,7 @@ func TestFetchManifest(t *testing.T) { require.NoError(t, err) expIstioVersions := map[string]struct{}{ + "1.7.7-istio-v0": {}, "1.7.6-tetrate-v0": {}, "1.7.5-tetrate-v0": {}, "1.7.6-tetratefips-v0": {}, @@ -109,6 +115,12 @@ func TestPrintManifest(t *testing.T) { } manifest := &api.Manifest{ IstioDistributions: []*api.IstioDistribution{ + { + Version: "1.8.3", + Flavor: api.IstioDistributionFlavorIstio, + FlavorVersion: 0, + K8SVersions: []string{"1.18"}, + }, { Version: "1.7.6", Flavor: api.IstioDistributionFlavorTetrateFIPS, @@ -129,6 +141,7 @@ func TestPrintManifest(t *testing.T) { }) assert.Equal(t, `ISTIO VERSION FLAVOR FLAVOR VERSION K8S VERSIONS + 1.8.3 istio 0 1.18 *1.7.6 tetratefips 0 1.16 1.7.5 tetrate 0 1.16 `,