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

Feature/grpc #2369

Closed
wants to merge 173 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
58a6df5
add GRPC api type for API CR
DDH13 Jan 18, 2024
8287d0f
gitignore router/resources folder
DDH13 Jan 18, 2024
29ee66c
c1 after rebase
DDH13 Mar 19, 2024
b63f91a
c2
DDH13 Jan 29, 2024
1f62729
reconciled grpc backend
DDH13 Jan 30, 2024
ea2814e
add function SetInfoGRPCRouteCR
DDH13 Jan 31, 2024
bdcbf93
duplicate methods from GQL to grpc_api.go
DDH13 Jan 31, 2024
9e85a03
minor changes
DDH13 Jan 31, 2024
7186f27
changed synchronizer.go. Builds without errors
DDH13 Jan 31, 2024
db8d739
so far everything works
DDH13 Feb 2, 2024
93d1d75
removed policies
DDH13 Feb 7, 2024
b16758e
enable http2 backend for grpc
DDH13 Feb 8, 2024
7e3b2c8
remove comment
DDH13 Feb 19, 2024
b4a5ba9
add constants
DDH13 Feb 19, 2024
302b36d
commented out unimplemented function in enforcer
DDH13 Feb 20, 2024
0c548bb
bug fixes after rebasing
DDH13 Feb 20, 2024
3e443ae
fixed envoy configurations
DDH13 Feb 26, 2024
7d7af55
configured grpc routes on adapter side
DDH13 Feb 28, 2024
c2b99c8
debugged context extensions not being set
DDH13 Mar 1, 2024
035e9ef
Request gets matched to grpc api correctly
DDH13 Mar 1, 2024
e91eb18
Request gets matched to resource correctly
DDH13 Mar 1, 2024
6f1c0b0
enabled http2 backend and unset transport socket matching
DDH13 Mar 1, 2024
3da8731
add grpc CRs for testing
DDH13 Mar 5, 2024
8220d52
add custom grpc backend deployment to manifest
DDH13 Mar 5, 2024
0af1bfb
update grpc CRs
DDH13 Mar 5, 2024
a1e1ff6
fix transport socket not matching
DDH13 Mar 8, 2024
807edbf
change gRPC CRs
DDH13 Mar 9, 2024
d3ed16a
remove deployment and manifest for grpc backend pod
DDH13 Mar 11, 2024
0ff06d6
add CRs for grpc api
DDH13 Mar 11, 2024
96b3f6a
add empty test for grpc api
DDH13 Mar 11, 2024
4ce242b
works with postman client
DDH13 Mar 14, 2024
ece6f36
changed grpc CR for test
DDH13 Mar 16, 2024
dc5a567
move basepath validation for API CRs
DDH13 Mar 16, 2024
fe60f67
change test files
DDH13 Mar 18, 2024
19084f0
add testcases and helpers
DDH13 Mar 19, 2024
16498ab
add generated client code
DDH13 Mar 19, 2024
dfe02b4
change test case timeout
DDH13 Mar 21, 2024
6bb830d
changed request timeout
DDH13 Mar 26, 2024
cc05715
fix after release
DDH13 Apr 15, 2024
0170a21
changed method to post
DDH13 Apr 15, 2024
67fc8e3
fixed auth
DDH13 Apr 15, 2024
d0a8a48
change 2023 to 2024
DDH13 Apr 16, 2024
c03b37e
removed TODOs
DDH13 Apr 16, 2024
cbdc119
change https to http in testcase
DDH13 Apr 16, 2024
3e66672
generalize testcase
DDH13 Apr 16, 2024
760761b
generalize testcase a bit more
DDH13 Apr 16, 2024
271ff0f
add testcase for grpc api default version
DDH13 Apr 17, 2024
1d7aea9
add default version capability for grpc api
DDH13 Apr 17, 2024
f5e9185
modify test for grpc default version testing
DDH13 Apr 17, 2024
290c65f
resolved comments
DDH13 Apr 24, 2024
4389907
reconciles grpc scopes
DDH13 Apr 25, 2024
60fcea5
remove todo
DDH13 Apr 26, 2024
2ea0b3a
Merge pull request #2092 from DDH13/main
AmaliMatharaarachchi Apr 26, 2024
bdbcaba
added grpc spec structs for ballerina
DDH13 Apr 19, 2024
aab6843
conf gets generated from proto file
DDH13 Apr 19, 2024
1c93b91
CRs get generated
DDH13 Apr 22, 2024
a616922
gRPC CRs get generated
DDH13 Apr 22, 2024
75a2b9f
fixed basepath and service path issue
DDH13 Apr 22, 2024
250f3ff
fixed TODOs
DDH13 Apr 22, 2024
41ae5cc
Add deploying api using apk-conf and proto file
DDH13 Apr 24, 2024
f424942
add cucumber tests
DDH13 Apr 24, 2024
7fb480c
add grpc backend deployment and service CRs
DDH13 Apr 24, 2024
5fa3111
add code needed for cucumber tests
DDH13 Apr 24, 2024
80be9cc
add more code for cucumber test
DDH13 Apr 25, 2024
781793c
cucumber test for grpc works
DDH13 Apr 25, 2024
55cf2ad
generalized interceptor
DDH13 Apr 26, 2024
2667f32
add cucumber test for oauth2 disabled
DDH13 Apr 26, 2024
3182a13
add cucumber test for scopes
DDH13 Apr 26, 2024
efc2d79
add cucumber test for default version
DDH13 Apr 26, 2024
9a5f436
add missing bracket to fix issue in commit bdc279f566d230cce3c195b5a…
DDH13 Apr 26, 2024
1d8ed4d
resolved comments
DDH13 Apr 26, 2024
3c10d00
changed grpc deployment and service CR
DDH13 Apr 29, 2024
064a678
Add handling for errors
DDH13 Apr 29, 2024
fe87a63
Slight change to test
DDH13 Apr 30, 2024
ddd0066
fixed api-definition-endpoint
DDH13 May 2, 2024
bbaa071
fixed api-definition-endpoint
DDH13 May 2, 2024
c2a0997
changed path match type to Exact
DDH13 May 2, 2024
ed46c2c
add cucumber test for api definition endpoint
DDH13 May 2, 2024
2282d77
Add name generation for apk-conf
DDH13 May 3, 2024
af1445e
prevent GRPC API from propagating to CP
DDH13 May 6, 2024
aaa9180
add cucumber test for mtls
DDH13 May 8, 2024
b433690
changed gRPC status code
DDH13 May 9, 2024
c11392e
Merge pull request #2353 from DDH13/grpc-apk-conf
CrowleyRajapakse May 9, 2024
379a83c
add GRPC api type for API CR
DDH13 Jan 18, 2024
4aed2c2
gitignore router/resources folder
DDH13 Jan 18, 2024
ef53db3
c1 after rebase
DDH13 Mar 19, 2024
350faee
c2
DDH13 Jan 29, 2024
71cb508
reconciled grpc backend
DDH13 Jan 30, 2024
11a05ac
add function SetInfoGRPCRouteCR
DDH13 Jan 31, 2024
b384e0b
duplicate methods from GQL to grpc_api.go
DDH13 Jan 31, 2024
7f906bd
minor changes
DDH13 Jan 31, 2024
95bc26b
changed synchronizer.go. Builds without errors
DDH13 Jan 31, 2024
8f187f3
so far everything works
DDH13 Feb 2, 2024
8deab02
removed policies
DDH13 Feb 7, 2024
b535cf9
enable http2 backend for grpc
DDH13 Feb 8, 2024
f4c41e8
remove comment
DDH13 Feb 19, 2024
c0e6fdc
add constants
DDH13 Feb 19, 2024
db53a7b
commented out unimplemented function in enforcer
DDH13 Feb 20, 2024
d9abf17
bug fixes after rebasing
DDH13 Feb 20, 2024
6d1363f
fixed envoy configurations
DDH13 Feb 26, 2024
7f68f9a
configured grpc routes on adapter side
DDH13 Feb 28, 2024
18db4c1
debugged context extensions not being set
DDH13 Mar 1, 2024
f1af4f3
Request gets matched to grpc api correctly
DDH13 Mar 1, 2024
71aae6f
Request gets matched to resource correctly
DDH13 Mar 1, 2024
cd0251b
enabled http2 backend and unset transport socket matching
DDH13 Mar 1, 2024
af745e8
add grpc CRs for testing
DDH13 Mar 5, 2024
6581730
add custom grpc backend deployment to manifest
DDH13 Mar 5, 2024
409edd3
update grpc CRs
DDH13 Mar 5, 2024
8a7f7db
fix transport socket not matching
DDH13 Mar 8, 2024
1e32b41
change gRPC CRs
DDH13 Mar 9, 2024
804f9a6
remove deployment and manifest for grpc backend pod
DDH13 Mar 11, 2024
d5f93bf
add CRs for grpc api
DDH13 Mar 11, 2024
3523c15
add empty test for grpc api
DDH13 Mar 11, 2024
4d9c5d5
works with postman client
DDH13 Mar 14, 2024
eb73e2e
changed grpc CR for test
DDH13 Mar 16, 2024
332ce60
move basepath validation for API CRs
DDH13 Mar 16, 2024
b2b8ab3
change test files
DDH13 Mar 18, 2024
171ee00
add testcases and helpers
DDH13 Mar 19, 2024
27ad36a
add generated client code
DDH13 Mar 19, 2024
f81b63d
change test case timeout
DDH13 Mar 21, 2024
3f0ea04
changed request timeout
DDH13 Mar 26, 2024
bff8fe9
fix after release
DDH13 Apr 15, 2024
5e70f1e
changed method to post
DDH13 Apr 15, 2024
3a1df2a
fixed auth
DDH13 Apr 15, 2024
86d557d
change 2023 to 2024
DDH13 Apr 16, 2024
02b480d
removed TODOs
DDH13 Apr 16, 2024
d202d40
change https to http in testcase
DDH13 Apr 16, 2024
5df9460
generalize testcase
DDH13 Apr 16, 2024
61c6812
generalize testcase a bit more
DDH13 Apr 16, 2024
644469b
add testcase for grpc api default version
DDH13 Apr 17, 2024
3e0706f
add default version capability for grpc api
DDH13 Apr 17, 2024
443a226
modify test for grpc default version testing
DDH13 Apr 17, 2024
d885d5c
resolved comments
DDH13 Apr 24, 2024
49286b9
reconciles grpc scopes
DDH13 Apr 25, 2024
cfd055d
remove todo
DDH13 Apr 26, 2024
9bbfaba
added grpc spec structs for ballerina
DDH13 Apr 19, 2024
2f69298
conf gets generated from proto file
DDH13 Apr 19, 2024
8ab232b
CRs get generated
DDH13 Apr 22, 2024
7a5c11b
gRPC CRs get generated
DDH13 Apr 22, 2024
3e35a0e
fixed basepath and service path issue
DDH13 Apr 22, 2024
ea88a21
fixed TODOs
DDH13 Apr 22, 2024
96b0eca
Add deploying api using apk-conf and proto file
DDH13 Apr 24, 2024
40d1738
add cucumber tests
DDH13 Apr 24, 2024
3bb6b48
add grpc backend deployment and service CRs
DDH13 Apr 24, 2024
a621da3
add code needed for cucumber tests
DDH13 Apr 24, 2024
5efb8bf
add more code for cucumber test
DDH13 Apr 25, 2024
18d69b1
cucumber test for grpc works
DDH13 Apr 25, 2024
186a771
generalized interceptor
DDH13 Apr 26, 2024
e84ffbd
add cucumber test for oauth2 disabled
DDH13 Apr 26, 2024
b25e49f
add cucumber test for scopes
DDH13 Apr 26, 2024
f20dcc8
add cucumber test for default version
DDH13 Apr 26, 2024
3886115
add missing bracket to fix issue in commit bdc279f566d230cce3c195b5a…
DDH13 Apr 26, 2024
158d363
resolved comments
DDH13 Apr 26, 2024
53e733a
changed grpc deployment and service CR
DDH13 Apr 29, 2024
60108f4
Add handling for errors
DDH13 Apr 29, 2024
71754d2
Slight change to test
DDH13 Apr 30, 2024
f9a3736
fixed api-definition-endpoint
DDH13 May 2, 2024
4afa127
fixed api-definition-endpoint
DDH13 May 2, 2024
5c2ff80
changed path match type to Exact
DDH13 May 2, 2024
3941fcb
add cucumber test for api definition endpoint
DDH13 May 2, 2024
a6dc22e
Add name generation for apk-conf
DDH13 May 3, 2024
3b11e51
prevent GRPC API from propagating to CP
DDH13 May 6, 2024
ed7cb41
add cucumber test for mtls
DDH13 May 8, 2024
10b85dd
changed gRPC status code
DDH13 May 9, 2024
a992049
Merge branch 'feature/grpc' into feature/grpc
DDH13 May 10, 2024
d1dae98
c1 after rebase
DDH13 May 10, 2024
77d593a
Merge pull request #2368 from DDH13/feature/grpc
Krishanx92 May 10, 2024
8178fc0
removed duplicate function
DDH13 May 10, 2024
a74c656
Merge pull request #2370 from DDH13/feature/grpc
Krishanx92 May 10, 2024
46ae597
adding new version v1beta1
DDH13 May 13, 2024
4d23c9e
change api webhooks
DDH13 May 13, 2024
67186ff
delete file
DDH13 May 14, 2024
b07da78
Merge pull request #2372 from DDH13/feature/grpc-version
AmaliMatharaarachchi May 14, 2024
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
1 change: 1 addition & 0 deletions adapter/internal/oasparser/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const (
SOAP string = "SOAP"
WS string = "WS"
GRAPHQL string = "GraphQL"
GRPC string = "GRPC"
WEBHOOK string = "WEBHOOK"
SSE string = "SSE"
Prototyped string = "prototyped"
Expand Down
4 changes: 2 additions & 2 deletions adapter/internal/oasparser/envoyconf/internal_dtos.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package envoyconf

import (
"github.com/wso2/apk/adapter/internal/oasparser/model"
dpv1alpha2 "github.com/wso2/apk/common-go-libs/apis/dp/v1alpha2"
dpv1beta1 "github.com/wso2/apk/common-go-libs/apis/dp/v1beta1"
)

// routeCreateParams is the DTO used to provide information to the envoy route create function
Expand All @@ -41,7 +41,7 @@ type routeCreateParams struct {
isDefaultVersion bool
createDefaultPath bool
apiLevelRateLimitPolicy *model.RateLimitPolicy
apiProperties []dpv1alpha2.Property
apiProperties []dpv1beta1.Property
environment string
envType string
}
Expand Down
101 changes: 95 additions & 6 deletions adapter/internal/oasparser/envoyconf/routes_with_clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import (
logging "github.com/wso2/apk/adapter/internal/logging"
"github.com/wso2/apk/adapter/internal/oasparser/constants"
"github.com/wso2/apk/adapter/internal/oasparser/model"
dpv1alpha2 "github.com/wso2/apk/common-go-libs/apis/dp/v1alpha2"
dpv1beta1 "github.com/wso2/apk/common-go-libs/apis/dp/v1beta1"
"google.golang.org/protobuf/proto"
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
)
Expand Down Expand Up @@ -197,6 +197,73 @@ func CreateRoutesWithClusters(adapterInternalAPI *model.AdapterInternalAPI, inte
}
return routes, clusters, endpoints, nil
}
if adapterInternalAPI.GetAPIType() == constants.GRPC {
basePath := strings.TrimSuffix(adapterInternalAPI.Endpoints.Endpoints[0].Basepath, "/")

clusterName := getClusterName(adapterInternalAPI.Endpoints.EndpointPrefix, organizationID, vHost,
adapterInternalAPI.GetTitle(), apiVersion, "")
adapterInternalAPI.Endpoints.HTTP2BackendEnabled = true
cluster, address, err := processEndpoints(clusterName, adapterInternalAPI.Endpoints, timeout, basePath)
if err != nil {
logger.LoggerOasparser.ErrorC(logging.PrintError(logging.Error2239, logging.MAJOR,
"Error while adding grpc endpoints for %s:%v. %v", apiTitle, apiVersion, err.Error()))
return nil, nil, nil, fmt.Errorf("error while adding grpc endpoints for %s:%v. %v", apiTitle, apiVersion,
err.Error())
}
clusters = append(clusters, cluster)
endpoints = append(endpoints, address...)

for _, resource := range adapterInternalAPI.GetResources() {
var clusterName string
resourcePath := resource.GetPath()
endpoint := resource.GetEndpoints()
endpoint.HTTP2BackendEnabled = true
basePath := strings.TrimSuffix(endpoint.Endpoints[0].Basepath, "/")
existingClusterName := getExistingClusterName(*endpoint, processedEndpoints)

if existingClusterName == "" {
clusterName = getClusterName(endpoint.EndpointPrefix, organizationID, vHost, adapterInternalAPI.GetTitle(), apiVersion, resource.GetID())
cluster, address, err := processEndpoints(clusterName, endpoint, timeout, basePath)
if err != nil {
logger.LoggerOasparser.ErrorC(logging.PrintError(logging.Error2239, logging.MAJOR, "Error while adding resource level endpoints for %s:%v-%v. %v", apiTitle, apiVersion, resourcePath, err.Error()))
} else {
clusters = append(clusters, cluster)
endpoints = append(endpoints, address...)
processedEndpoints[clusterName] = *endpoint
}
} else {
clusterName = existingClusterName
}
// Create resource level interceptor clusters if required
clustersI, endpointsI, operationalReqInterceptors, operationalRespInterceptorVal := createInterceptorResourceClusters(adapterInternalAPI,
interceptorCerts, vHost, organizationID, apiRequestInterceptor, apiResponseInterceptor, resource)
clusters = append(clusters, clustersI...)
endpoints = append(endpoints, endpointsI...)
routeParams := genRouteCreateParams(adapterInternalAPI, resource, vHost, basePath, clusterName, *operationalReqInterceptors, *operationalRespInterceptorVal, organizationID,
false, false)

routeP, err := createRoutes(routeParams)
if err != nil {
logger.LoggerXds.ErrorC(logging.PrintError(logging.Error2231, logging.MAJOR,
"Error while creating routes for GRPC API %s %s for path: %s Error: %s", adapterInternalAPI.GetTitle(),
adapterInternalAPI.GetVersion(), resource.GetPath(), err.Error()))
return nil, nil, nil, fmt.Errorf("error while creating routes. %v", err)
}
routes = append(routes, routeP...)
if adapterInternalAPI.IsDefaultVersion {
defaultRoutes, errDefaultPath := createRoutes(genRouteCreateParams(adapterInternalAPI, resource, vHost, basePath, clusterName, *operationalReqInterceptors, *operationalRespInterceptorVal, organizationID,
false, true))
if errDefaultPath != nil {
logger.LoggerXds.ErrorC(logging.PrintError(logging.Error2231, logging.MAJOR, "Error while creating routes for GRPC API %s %s for path: %s Error: %s", adapterInternalAPI.GetTitle(), adapterInternalAPI.GetVersion(), removeFirstOccurrence(resource.GetPath(), adapterInternalAPI.GetVersion()), errDefaultPath.Error()))
return nil, nil, nil, fmt.Errorf("error while creating routes. %v", errDefaultPath)
}
routes = append(routes, defaultRoutes...)
}

}

return routes, clusters, endpoints, nil
}
for _, resource := range adapterInternalAPI.GetResources() {
var clusterName string
resourcePath := resource.GetPath()
Expand Down Expand Up @@ -860,8 +927,14 @@ func createRoutes(params *routeCreateParams) (routes []*routev3.Route, err error
decorator *routev3.Decorator
)
if params.createDefaultPath {
xWso2Basepath = removeFirstOccurrence(xWso2Basepath, "/"+version)
resourcePath = removeFirstOccurrence(resource.GetPath(), "/"+version)
//check if basepath is separated from version by a . or /
if strings.Contains(basePath, "."+version) {
xWso2Basepath = removeFirstOccurrence(basePath, "."+version)
resourcePath = removeFirstOccurrence(resource.GetPath(), "."+version)
} else {
xWso2Basepath = removeFirstOccurrence(xWso2Basepath, "/"+version)
resourcePath = removeFirstOccurrence(resource.GetPath(), "/"+version)
}
}

if pathMatchType != gwapiv1.PathMatchExact {
Expand Down Expand Up @@ -1058,6 +1131,16 @@ func createRoutes(params *routeCreateParams) (routes []*routev3.Route, err error
rewritePath := generateRoutePathForReWrite(basePath, resourcePath, pathMatchType)
action.Route.RegexRewrite = generateRegexMatchAndSubstitute(rewritePath, resourcePath, pathMatchType)

if apiType == "GRPC" {
match.Headers = nil
newRoutePath := "/" + strings.TrimPrefix(resourcePath, basePath+".")
if newRoutePath == "/"+resourcePath {
temp := removeFirstOccurrence(basePath, "."+version)
newRoutePath = "/" + strings.TrimPrefix(resourcePath, temp+".")
}
action.Route.RegexRewrite = generateRegexMatchAndSubstitute(rewritePath, newRoutePath, pathMatchType)
}

route := generateRouteConfig(xWso2Basepath, match, action, nil, decorator, perRouteFilterConfigs,
nil, nil, nil, nil) // general headers to add and remove are included in this methods
routes = append(routes, route)
Expand Down Expand Up @@ -1209,8 +1292,14 @@ func CreateAPIDefinitionEndpoint(adapterInternalAPI *model.AdapterInternalAPI, v

matchPath := basePath + endpoint
if isDefaultversion {
basePathWithoutVersion := removeLastOccurrence(basePath, "/"+version)
matchPath = basePathWithoutVersion + endpoint
if adapterInternalAPI.GetAPIType() == "GRPC" {
basePathWithoutVersion := removeLastOccurrence(basePath, "."+version)
matchPath = basePathWithoutVersion + "/" + vHost + endpoint
} else {
basePathWithoutVersion := removeLastOccurrence(basePath, "/"+version)
matchPath = basePathWithoutVersion + endpoint

}
}

matchPath = strings.Replace(matchPath, basePath, regexp.QuoteMeta(basePath), 1)
Expand Down Expand Up @@ -1466,7 +1555,7 @@ func getUpgradeConfig(apiType string) []*routev3.RouteAction_UpgradeConfig {
return upgradeConfig
}

func getAPIProperties(apiPropertiesConfig []dpv1alpha2.Property) string {
func getAPIProperties(apiPropertiesConfig []dpv1beta1.Property) string {
var apiProperties = make(map[string]string)
for _, val := range apiPropertiesConfig {
apiProperties[val.Name] = val.Value
Expand Down
38 changes: 19 additions & 19 deletions adapter/internal/oasparser/envoyconf/routes_with_clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/wso2/apk/adapter/internal/operator/synchronizer"
operatorutils "github.com/wso2/apk/adapter/internal/operator/utils"
"github.com/wso2/apk/common-go-libs/apis/dp/v1alpha1"
"github.com/wso2/apk/common-go-libs/apis/dp/v1alpha2"
"github.com/wso2/apk/common-go-libs/apis/dp/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
k8types "k8s.io/apimachinery/pkg/types"
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
Expand All @@ -39,16 +39,16 @@ import (

func TestCreateRoutesWithClustersWithExactAndRegularExpressionRules(t *testing.T) {
apiState := synchronizer.APIState{}
apiDefinition := v1alpha2.API{
apiDefinition := v1beta1.API{
ObjectMeta: metav1.ObjectMeta{
Namespace: "default",
Name: "test-api-2",
},
Spec: v1alpha2.APISpec{
Spec: v1beta1.APISpec{
APIName: "test-api-2",
APIVersion: "2.0.0",
BasePath: "/test-api/2.0.0",
Production: []v1alpha2.EnvConfig{
Production: []v1beta1.EnvConfig{
{
RouteRefs: []string{
"test-api-2-prod-http-route",
Expand Down Expand Up @@ -211,16 +211,16 @@ func TestExtractAPIDetailsFromHTTPRouteForSpecificEnvironment(t *testing.T) {
func generateSampleAPI(apiName string, apiVersion string, basePath string) synchronizer.APIState {

apiState := synchronizer.APIState{}
apiDefinition := v1alpha2.API{
apiDefinition := v1beta1.API{
ObjectMeta: metav1.ObjectMeta{
Namespace: "default",
Name: apiName,
},
Spec: v1alpha2.APISpec{
Spec: v1beta1.APISpec{
APIName: apiName,
APIVersion: apiVersion,
BasePath: basePath,
Production: []v1alpha2.EnvConfig{
Production: []v1beta1.EnvConfig{
{
RouteRefs: []string{
apiName + "-prod-http-route",
Expand Down Expand Up @@ -274,16 +274,16 @@ func generateSampleAPI(apiName string, apiVersion string, basePath string) synch
// TODO: Fix this test case
func TestCreateRoutesWithClustersWithMultiplePathPrefixRules(t *testing.T) {
apiState := synchronizer.APIState{}
apiDefinition := v1alpha2.API{
apiDefinition := v1beta1.API{
ObjectMeta: metav1.ObjectMeta{
Namespace: "default",
Name: "test-api-1",
},
Spec: v1alpha2.APISpec{
Spec: v1beta1.APISpec{
APIName: "test-api",
APIVersion: "1.0.0",
BasePath: "/test-api/1.0.0",
Production: []v1alpha2.EnvConfig{
Production: []v1beta1.EnvConfig{
{
RouteRefs: []string{
"test-api-1-prod-http-route",
Expand Down Expand Up @@ -423,16 +423,16 @@ func TestCreateRoutesWithClustersWithMultiplePathPrefixRules(t *testing.T) {

func TestCreateRoutesWithClustersWithBackendTLSConfigs(t *testing.T) {
apiState := synchronizer.APIState{}
apiDefinition := v1alpha2.API{
apiDefinition := v1beta1.API{
ObjectMeta: metav1.ObjectMeta{
Namespace: "default",
Name: "test-api-3",
},
Spec: v1alpha2.APISpec{
Spec: v1beta1.APISpec{
APIName: "test-api-3",
APIVersion: "1.0.0",
BasePath: "/test-api-3/1.0.0",
Production: []v1alpha2.EnvConfig{
Production: []v1beta1.EnvConfig{
{
RouteRefs: []string{
"test-api-3-prod-http-route",
Expand Down Expand Up @@ -546,16 +546,16 @@ func TestCreateHealthEndpoint(t *testing.T) {

func TestCreateRoutesWithClustersDifferentBackendRefs(t *testing.T) {
apiState := synchronizer.APIState{}
apiDefinition := v1alpha2.API{
apiDefinition := v1beta1.API{
ObjectMeta: metav1.ObjectMeta{
Namespace: "default",
Name: "test-api-different-backendrefs",
},
Spec: v1alpha2.APISpec{
Spec: v1beta1.APISpec{
APIName: "test-api-different-backendrefs",
APIVersion: "1.0.0",
BasePath: "/test-api-different-backendrefs/1.0.0",
Production: []v1alpha2.EnvConfig{
Production: []v1beta1.EnvConfig{
{
RouteRefs: []string{
"test-api-different-backendrefs-prod-http-route",
Expand Down Expand Up @@ -638,16 +638,16 @@ func TestCreateRoutesWithClustersDifferentBackendRefs(t *testing.T) {

func TestCreateRoutesWithClustersSameBackendRefs(t *testing.T) {
apiState := synchronizer.APIState{}
apiDefinition := v1alpha2.API{
apiDefinition := v1beta1.API{
ObjectMeta: metav1.ObjectMeta{
Namespace: "default",
Name: "test-api-same-backendrefs",
},
Spec: v1alpha2.APISpec{
Spec: v1beta1.APISpec{
APIName: "test-api-same-backendrefs",
APIVersion: "1.0.0",
BasePath: "/test-api-same-backendrefs/1.0.0",
Production: []v1alpha2.EnvConfig{
Production: []v1beta1.EnvConfig{
{
RouteRefs: []string{
"test-api-same-backendrefs-prod-http-route",
Expand Down
Loading
Loading