Skip to content

Commit

Permalink
feat: add support for more resource types
Browse files Browse the repository at this point in the history
* CronJob
* DaemonSet
* Job
* StatefulSet
  • Loading branch information
basti1302 committed May 24, 2024
1 parent c235cdb commit 63ade19
Show file tree
Hide file tree
Showing 27 changed files with 1,580 additions and 424 deletions.
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"arrowParens": "avoid",
"quoteProps": "as-needed",
"printWidth": 120,
"semi": true,
"singleQuote": true,
"trailingComma": "all"
}
12 changes: 0 additions & 12 deletions api/v1alpha1/dash0_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,6 @@ type Dash0List struct {
Items []Dash0 `json:"items"`
}

type ConditionType string
type Reason string

const (
ConditionTypeAvailable ConditionType = "Available"
ConditionTypeDegraded ConditionType = "Degraded"

ReasonSuccessfulInstrumentation Reason = "SuccessfulInstrumentation"
ReasonAlreadyInstrumented Reason = "AlreadyInstrumented"
ReasonFailedInstrumentation Reason = "FailedInstrumentation"
)

func init() {
SchemeBuilder.Register(&Dash0{}, &Dash0List{})
}
17 changes: 8 additions & 9 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

operatorv1alpha1 "github.com/dash0hq/dash0-operator/api/v1alpha1"
"github.com/dash0hq/dash0-operator/internal/controller"
"github.com/dash0hq/dash0-operator/internal/k8sresources"
"github.com/dash0hq/dash0-operator/internal/util"
dash0webhook "github.com/dash0hq/dash0-operator/internal/webhook"
//+kubebuilder:scaffold:imports
)
Expand Down Expand Up @@ -155,15 +155,17 @@ func startOperatorManager(
initContainerImageVersion,
)

versions := util.Versions{
OperatorVersion: operatorVersion,
InitContainerImageVersion: initContainerImageVersion,
}

if err = (&controller.Dash0Reconciler{
Client: mgr.GetClient(),
ClientSet: clientSet,
Scheme: mgr.GetScheme(),
Recorder: mgr.GetEventRecorderFor("dash0-controller"),
Versions: k8sresources.Versions{
OperatorVersion: operatorVersion,
InitContainerImageVersion: initContainerImageVersion,
},
Versions: versions,
}).SetupWithManager(mgr); err != nil {
return fmt.Errorf("unable to set up the Dash0 reconciler: %w", err)
}
Expand All @@ -172,10 +174,7 @@ func startOperatorManager(
if os.Getenv("ENABLE_WEBHOOKS") != "false" {
if err = (&dash0webhook.Handler{
Recorder: mgr.GetEventRecorderFor("dash0-webhook"),
Versions: k8sresources.Versions{
OperatorVersion: operatorVersion,
InitContainerImageVersion: initContainerImageVersion,
},
Versions: versions,
}).SetupWebhookWithManager(mgr); err != nil {
return fmt.Errorf("unable to create the Dash0 webhook: %w", err)
}
Expand Down
Loading

0 comments on commit 63ade19

Please sign in to comment.