Skip to content
Closed
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Ensure presence of expected number of replicas and a given provider config for a

- [cluster-api-provider-ovirt](https://github.com/openshift/cluster-api-provider-ovirt)

- [cluster-api-provider-equinix-metal](https://github.com/openshift/cluster-api-provider-equinix-metal)

Ensure that a provider instance is created for a Machine object in a given provider.

- Node link Controller
Expand Down
2 changes: 2 additions & 0 deletions docs/dev/hacking-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Machine API consists of a number different components:
- https://github.com/openshift/cluster-api-provider-openstack
- https://github.com/openshift/cluster-api-provider-baremetal
- https://github.com/openshift/cluster-api-provider-ovirt
- https://github.com/openshift/cluster-api-provider-equinix-metal

### How to start contributing

Expand Down Expand Up @@ -156,6 +157,7 @@ data:
"clusterAPIControllerGCP": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:...",
"clusterAPIControllerOvirt": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:...",
"clusterAPIControllerVSphere": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:...",
"clusterAPIControllerEquinixMetal": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:...",
"baremetalOperator": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:...",
"baremetalIronic": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:...",
"baremetalIronicInspector": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:...",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/google/uuid v1.1.2
github.com/onsi/ginkgo v1.14.1
github.com/onsi/gomega v1.10.2
github.com/openshift/api v0.0.0-20201216151826-78a19e96f9eb
github.com/openshift/api v0.0.0-20210225162315-bae60f47eed7
github.com/openshift/client-go v0.0.0-20201214125552-e615e336eb49
github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20201201000827-1117a4fc438c
github.com/openshift/library-go v0.0.0-20201215165635-4ee79b1caed5
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,9 @@ github.com/openshift/api v0.0.0-20200424083944-0422dc17083e/go.mod h1:VnbEzX8SAa
github.com/openshift/api v0.0.0-20200827090112-c05698d102cf/go.mod h1:M3xexPhgM8DISzzRpuFUy+jfPjQPIcs9yqEYj17mXV8=
github.com/openshift/api v0.0.0-20200901182017-7ac89ba6b971/go.mod h1:M3xexPhgM8DISzzRpuFUy+jfPjQPIcs9yqEYj17mXV8=
github.com/openshift/api v0.0.0-20201214114959-164a2fb63b5f/go.mod h1:aqU5Cq+kqKKPbDMqxo9FojgDeSpNJI7iuskjXjtojDg=
github.com/openshift/api v0.0.0-20201216151826-78a19e96f9eb h1:/2U2gRTwhhDLBUUfC9+5YPFFOeQ93VKq9EbZH2OPOXE=
github.com/openshift/api v0.0.0-20201216151826-78a19e96f9eb/go.mod h1:aqU5Cq+kqKKPbDMqxo9FojgDeSpNJI7iuskjXjtojDg=
github.com/openshift/api v0.0.0-20210225162315-bae60f47eed7 h1:RvBqGKZN2FVrnXR0MzOaFdsveCyq/DOLTJrwqpKa8e0=
github.com/openshift/api v0.0.0-20210225162315-bae60f47eed7/go.mod h1:aqU5Cq+kqKKPbDMqxo9FojgDeSpNJI7iuskjXjtojDg=
github.com/openshift/build-machinery-go v0.0.0-20200211121458-5e3d6e570160/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc=
github.com/openshift/build-machinery-go v0.0.0-20200424080330-082bf86082cc/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc=
github.com/openshift/build-machinery-go v0.0.0-20200819073603-48aa266c95f7/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE=
Expand Down
16 changes: 16 additions & 0 deletions install/0000_30_machine-api-operator_00_credentials-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,19 @@ spec:
providerSpec:
apiVersion: cloudcredential.openshift.io/v1
kind: KubevirtProviderSpec
---
apiVersion: cloudcredential.openshift.io/v1
kind: CredentialsRequest
metadata:
labels:
controller-tools.k8s.io: "1.0"
name: openshift-machine-api-equinix-metal
namespace: openshift-cloud-credential-operator
spec:
secretRef:
name: equinix-metal-credentials
namespace: openshift-machine-api
providerSpec:
apiVersion: cloudcredential.openshift.io/v1
kind: EquinixMetalProviderSpec
---
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ data:
"clusterAPIControllerGCP": "registry.svc.ci.openshift.org/openshift:gcp-machine-controllers",
"clusterAPIControllerOvirt": "registry.svc.ci.openshift.org/openshift:ovirt-machine-controllers",
"clusterAPIControllerKubevirt": "registry.svc.ci.openshift.org/openshift:kubevirt-machine-controllers",
"clusterAPIControllerEquinixMetal": "registry.svc.ci.openshift.org/openshift:equinix-metal-machine-controllers",
"clusterAPIControllerVSphere": "registry.svc.ci.openshift.org/openshift:machine-api-operator"
}
4 changes: 4 additions & 0 deletions install/image-references
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ spec:
from:
kind: DockerImage
name: registry.svc.ci.openshift.org/openshift:kubevirt-machine-controllers
- name: equinix-metal-machine-controllers
from:
kind: DockerImage
name: registry.svc.ci.openshift.org/openshift:equinix-metal-machine-controllers
25 changes: 14 additions & 11 deletions pkg/operator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,18 @@ type Controllers struct {

// Images allows build systems to inject images for MAO components
type Images struct {
MachineAPIOperator string `json:"machineAPIOperator"`
ClusterAPIControllerAWS string `json:"clusterAPIControllerAWS"`
ClusterAPIControllerOpenStack string `json:"clusterAPIControllerOpenStack"`
ClusterAPIControllerLibvirt string `json:"clusterAPIControllerLibvirt"`
ClusterAPIControllerBareMetal string `json:"clusterAPIControllerBareMetal"`
ClusterAPIControllerAzure string `json:"clusterAPIControllerAzure"`
ClusterAPIControllerGCP string `json:"clusterAPIControllerGCP"`
ClusterAPIControllerOvirt string `json:"clusterAPIControllerOvirt"`
ClusterAPIControllerVSphere string `json:"clusterAPIControllerVSphere"`
ClusterAPIControllerKubevirt string `json:"clusterAPIControllerKubevirt"`
KubeRBACProxy string `json:"kubeRBACProxy"`
MachineAPIOperator string `json:"machineAPIOperator"`
ClusterAPIControllerAWS string `json:"clusterAPIControllerAWS"`
ClusterAPIControllerOpenStack string `json:"clusterAPIControllerOpenStack"`
ClusterAPIControllerLibvirt string `json:"clusterAPIControllerLibvirt"`
ClusterAPIControllerBareMetal string `json:"clusterAPIControllerBareMetal"`
ClusterAPIControllerAzure string `json:"clusterAPIControllerAzure"`
ClusterAPIControllerGCP string `json:"clusterAPIControllerGCP"`
ClusterAPIControllerOvirt string `json:"clusterAPIControllerOvirt"`
ClusterAPIControllerVSphere string `json:"clusterAPIControllerVSphere"`
ClusterAPIControllerKubevirt string `json:"clusterAPIControllerKubevirt"`
ClusterAPIControllerEquinixMetal string `json:"clusterAPIControllerEquinixMetal"`
KubeRBACProxy string `json:"kubeRBACProxy"`
}

func getProviderFromInfrastructure(infra *configv1.Infrastructure) (configv1.PlatformType, error) {
Expand Down Expand Up @@ -91,6 +92,8 @@ func getProviderControllerFromImages(platform configv1.PlatformType, images Imag
return images.ClusterAPIControllerKubevirt, nil
case kubemarkPlatform:
return clusterAPIControllerKubemark, nil
case configv1.EquinixMetalPlatformType:
return images.ClusterAPIControllerEquinixMetal, nil
default:
return clusterAPIControllerNoOp, nil
}
Expand Down
19 changes: 19 additions & 0 deletions pkg/operator/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var (
expectedOvirtImage = "quay.io/openshift/origin-ovirt-machine-controllers"
expectedVSphereImage = "docker.io/openshift/origin-machine-api-operator:v4.0.0"
expectedKubevirtImage = "quay.io/openshift/origin-kubevirt-machine-controllers"
expectedEquinixMetalImage = "quay.io/openshift/origin-equinix-metal-machine-controllers"
)

func TestGetProviderFromInfrastructure(t *testing.T) {
Expand Down Expand Up @@ -95,6 +96,13 @@ func TestGetProviderFromInfrastructure(t *testing.T) {
},
},
expected: configv1.OvirtPlatformType,
}, {
infra: &configv1.Infrastructure{
Status: configv1.InfrastructureStatus{
Platform: configv1.EquinixMetalPlatformType,
},
},
expected: configv1.EquinixMetalPlatformType,
}}

for _, test := range tests {
Expand Down Expand Up @@ -140,6 +148,9 @@ func TestGetImagesFromJSONFile(t *testing.T) {
if img.ClusterAPIControllerKubevirt != expectedKubevirtImage {
t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedKubevirtImage, img.ClusterAPIControllerKubevirt)
}
if img.ClusterAPIControllerEquinixMetal != expectedEquinixMetalImage {
t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedEquinixMetalImage, img.ClusterAPIControllerEquinixMetal)
}
}

