mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
fix: remove unused functions (#11190)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
This commit is contained in:
parent
d78e953cf3
commit
b0588afba1
2 changed files with 0 additions and 68 deletions
|
@ -1,34 +0,0 @@
|
|||
package generator
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-logr/logr"
|
||||
reportsv1 "github.com/kyverno/kyverno/api/reports/v1"
|
||||
"github.com/kyverno/kyverno/pkg/client/clientset/versioned"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type ClusterEphemeralReportGenerator = Generator[*reportsv1.ClusterEphemeralReport]
|
||||
|
||||
type clusterephemeralreportsgenerator struct {
|
||||
// threshold config.Configuration
|
||||
threshold int
|
||||
count int
|
||||
}
|
||||
|
||||
func NewClusterEphemeralReportGenerator() ClusterEphemeralReportGenerator {
|
||||
return &clusterephemeralreportsgenerator{
|
||||
threshold: 10,
|
||||
count: 0,
|
||||
}
|
||||
}
|
||||
|
||||
func (g *clusterephemeralreportsgenerator) Generate(ctx context.Context, client versioned.Interface, resource *reportsv1.ClusterEphemeralReport, _ logr.Logger) (*reportsv1.ClusterEphemeralReport, error) {
|
||||
if g.count >= g.threshold {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
report, err := client.ReportsV1().ClusterEphemeralReports().Create(ctx, resource, metav1.CreateOptions{})
|
||||
return report, err
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
package generator
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-logr/logr"
|
||||
reportsv1 "github.com/kyverno/kyverno/api/reports/v1"
|
||||
"github.com/kyverno/kyverno/pkg/client/clientset/versioned"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type EphemeralReportGenerator = Generator[*reportsv1.EphemeralReport]
|
||||
|
||||
type ephemeralreportsgenerator struct {
|
||||
// threshold config.Configuration
|
||||
threshold int
|
||||
count int
|
||||
}
|
||||
|
||||
func NewEphemeralReportGenerator() EphemeralReportGenerator {
|
||||
return &ephemeralreportsgenerator{
|
||||
threshold: 10,
|
||||
count: 0,
|
||||
}
|
||||
}
|
||||
|
||||
func (g *ephemeralreportsgenerator) Generate(ctx context.Context, client versioned.Interface, resource *reportsv1.EphemeralReport, _ logr.Logger) (*reportsv1.EphemeralReport, error) {
|
||||
if g.count >= g.threshold {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
report, err := client.ReportsV1().EphemeralReports(resource.GetNamespace()).Create(ctx, resource, metav1.CreateOptions{})
|
||||
return report, err
|
||||
}
|
Loading…
Reference in a new issue