Skip to content

Commit e1c4250

Browse files
maromcohenTalDebi
authored andcommitted
fix: refactor functions, add cert-manager yamls
Signed-off-by: TalDebi <[email protected]>
1 parent 6916cb1 commit e1c4250

25 files changed

+1449
-974
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.24.1 as builder
2+
FROM golang:1.24.6 as builder
33

44
WORKDIR /workspace
55
# Copy the Go Modules manifests

PROJECT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ resources:
2828
- api:
2929
crdVersion: v1
3030
namespaced: true
31-
domain: rcs.dana.io
31+
domain: dana.io
3232
group: rcs
3333
kind: CappConfig
3434
path: github.com/dana-team/container-app-operator/api/rcs/v1alpha1

api/rcs/v1alpha1/cappconfig_types.go

Lines changed: 0 additions & 64 deletions
This file was deleted.

api/rcs/v1alpha1/groupversion_info.go

Lines changed: 0 additions & 36 deletions
This file was deleted.

api/rcs/v1alpha1/zz_generated.deepcopy.go

Lines changed: 0 additions & 114 deletions
This file was deleted.

cmd/main.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ import (
2121
"flag"
2222
"os"
2323

24+
"sigs.k8s.io/controller-runtime/pkg/webhook"
25+
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
26+
2427
cmapi "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1"
2528

2629
dnsrecordv1alpha1 "github.com/dana-team/provider-dns/apis/record/v1alpha1"
2730

31+
cappv1alpha1 "github.com/dana-team/container-app-operator/api/v1alpha1"
2832
nfspvcv1alpha1 "github.com/dana-team/nfspvc-operator/api/v1alpha1"
2933
"github.com/go-logr/zapr"
3034
loggingv1beta1 "github.com/kube-logging/logging-operator/pkg/sdk/logging/api/v1beta1"
@@ -44,12 +48,10 @@ import (
4448
"sigs.k8s.io/controller-runtime/pkg/metrics/filters"
4549
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
4650

47-
rcsv1alpha1 "github.com/dana-team/container-app-operator/api/rcs/v1alpha1"
48-
cappv1alpha1 "github.com/dana-team/container-app-operator/api/v1alpha1"
4951
cappcontroller "github.com/dana-team/container-app-operator/internal/kinds/capp/controllers"
5052
"github.com/dana-team/container-app-operator/internal/kinds/capp/utils"
5153
crcontroller "github.com/dana-team/container-app-operator/internal/kinds/capprevision/controllers"
52-
webhookrcsv1alpha1 "github.com/dana-team/container-app-operator/internal/webhook/rcs/v1alpha1"
54+
webhooks "github.com/dana-team/container-app-operator/internal/webhook/rcs/v1alpha1"
5355
// +kubebuilder:scaffold:imports
5456
)
5557

@@ -68,7 +70,6 @@ func init() {
6870
utilruntime.Must(cmapi.AddToScheme(scheme))
6971
utilruntime.Must(dnsrecordv1alpha1.AddToScheme(scheme))
7072

71-
utilruntime.Must(rcsv1alpha1.AddToScheme(scheme))
7273
// +kubebuilder:scaffold:scheme
7374
}
7475

@@ -177,16 +178,17 @@ func main() {
177178
setupLog.Error(err, "unable to create controller", "controller", "CappRevision")
178179
os.Exit(1)
179180
}
181+
180182
// nolint:goconst
181183
if os.Getenv("ENABLE_WEBHOOKS") != "false" {
182184
hookServer := mgr.GetWebhookServer()
183185
decoder := admission.NewDecoder(scheme)
184-
hookServer.Register(rcswebhooks.ValidatorServingPath, &webhook.Admission{Handler: &rcswebhooks.CappValidator{
186+
hookServer.Register("/validate-capp", &webhook.Admission{Handler: &webhooks.CappValidator{
185187
Client: mgr.GetClient(),
186188
Decoder: decoder,
187189
}})
188190

189-
hookServer.Register(rcswebhooks.MutatorServingPath, &webhook.Admission{Handler: &rcswebhooks.CappMutator{
191+
hookServer.Register("/mutate-capp", &webhook.Admission{Handler: &webhooks.CappMutator{
190192
Client: mgr.GetClient(),
191193
Decoder: decoder,
192194
}})

config/crd/bases/rcs.dana.io_cappconfigs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ spec:
7575
Claims lists the names of resources, defined in spec.resourceClaims,
7676
that are used by this container.
7777
78-
This is an alpha field and requires enabling the
78+
This field depends on the
7979
DynamicResourceAllocation feature gate.
8080
8181
This field is immutable. It can only be set for containers.

0 commit comments

Comments
 (0)