-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(konnect): add namespace in KonnectNamespacedRef (#82)
* add namespace in KonnectNamespacedRef * add valdation rules to disable konnectNamespacedRef.namespace in namespaced resources * update comments
- Loading branch information
1 parent
21b39dc
commit f5436b2
Showing
20 changed files
with
156 additions
and
0 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
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
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
31 changes: 31 additions & 0 deletions
31
test/crdsvalidation/kongconsumer/testcases/controlplaneref.go
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,31 @@ | ||
package testcases | ||
|
||
import ( | ||
"github.com/samber/lo" | ||
|
||
configurationv1 "github.com/kong/kubernetes-configuration/api/configuration/v1" | ||
configurationv1alpha1 "github.com/kong/kubernetes-configuration/api/configuration/v1alpha1" | ||
) | ||
|
||
var controlPlaneRef = testCasesGroup{ | ||
Name: "fields of controlPlaneRef", | ||
TestCases: []testCase{ | ||
{ | ||
Name: "cpRef cannot have namespace", | ||
KongConsumer: configurationv1.KongConsumer{ | ||
ObjectMeta: commonObjectMeta, | ||
Spec: configurationv1.KongConsumerSpec{ | ||
ControlPlaneRef: &configurationv1alpha1.ControlPlaneRef{ | ||
Type: configurationv1alpha1.ControlPlaneRefKonnectNamespacedRef, | ||
KonnectNamespacedRef: &configurationv1alpha1.KonnectNamespacedRef{ | ||
Name: "test-konnect-control-plane", | ||
Namespace: "another-namespace", | ||
}, | ||
}, | ||
}, | ||
Username: "username-1", | ||
}, | ||
ExpectedErrorMessage: lo.ToPtr("spec.controlPlaneRef cannot specify namespace for namespaced resource"), | ||
}, | ||
}, | ||
} |
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
30 changes: 30 additions & 0 deletions
30
test/crdsvalidation/kongconsumergroup/testcases/controlplaneref.go
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,30 @@ | ||
package testcases | ||
|
||
import ( | ||
"github.com/samber/lo" | ||
|
||
configurationv1alpha1 "github.com/kong/kubernetes-configuration/api/configuration/v1alpha1" | ||
configurationv1beta1 "github.com/kong/kubernetes-configuration/api/configuration/v1beta1" | ||
) | ||
|
||
var controlPlaneRef = testCasesGroup{ | ||
Name: "fields of controlPlaneRef", | ||
TestCases: []testCase{ | ||
{ | ||
Name: "cpRef cannot have namespace", | ||
KongConsumerGroup: configurationv1beta1.KongConsumerGroup{ | ||
ObjectMeta: commonObjectMeta, | ||
Spec: configurationv1beta1.KongConsumerGroupSpec{ | ||
ControlPlaneRef: &configurationv1alpha1.ControlPlaneRef{ | ||
Type: configurationv1alpha1.ControlPlaneRefKonnectNamespacedRef, | ||
KonnectNamespacedRef: &configurationv1alpha1.KonnectNamespacedRef{ | ||
Name: "test-konnect-control-plane", | ||
Namespace: "another-namespace", | ||
}, | ||
}, | ||
}, | ||
}, | ||
ExpectedErrorMessage: lo.ToPtr("spec.controlPlaneRef cannot specify namespace for namespaced resource"), | ||
}, | ||
}, | ||
} |
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