func TestGetProviderControllerFromImages(t *testing.T) {
Expand Down Expand Up @@ -190,6 +201,10 @@ func TestGetProviderControllerFromImages(t *testing.T) {
provider: configv1.KubevirtPlatformType,
expectedImage: expectedKubevirtImage,
},
{
provider: configv1.EquinixMetalPlatformType,
expectedImage: expectedEquinixMetalImage,
},
}

img, err := getImagesFromJSONFile(imagesJSONFile)
Expand Down Expand Up @@ -252,6 +267,10 @@ func TestGetTerminationHandlerFromImages(t *testing.T) {
provider: configv1.OvirtPlatformType,
expectedImage: clusterAPIControllerNoOp,
},
{
provider: configv1.EquinixMetalPlatformType,
expectedImage: clusterAPIControllerNoOp,
},
}

img, err := getImagesFromJSONFile(imagesJSONFile)
Expand Down
1 change: 1 addition & 0 deletions pkg/operator/fixtures/images.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"clusterAPIControllerAzure": "quay.io/openshift/origin-azure-machine-controllers:v4.0.0",
"clusterAPIControllerGCP": "quay.io/openshift/origin-gcp-machine-controllers:v4.0.0",
"clusterAPIControllerOvirt": "quay.io/openshift/origin-ovirt-machine-controllers",
"clusterAPIControllerEquinixMetal": "quay.io/openshift/origin-equinix-metal-machine-controllers",
"clusterAPIControllerVSphere": "docker.io/openshift/origin-machine-api-operator:v4.0.0",
"clusterAPIControllerKubevirt": "quay.io/openshift/origin-kubevirt-machine-controllers",
"kubeRBACProxy": "docker.io/openshift/origin-kube-rbac-proxy:v4.0.0"
Expand Down
22 changes: 22 additions & 0 deletions pkg/operator/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ func TestOperatorSync_NoOp(t *testing.T) {
platform: openshiftv1.OvirtPlatformType,
expectedNoop: false,
},
{
platform: openshiftv1.EquinixMetalPlatformType,
expectedNoop: false,
},
{
platform: openshiftv1.NonePlatformType,
expectedNoop: true,
Expand Down Expand Up @@ -454,6 +458,24 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
},
},
},
{
name: string(openshiftv1.EquinixMetalPlatformType),
platform: openshiftv1.EquinixMetalPlatformType,
infra: infra,
proxy: proxy,
expectedConfig: &OperatorConfig{
TargetNamespace: targetNamespace,
Proxy: proxy,
Controllers: Controllers{
Provider: images.ClusterAPIControllerEquinixMetal,
MachineSet: images.MachineAPIOperator,
NodeLink: images.MachineAPIOperator,
MachineHealthCheck: images.MachineAPIOperator,
TerminationHandler: clusterAPIControllerNoOp,
KubeRBACProxy: images.KubeRBACProxy,
},
},
},
{
name: string(openshiftv1.NonePlatformType),
platform: openshiftv1.NonePlatformType,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading