Skip to content

Commit

Permalink
feat: add kubectl wpa metriccheck command
Browse files Browse the repository at this point in the history
  • Loading branch information
clamoriniere committed Apr 24, 2023
1 parent ed4a95b commit 40f6cff
Show file tree
Hide file tree
Showing 6 changed files with 533 additions and 25 deletions.
6 changes: 6 additions & 0 deletions cmd/kubectl-wpa/app/common/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/apiutil"

datadoghq "github.com/DataDog/datadog-operator/apis/datadoghq/v1alpha1"
"github.com/DataDog/watermarkpodautoscaler/api/v1alpha1"
)

Expand All @@ -32,6 +33,11 @@ func NewClient(clientConfig clientcmd.ClientConfig) (client.Client, error) {
if err = v1alpha1.AddToScheme(scheme.Scheme); err != nil {
return nil, fmt.Errorf("unable register WatermarkPodAutoscaler apis, err: %w", err)
}

if err = datadoghq.AddToScheme(scheme.Scheme); err != nil {
return nil, fmt.Errorf("unable register DatadogMetric apis, err: %w", err)
}

// Create the Client for Read/Write operations.
var newClient client.Client
newClient, err = client.New(restConfig, client.Options{Scheme: scheme.Scheme, Mapper: mapper})
Expand Down
7 changes: 7 additions & 0 deletions cmd/kubectl-wpa/app/metriccheck/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

// Package metriccheck contains metric-check plugin functions.
package metriccheck
Loading

0 comments on commit 40f6cff

Please sign in to comment.