Skip to content

Commit

Permalink
finalize multigroup migration
Browse files Browse the repository at this point in the history
  • Loading branch information
clamoriniere committed Mar 21, 2024
1 parent 7de5f33 commit 80ccc39
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN go mod download

# Copy the go source
COPY main.go main.go
COPY api/ api/
COPY apis/ apis/
COPY controllers/ controllers/
COPY pkg/ pkg/
COPY third_party/ third_party/
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ e2e: manager manifests verify-license goe2e

# Runs e2e tests (expects a configured cluster)
goe2e:
KUBEBUILDER_ASSETS="$(ROOT)/bin/$(PLATFORM)/" go test --tags=e2e ./controllers/test
KUBEBUILDER_ASSETS="$(ROOT)/bin/$(PLATFORM)/" go test --tags=e2e ./controllers/datadoghq/test

# Build manager binary
.PHONY: manager
Expand Down
24 changes: 18 additions & 6 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
domain: datadoghq.com
layout: go.kubebuilder.io/v2
layout:
- go.kubebuilder.io/v3
multigroup: true
plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
projectName: watermarkpodautoscaler
repo: github.com/DataDog/watermarkpodautoscaler
resources:
-
# TODO(user): Uncomment the below line if this resource implements a controller, else delete it.
- api:
crdVersion: v1
namespaced: true
controller: true
domain: datadoghq.com
group: datadoghq
kind: WatermarkPodAutoscaler
# TODO(user): Update the package path for your API if the below value is incorrect.
path: github.com/DataDog/watermarkpodautoscaler/apis/datadoghq/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: datadoghq.com
group: datadoghq
kind: RecommendWatermarkPodAutoscaler
path: github.com/DataDog/watermarkpodautoscaler/apis/datadoghq/v1alpha1
version: v1alpha1
version: "3"
plugins:
go.sdk.operatorframework.io/v2-alpha: {}
2 changes: 1 addition & 1 deletion bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.23.0
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v2
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3

# Labels for testing.
LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ metadata:
]
capabilities: Basic Install
operators.operatorframework.io/builder: operator-sdk-v1.23.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v2
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
name: watermarkpodautoscaler.v0.5.2
namespace: placeholder
spec:
Expand Down
2 changes: 1 addition & 1 deletion bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ annotations:
operators.operatorframework.io.bundle.channel.default.v1: alpha
operators.operatorframework.io.metrics.builder: operator-sdk-v1.23.0
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v2
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3

# Annotations for testing.
operators.operatorframework.io.test.mediatype.v1: scorecard+v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ metadata:
]
capabilities: Basic Install
operators.operatorframework.io/builder: operator-sdk-v1.23.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v2
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
name: watermarkpodautoscaler.v0.6.0-rc.1
namespace: placeholder
spec:
Expand Down
4 changes: 2 additions & 2 deletions controllers/datadoghq/doc.go
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Package controllers containers all the WatermarkPodAutoscaler controller logic.
package controllers
// Package datadoghq containers all the WatermarkPodAutoscaler controller logic.
package datadoghq
2 changes: 1 addition & 1 deletion controllers/datadoghq/finalizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

package controllers
package datadoghq

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion controllers/datadoghq/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

package controllers
package datadoghq

import (
"os"
Expand Down
2 changes: 1 addition & 1 deletion controllers/datadoghq/replica_calculator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

package controllers
package datadoghq

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion controllers/datadoghq/replica_calculator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

package controllers
package datadoghq

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func ginkgoLog(format string, a ...interface{}) {
var alreadyExistingObjs = map[dynclient.Object]bool{}

func objectsBeforeEachFunc() {
objs, err := metricsserver.InitMetricsServerFiles(GinkgoWriter, "../../test/e2e/metricsserver/deploy", namespace)
objs, err := metricsserver.InitMetricsServerFiles(GinkgoWriter, "../../../test/e2e/metricsserver/deploy", namespace)
Expect(err).Should(Succeed())
info("We extracted all the files")
Expect(err).Should(Succeed())
Expand Down
2 changes: 1 addition & 1 deletion controllers/datadoghq/watermarkpodautoscaler_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

package controllers
package datadoghq

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

package controllers
package datadoghq

import (
"context"
Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import (
ctrlzap "sigs.k8s.io/controller-runtime/pkg/log/zap"

monitorv1alpha1 "github.com/DataDog/datadog-operator/apis/datadoghq/v1alpha1"

datadoghqv1alpha1 "github.com/DataDog/watermarkpodautoscaler/apis/datadoghq/v1alpha1"
controllers "github.com/DataDog/watermarkpodautoscaler/controllers/datadoghq"
datadoghqcontrollers "github.com/DataDog/watermarkpodautoscaler/controllers/datadoghq"
"github.com/DataDog/watermarkpodautoscaler/pkg/config"
"github.com/DataDog/watermarkpodautoscaler/pkg/version"
// +kubebuilder:scaffold:imports
Expand Down Expand Up @@ -123,7 +124,7 @@ func main() {
managerLogger := ctrl.Log.WithName("controllers").WithName("WatermarkPodAutoscaler")
klog.SetLogger(managerLogger) // Redirect klog to the controller logger (zap)

if err = (&controllers.WatermarkPodAutoscalerReconciler{
if err = (&datadoghqcontrollers.WatermarkPodAutoscalerReconciler{
Client: mgr.GetClient(),
Log: managerLogger,
Scheme: mgr.GetScheme(),
Expand Down

0 comments on commit 80ccc39

Please sign in to comment.