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
* ReplicaSet
* StatefulSet
  • Loading branch information
basti1302 committed May 26, 2024
1 parent bd0d988 commit e4744fe
Show file tree
Hide file tree
Showing 42 changed files with 2,148 additions and 479 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*.dll
*.so
*.dylib
bin/*
/bin/*
Dockerfile.cross

# Test binary, built with `go test -c`
Expand All @@ -26,5 +26,3 @@ go.work
*.swp
*.swo
*~

e2e-test-received-data/
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 e4744fe

Please sign in to comment.