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 VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.0.1-dev
v1.0.2
4 changes: 2 additions & 2 deletions charts/project-workspace-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: project-workspace-operator
description: A Helm chart for the project-workspace-operator
type: application
version: v1.0.1
appVersion: v1.0.1
version: v1.0.2
appVersion: v1.0.2
2 changes: 1 addition & 1 deletion charts/project-workspace-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ image:
repository: ghcr.io/openmcp-project/images/project-workspace-operator
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: v1.0.1
tag: v1.0.2

imagePullSecrets: []
nameOverride: ""
Expand Down
38 changes: 23 additions & 15 deletions cmd/project-workspace-operator/app/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ import (
"os"
"time"

"github.com/spf13/cobra"
rbacv1 "k8s.io/api/rbac/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"

ctrlutils "github.com/openmcp-project/controller-utils/pkg/controller"
crdutil "github.com/openmcp-project/controller-utils/pkg/crds"
"github.com/openmcp-project/controller-utils/pkg/init/webhooks"
Expand All @@ -21,6 +14,12 @@ import (
openmcpconst "github.com/openmcp-project/openmcp-operator/api/constants"
"github.com/openmcp-project/openmcp-operator/lib/clusteraccess"
libutils "github.com/openmcp-project/openmcp-operator/lib/utils"
"github.com/spf13/cobra"
rbacv1 "k8s.io/api/rbac/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"

pwv1alpha1 "github.com/openmcp-project/project-workspace-operator/api/core/v1alpha1"
"github.com/openmcp-project/project-workspace-operator/api/crds"
Expand Down Expand Up @@ -237,6 +236,19 @@ func (o *InitOptions) Run(ctx context.Context) error {
opts = append(opts, webhooks.WithCustomCA{todo})
*/

webhookTypes := []webhooks.APITypes{
{
Obj: &pwv1alpha1.Project{},
Validator: true,
Defaulter: true,
},
{
Obj: &pwv1alpha1.Workspace{},
Validator: true,
Defaulter: true,
},
}

if !pwc.Spec.Webhook.Disabled {
log.Info("Webhooks are enabled, ensuring required resources ...")

Expand All @@ -245,15 +257,14 @@ func (o *InitOptions) Run(ctx context.Context) error {
return fmt.Errorf("unable to generate webhook certificate: %w", err)
}

// Compile-time checks to ensure Project implements the required interfaces

// Install webhooks
err := webhooks.Install(
ctx,
o.PlatformCluster.Client(),
onboardingScheme,
[]client.Object{
&pwv1alpha1.Project{},
&pwv1alpha1.Workspace{},
},
webhookTypes,
installOpts...,
)
if err != nil {
Expand All @@ -267,10 +278,7 @@ func (o *InitOptions) Run(ctx context.Context) error {
ctx,
o.PlatformCluster.Client(),
onboardingScheme,
[]client.Object{
&pwv1alpha1.Project{},
&pwv1alpha1.Workspace{},
},
webhookTypes,
installOpts...,
)
if err != nil {
Expand Down
18 changes: 14 additions & 4 deletions cmd/project-workspace-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,25 @@ func (o *Options) runInit() {
installOptions := o.WebhooksFlags.InstallOptions
installOptions = append(installOptions, webhooks.WithRemoteClient{Client: crateClient})

webhookTypes := []webhooks.APITypes{
{
Obj: &pwv1alpha1.Project{},
Validator: true,
Defaulter: true,
},
{
Obj: &pwv1alpha1.Workspace{},
Validator: true,
Defaulter: true,
},
}

// Install webhooks
err := webhooks.Install(
initContext,
setupClient,
scheme,
[]client.Object{
&pwv1alpha1.Project{},
&pwv1alpha1.Workspace{},
},
webhookTypes,
installOptions...,
)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ require (
github.com/go-logr/logr v1.4.3
github.com/onsi/ginkgo/v2 v2.27.2
github.com/onsi/gomega v1.38.2
github.com/openmcp-project/controller-utils v0.23.4
github.com/openmcp-project/project-workspace-operator/api v1.0.1
github.com/openmcp-project/controller-utils v0.24.0
github.com/openmcp-project/project-workspace-operator/api v1.0.2
github.com/stretchr/testify v1.11.1
k8s.io/api v0.34.1
k8s.io/apimachinery v0.34.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns
github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A=
github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k=
github.com/openmcp-project/controller-utils v0.23.4 h1:GUPa0tP0kccp5/DheQR9vWfPChEK37KwTpbFHVDQBhc=
github.com/openmcp-project/controller-utils v0.23.4/go.mod h1:zGsvEJ7P+BjRnDQMVreCOp4Lsx5xpFQ36gm2fcVw34w=
github.com/openmcp-project/controller-utils v0.24.0 h1:r8mtA9JEb2GXgH4H60FR/jbe0h4/ZbYnAeHmacMsb0g=
github.com/openmcp-project/controller-utils v0.24.0/go.mod h1:BjMecTCwaSewG7KV0H4P5Y/MeFzI07DGXQstp/dtF7s=
github.com/openmcp-project/openmcp-operator/api v0.17.0 h1:dhRbaGawtRx6Kd4oUbw5gSBnukEsS0xH29aTRjWIevY=
github.com/openmcp-project/openmcp-operator/api v0.17.0/go.mod h1:xW9QjFThR4xntEyfhgGuJ5oRYY4mzoWOoZBjHjBBjPQ=
github.com/openmcp-project/openmcp-operator/lib v0.17.0 h1:42yGu/1LoEd51/noWgr7Bmz33rfHjTm/HKKXlJjHif4=
Expand Down
Loading