Skip to content

Commit

Permalink
Add metal3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
honza committed Jul 25, 2024
1 parent df328e8 commit 8d95a47
Show file tree
Hide file tree
Showing 84 changed files with 11,933 additions and 4 deletions.
5 changes: 5 additions & 0 deletions cmd/cluster-capi-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"os"
"time"

metal3v1 "github.com/metal3-io/cluster-api-provider-metal3/api/v1beta1"
"github.com/spf13/pflag"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
Expand Down Expand Up @@ -79,6 +80,7 @@ func initScheme(scheme *runtime.Scheme) {
utilruntime.Must(clusterctlv1.AddToScheme(scheme))
utilruntime.Must(ibmpowervsv1.AddToScheme(scheme))
utilruntime.Must(vspherev1.AddToScheme(scheme))
utilruntime.Must(metal3v1.AddToScheme(scheme))
}

//nolint:funlen
Expand Down Expand Up @@ -230,6 +232,9 @@ func main() {
case configv1.OpenStackPlatformType:
setupReconcilers(mgr, infra, platform, &openstackv1.OpenStackCluster{}, containerImages, applyClient, apiextensionsClient, *managedNamespace)
setupWebhooks(mgr)
case configv1.BareMetalPlatformType:
setupReconcilers(mgr, infra, platform, &metal3v1.Metal3Cluster{}, containerImages, applyClient, apiextensionsClient, *managedNamespace)
setupWebhooks(mgr)
default:
klog.Infof("detected platform %q is not supported, skipping capi controllers setup", platform)

Expand Down
2 changes: 2 additions & 0 deletions e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"testing"

metal3v1 "github.com/metal3-io/cluster-api-provider-metal3/api/v1beta1"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
Expand Down Expand Up @@ -42,6 +43,7 @@ func init() {
utilruntime.Must(mapiv1.AddToScheme(scheme.Scheme))
utilruntime.Must(ibmpowervsv1.AddToScheme(scheme.Scheme))
utilruntime.Must(vspherev1.AddToScheme(scheme.Scheme))
utilruntime.Must(metal3v1.AddToScheme(scheme.Scheme))
}

func TestAPIs(t *testing.T) {
Expand Down
2 changes: 2 additions & 0 deletions e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.21
require (
github.com/aws/aws-sdk-go v1.51.17
github.com/google/go-cmp v0.6.0
github.com/metal3-io/cluster-api-provider-metal3/api v1.7.0
github.com/onsi/ginkgo/v2 v2.19.0
github.com/onsi/gomega v1.33.1
github.com/openshift/api v0.0.0-20220921125526-1866ef90edbf
Expand Down Expand Up @@ -59,6 +60,7 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/metal3-io/ip-address-manager/api v1.7.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
Expand Down
4 changes: 4 additions & 0 deletions e2e/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/metal3-io/cluster-api-provider-metal3/api v1.7.0 h1:9ALpFlMFacUTCZVChphg49xU/urSB+vvlAlxuICWLqU=
github.com/metal3-io/cluster-api-provider-metal3/api v1.7.0/go.mod h1:c0M3xS4zQxJpHDVNEb53wLdbYa0/kuWJHw6d9a9CjGQ=
github.com/metal3-io/ip-address-manager/api v1.7.0 h1:ie9SQPWDWTjBnnxnG+qSfoqIOs+4vp5k0tVI+/0HNGo=
github.com/metal3-io/ip-address-manager/api v1.7.0/go.mod h1:6q41s9Y1P1lGSlMxMwRbIFzfy/XBRX4stvugGx1Jp5o=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
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

0 comments on commit 8d95a47

Please sign in to comment.