-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial impl * Refactor and unit tests * Update apirule_types.go * gofmt -s -w . * Update internal/processing/processing_test.go Co-authored-by: Bartosz Chwila <103247439+barchw@users.noreply.github.com> * Update internal/processing/processing_test.go Co-authored-by: Bartosz Chwila <103247439+barchw@users.noreply.github.com> * Update internal/processing/processing_test.go Co-authored-by: Bartosz Chwila <103247439+barchw@users.noreply.github.com> * Better safe than sorry Co-authored-by: Bartosz Chwila <103247439+barchw@users.noreply.github.com>
- Loading branch information
Showing
19 changed files
with
284 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package helpers | ||
|
||
import ( | ||
gatewayv1beta1 "github.com/kyma-incubator/api-gateway/api/v1beta1" | ||
) | ||
|
||
func FindServiceNamespace(api *gatewayv1beta1.APIRule, rule *gatewayv1beta1.Rule) *string { | ||
// Fallback direction for the upstream service namespace: Rule.Service > Spec.Service > APIRule | ||
if rule != nil && rule.Service != nil && rule.Service.Namespace != nil { | ||
return rule.Service.Namespace | ||
} | ||
if api.Spec.Service != nil && api.Spec.Service.Namespace != nil { | ||
return api.Spec.Service.Namespace | ||
} | ||
return &api.ObjectMeta.Namespace | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.