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

e2e: support infoblox provider #124

Merged
merged 1 commit into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,18 @@ Prepare your environment for the installation commands.
For AWS:
```sh
export KUBECONFIG=/path/to/mycluster/kubeconfig
export CLOUD_PROVIDER=AWS
export DNS_PROVIDER=AWS
export AWS_ACCESS_KEY_ID=my-aws-access-key
export AWS_SECRET_ACCESS_KEY=my-aws-access-secret
```
For Infoblox:
```sh
export KUBECONFIG=/path/to/mycluster/kubeconfig
export DNS_PROVIDER=INFOBLOX
export INFOBLOX_GRID_HOST=100.100.100.100
export INFOBLOX_WAPI_USERNAME=my-infoblox-username
export INFOBLOX_WAPI_PASSWORD=my-infoblox-password
```
For the other providers: check out [e2e directory](./test/e2e/).

3. Run the test suite
Expand Down
2 changes: 1 addition & 1 deletion bundle/manifests/externaldns.olm.openshift.io_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.0
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: externaldnses.externaldns.olm.openshift.io
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.0
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: externaldnses.externaldns.olm.openshift.io
spec:
Expand Down
16 changes: 16 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ spec:
name: aws-access-key
zones: # Replace with the desired hosted zone IDs
- "Z3URY6TWQ91KXX"
source:
type: Service
fqdnTemplate:
- '{{.Name}}.mydomain.net'
```

Once this is created the _external-dns-operator_ will create a deployment of _external-dns_ which is configured to
Expand Down Expand Up @@ -90,6 +94,10 @@ spec:
wapiVersion: # the WAPI version, eg: 2.11, 2.3.1
zones: # Replace with the desired hosted zones
- "ZG5zLm5ldHdvcmtfdmlldyQw"
source:
type: Service
fqdnTemplate:
- '{{.Name}}.mydomain.net'
```

Once this is created the _external-dns-operator_ will create a deployment of _external-dns_ which is configured to
Expand Down Expand Up @@ -182,6 +190,10 @@ spec:
project: gcp-devel
zones: # Replace with the desired managed zones
- "3651032588905568971"
source:
type: Service
fqdnTemplate:
- '{{.Name}}.mydomain.net'
```

# Azure
Expand Down Expand Up @@ -228,4 +240,8 @@ spec:
name: azure-config-file
zones: # Replace with the desired hosted zones
- "myzoneid"
source:
type: Service
fqdnTemplate:
- '{{.Name}}.mydomain.net'
```
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ require (
github.com/go-logr/logr v0.4.0
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/google/go-cmp v0.5.6
github.com/infobloxopen/infoblox-go-client v1.1.1
github.com/miekg/dns v1.0.14
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.15.0
github.com/openshift/api v0.0.0-20211019100638-b2cbe79f2e4b
github.com/openshift/cloud-credential-operator v0.0.0-20211118210017-9066dcc747fa
github.com/operator-framework/api v0.11.0
golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b // indirect
google.golang.org/api v0.58.0
k8s.io/api v0.22.1
Expand All @@ -23,5 +25,5 @@ require (
k8s.io/utils v0.0.0-20210802155522-efc7438f0176
sigs.k8s.io/controller-runtime v0.10.0
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20211004203041-b1efff64d3d2
sigs.k8s.io/controller-tools v0.6.0
sigs.k8s.io/controller-tools v0.6.2
)
73 changes: 55 additions & 18 deletions go.sum

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions test/e2e/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ type awsTestHelper struct {
secretKey string
}

var _ providerTestHelper = &awsTestHelper{}

func newAWSHelper(isOpenShiftCI bool, kubeClient client.Client) (providerTestHelper, error) {
provider := &awsTestHelper{}
if err := provider.prepareConfigurations(isOpenShiftCI, kubeClient); err != nil {
Expand Down Expand Up @@ -70,7 +68,7 @@ func (a *awsTestHelper) buildExternalDNS(name, zoneID, zoneDomain string, credsS
return resource
}

func (a *awsTestHelper) buildOpenShiftExternalDNS(name, zoneID, zoneDomain, routerName string) operatorv1alpha1.ExternalDNS {
func (a *awsTestHelper) buildOpenShiftExternalDNS(name, zoneID, zoneDomain, routerName string, _ *corev1.Secret) operatorv1alpha1.ExternalDNS {
resource := routeExternalDNS(name, zoneID, zoneDomain, routerName)
resource.Spec.Provider = operatorv1alpha1.ExternalDNSProvider{
Type: operatorv1alpha1.ProviderTypeAWS,
Expand Down
4 changes: 1 addition & 3 deletions test/e2e/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ type azureTestHelper struct {
zoneClient dns.ZonesClient
}

var _ providerTestHelper = &azureTestHelper{}

// Build the necessary object for the provider test
// for Azure Need the credentials ref clusterConfig
func newAzureHelper(kubeClient client.Client) (providerTestHelper, error) {
Expand Down Expand Up @@ -144,7 +142,7 @@ func (a *azureTestHelper) buildExternalDNS(name, zoneID, zoneDomain string, cred
return resource
}

func (a *azureTestHelper) buildOpenShiftExternalDNS(name, zoneID, zoneDomain, routerName string) operatorv1alpha1.ExternalDNS {
func (a *azureTestHelper) buildOpenShiftExternalDNS(name, zoneID, zoneDomain, routerName string, _ *corev1.Secret) operatorv1alpha1.ExternalDNS {
resource := routeExternalDNS(name, zoneID, zoneDomain, routerName)
resource.Spec.Provider = operatorv1alpha1.ExternalDNSProvider{
Type: operatorv1alpha1.ProviderTypeAzure,
Expand Down
4 changes: 1 addition & 3 deletions test/e2e/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ type gcpTestHelper struct {
gcpProjectId string
}

var _ providerTestHelper = &gcpTestHelper{}

func newGCPHelper(isOpenShiftCI bool, kubeClient client.Client) (providerTestHelper, error) {
provider := &gcpTestHelper{}
err := provider.prepareConfigurations(isOpenShiftCI, kubeClient)
Expand Down Expand Up @@ -58,7 +56,7 @@ func (g *gcpTestHelper) buildExternalDNS(name, zoneID, zoneDomain string, credsS
return resource
}

func (g *gcpTestHelper) buildOpenShiftExternalDNS(name, zoneID, zoneDomain, routerName string) operatorv1alpha1.ExternalDNS {
func (g *gcpTestHelper) buildOpenShiftExternalDNS(name, zoneID, zoneDomain, routerName string, _ *corev1.Secret) operatorv1alpha1.ExternalDNS {
resource := routeExternalDNS(name, zoneID, zoneDomain, routerName)
resource.Spec.Provider = operatorv1alpha1.ExternalDNSProvider{
Type: operatorv1alpha1.ProviderTypeGCP,
Expand Down
Loading