예제 #1
0
        public async Task <int> Execute()
        {
            try
            {
                KongConfiguration = await KongReader.GetConfiguration();
            }
            catch (Exception e) when(e is KongException || e is HttpRequestException)
            {
                return(ExitWithCode.Return(ExitCode.HostUnreachable, e.Message));
            }

            var versionSubStr = KongConfiguration.Version.Substring(0, 4);
            var version       = double.Parse(versionSubStr[3] == '.' ? versionSubStr.Substring(0, 3) : versionSubStr);

            if (KongConfiguration.Version.Contains("enterprise-edition"))
            {
                const double lowestSupportedVersion = 0.36;
                if (version < lowestSupportedVersion)
                {
                    return(ExitWithCode.Return(ExitCode.HostVersionNotSupported,
                                               $"This version of Kongverge can only support Kong enterprise from version {lowestSupportedVersion}-x"));
                }
            }
            else
            {
                const double lowestSupportedVersion = 1.4;
                if (version < lowestSupportedVersion)
                {
                    return(ExitWithCode.Return(ExitCode.HostVersionNotSupported,
                                               $"This version of Kongverge can only support Kong from version {lowestSupportedVersion}.x"));
                }
            }

            return(await DoExecute());
        }
예제 #2
0
        public async Task <int> Execute()
        {
            try
            {
                KongConfiguration = await KongReader.GetConfiguration();
            }
            catch
            {
                return(ExitWithCode.Return(ExitCode.HostUnreachable));
            }

            return(await DoExecute());
        }
예제 #3
0
        public async Task<int> Execute()
        {
            try
            {
                KongConfiguration = await KongReader.GetConfiguration();
            }
            catch (Exception e) when (e is KongException || e is HttpRequestException)
            {
                return ExitWithCode.Return(ExitCode.HostUnreachable, e.Message);
            }

            return await DoExecute();
        }