Skip to content
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
2 changes: 1 addition & 1 deletion api/crds/manifests/openmcp.cloud_clusterproviders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
metadata:
type: object
spec:
description: DeploymentSpec defines the desired state of a provider.
description: ClusterProviderSpec defines the desired state of ClusterProvider.
properties:
image:
description: Image is the name of the image of a provider.
Expand Down
2 changes: 1 addition & 1 deletion api/crds/manifests/openmcp.cloud_platformservices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
metadata:
type: object
spec:
description: DeploymentSpec defines the desired state of a provider.
description: PlatformServiceSpec defines the desired state of PlatformService.
properties:
image:
description: Image is the name of the image of a provider.
Expand Down
2 changes: 1 addition & 1 deletion api/crds/manifests/openmcp.cloud_serviceproviders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
metadata:
type: object
spec:
description: DeploymentSpec defines the desired state of a provider.
description: ServiceProviderSpec defines the desired state of ServiceProvider.
properties:
image:
description: Image is the name of the image of a provider.
Expand Down
10 changes: 3 additions & 7 deletions api/provider/v1alpha1/clusterprovider_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ import (

// ClusterProviderSpec defines the desired state of ClusterProvider.
type ClusterProviderSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

// Foo is an example field of ClusterProvider. Edit clusterprovider_types.go to remove/update
Foo string `json:"foo,omitempty"`
DeploymentSpec `json:",inline"`
}

// ClusterProviderStatus defines the observed state of ClusterProvider.
Expand All @@ -48,8 +44,8 @@ type ClusterProviderStatus struct {
type ClusterProvider struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec DeploymentSpec `json:"spec,omitempty"`
Status DeploymentStatus `json:"status,omitempty"`
Spec ClusterProviderSpec `json:"spec,omitempty"`
Status DeploymentStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
10 changes: 3 additions & 7 deletions api/provider/v1alpha1/platformservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ import (

// PlatformServiceSpec defines the desired state of PlatformService.
type PlatformServiceSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

// Foo is an example field of PlatformService. Edit platformservice_types.go to remove/update
Foo string `json:"foo,omitempty"`
DeploymentSpec `json:",inline"`
}

// PlatformServiceStatus defines the observed state of PlatformService.
Expand All @@ -48,8 +44,8 @@ type PlatformServiceStatus struct {
type PlatformService struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec DeploymentSpec `json:"spec,omitempty"`
Status DeploymentStatus `json:"status,omitempty"`
Spec PlatformServiceSpec `json:"spec,omitempty"`
Status DeploymentStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
10 changes: 3 additions & 7 deletions api/provider/v1alpha1/serviceprovider_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ import (

// ServiceProviderSpec defines the desired state of ServiceProvider.
type ServiceProviderSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

// Foo is an example field of ServiceProvider. Edit serviceprovider_types.go to remove/update
Foo string `json:"foo,omitempty"`
DeploymentSpec `json:",inline"`
}

// ServiceProviderStatus defines the observed state of ServiceProvider.
Expand All @@ -48,8 +44,8 @@ type ServiceProviderStatus struct {
type ServiceProvider struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec DeploymentSpec `json:"spec,omitempty"`
Status DeploymentStatus `json:"status,omitempty"`
Spec ServiceProviderSpec `json:"spec,omitempty"`
Status DeploymentStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
3 changes: 3 additions & 0 deletions api/provider/v1alpha1/zz_generated.deepcopy.go

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

18 changes: 16 additions & 2 deletions cmd/openmcp-operator/app/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ import (
"crypto/tls"
"fmt"
"path/filepath"
"slices"
"strings"

"github.com/openmcp-project/controller-utils/pkg/logging"

"github.com/spf13/cobra"

"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/tools/clientcmd/api"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/certwatcher"
"sigs.k8s.io/controller-runtime/pkg/healthz"
Expand All @@ -22,6 +25,7 @@ import (

"github.com/openmcp-project/openmcp-operator/api/install"
"github.com/openmcp-project/openmcp-operator/api/provider/v1alpha1"
"github.com/openmcp-project/openmcp-operator/internal/controllers/provider"
)

var setupLog logging.Logger
Expand Down Expand Up @@ -287,6 +291,16 @@ func (o *RunOptions) Run(ctx context.Context) error {
// }
// }

// setup deployment controller
if slices.Contains(o.Controllers, strings.ToLower("deploymentcontroller")) {
utilruntime.Must(clientgoscheme.AddToScheme(mgr.GetScheme()))
utilruntime.Must(api.AddToScheme(mgr.GetScheme()))

if err = provider.NewDeploymentController().SetupWithManager(mgr, o.ProviderGVKList); err != nil {
return fmt.Errorf("unable to setup provider controllers: %w", err)
}
}

if o.MetricsCertWatcher != nil {
setupLog.Info("Adding metrics certificate watcher to manager")
if err := mgr.Add(o.MetricsCertWatcher); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ require (
k8s.io/api v0.33.0
k8s.io/apiextensions-apiserver v0.33.0
k8s.io/apimachinery v0.33.0
k8s.io/client-go v0.33.0
k8s.io/utils v0.0.0-20250502105355-0f33e8f1c979
sigs.k8s.io/controller-runtime v0.20.4
sigs.k8s.io/yaml v1.4.0
)
Expand Down Expand Up @@ -93,11 +95,9 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiserver v0.33.0 // indirect
k8s.io/client-go v0.33.0 // indirect
k8s.io/component-base v0.33.0 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
k8s.io/utils v0.0.0-20250502105355-0f33e8f1c979 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect
sigs.k8s.io/gateway-api v1.3.0 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
Expand Down
Loading