-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds conformance tests for the Equinix Metal Provider
Signed-off-by: Marques Johansson <[email protected]>
- Loading branch information
Showing
5 changed files
with
183 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
vendor: Equinix | ||
name: Crossplane Provider Equinix Metal | ||
version: v0.0.9 | ||
website_url: https://github.com/crossplane-contrib/provider-equinix-metal | ||
repo_url: https://github.com/crossplane-contrib/provider-equinix-metal | ||
documentation_url: https://github.com/crossplane-contrib/provider-equinix-metal#crossplane-provider-equinix-metal | ||
type: provider | ||
description: "A Crossplane provider that enables deployment and management of infrastructure resources on Equinix Metal" |
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,86 @@ | ||
# Crossplane Provider Equinix Metal v0.0.9 Conformance Results | ||
|
||
The following steps can be undertaken to obtain the provided conformance results: | ||
|
||
1. Create Kubernetes Cluster | ||
|
||
``` | ||
kind create cluster --name crossplane-conformance --image kindest/node:v1.19.11 | ||
``` | ||
|
||
2. Install Crossplane version 1.2.2 | ||
|
||
``` | ||
kubectl create namespace crossplane-system | ||
helm repo add crossplane-stable https://charts.crossplane.io/stable | ||
helm repo update | ||
helm install crossplane --namespace crossplane-system crossplane-stable/crossplane --version 1.2.2 | ||
``` | ||
|
||
3. Deploy provider-equinix-metal version v0.0.9 | ||
|
||
``` | ||
kubectl crossplane install provider registry.upbound.io/equinix/provider-equinix-metal:v0.0.9 | ||
``` | ||
|
||
|
||
4. Create Equinix Metal ProviderConfig resource | ||
|
||
``` | ||
cat > /tmp/providerconfig.yaml <<EOF | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: example-provider-equinix-metal | ||
namespace: crossplane-system | ||
type: Opaque | ||
data: | ||
credentials: ${BASE64ENCODED_METAL_PROVIDER_CREDS} | ||
--- | ||
apiVersion: metal.equinix.com/v1beta1 | ||
kind: ProviderConfig | ||
metadata: | ||
name: equinix-metal-provider | ||
spec: | ||
credentials: | ||
source: Secret | ||
secretRef: | ||
name: example-provider-equinix-metal | ||
namespace: crossplane-system | ||
key: credentials | ||
EOF | ||
kubectl apply -f "/tmp/providerconfig.yaml" | ||
``` | ||
|
||
5. Create composition definitions | ||
|
||
``` | ||
kubectl apply -f composition | ||
``` | ||
|
||
5. Create composite resource | ||
|
||
``` | ||
kubectl apply -f resources/conformancetest.yaml | ||
``` | ||
|
||
6. Run Crossplane Conformance Suite | ||
|
||
``` | ||
xp_version=1.2 | ||
sonobuoy run --plugin "https://raw.githubusercontent.com/crossplane/conformance/release-${xp_version}/plugin-provider.yaml" | ||
``` | ||
|
||
8. Check status/logs | ||
|
||
``` | ||
sonobuoy status | ||
sonobuoy logs | ||
``` | ||
|
||
7. Cleanup | ||
|
||
``` | ||
kubectl delete -f resources | ||
``` |
55 changes: 55 additions & 0 deletions
55
v1.2/provider/provider-equinix-metal/composition/composition.yaml
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,55 @@ | ||
apiVersion: apiextensions.crossplane.io/v1 | ||
kind: Composition | ||
metadata: | ||
name: conformancetest.metal.equinix.com | ||
spec: | ||
writeConnectionSecretsToNamespace: crossplane-system | ||
compositeTypeRef: | ||
apiVersion: metal.equinix.com/v1alpha1 | ||
kind: Conformancetest | ||
resources: | ||
- base: | ||
apiVersion: server.metal.equinix.com/v1alpha2 | ||
kind: Device | ||
spec: | ||
forProvider: | ||
hostname: crossplane-conformance | ||
plan: c3.small.x86 | ||
operatingSystem: ubuntu_20_04 | ||
billingCycle: hourly | ||
locked: false | ||
networkType: hybrid | ||
tags: | ||
- crossplane | ||
providerConfigRef: | ||
name: equinix-metal-provider | ||
writeConnectionSecretToRef: | ||
name: crossplane-conformance | ||
namespace: crossplane-system | ||
reclaimPolicy: Delete | ||
patches: | ||
- fromFieldPath: spec.metro | ||
toFieldPath: spec.forProvider.metro | ||
- base: | ||
apiVersion: vlan.metal.equinix.com/v1alpha1 | ||
kind: VirtualNetwork | ||
spec: | ||
forProvider: | ||
description: conformance provisioned VLAN | ||
providerConfigRef: | ||
name: equinix-metal-provider | ||
patches: | ||
- fromFieldPath: spec.metro | ||
toFieldPath: spec.forProvider.metro | ||
- base: | ||
apiVersion: ports.metal.equinix.com/v1alpha1 | ||
kind: Assignment | ||
spec: | ||
forProvider: | ||
deviceIdSelector: | ||
matchControllerRef: true | ||
virtualNetworkIdSelector: | ||
matchControllerRef: true | ||
name: eth1 | ||
providerConfigRef: | ||
name: equinix-metal-provider |
28 changes: 28 additions & 0 deletions
28
v1.2/provider/provider-equinix-metal/composition/definition.yaml
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,28 @@ | ||
apiVersion: apiextensions.crossplane.io/v1 | ||
kind: CompositeResourceDefinition | ||
metadata: | ||
name: conformancetests.metal.equinix.com | ||
spec: | ||
group: metal.equinix.com | ||
names: | ||
kind: Conformancetest | ||
listKind: ConformancetestList | ||
plural: conformancetests | ||
singular: conformancetest | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
referenceable: true | ||
schema: | ||
openAPIV3Schema: | ||
description: Managed resources for provider-equinix-metal crossplane conformance | ||
type: object | ||
properties: | ||
spec: | ||
type: object | ||
properties: | ||
metro: | ||
type: string | ||
description: metro | ||
required: | ||
- metro |
6 changes: 6 additions & 0 deletions
6
v1.2/provider/provider-equinix-metal/resources/conformancetest.yaml
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,6 @@ | ||
apiVersion: metal.equinix.com/v1alpha1 | ||
kind: Conformancetest | ||
metadata: | ||
name: conformancetest1 | ||
spec: | ||
metro: sv |