Skip to content

Commit

Permalink
chore: Abstract prometheus metrics to interfaces (#7357)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis authored Nov 8, 2024
1 parent 008b087 commit 6ffb599
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.3
controller-gen.kubebuilder.io/version: v0.16.5
name: nodeclaims.karpenter.sh
spec:
group: karpenter.sh
Expand Down
2 changes: 1 addition & 1 deletion charts/karpenter-crd/templates/karpenter.sh_nodepools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.3
controller-gen.kubebuilder.io/version: v0.16.5
name: nodepools.karpenter.sh
spec:
group: karpenter.sh
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/aws/karpenter-provider-aws/tools/kompat v0.0.0-20240410220356-6b868db24881
github.com/aws/smithy-go v1.22.0
github.com/awslabs/amazon-eks-ami/nodeadm v0.0.0-20240229193347-cfab22a10647
github.com/awslabs/operatorpkg v0.0.0-20240920182301-771460b3160b
github.com/awslabs/operatorpkg v0.0.0-20241108183842-a2ebef231d52
github.com/go-logr/zapr v1.3.0
github.com/imdario/mergo v0.3.16
github.com/mitchellh/hashstructure/v2 v2.0.2
Expand All @@ -42,7 +42,7 @@ require (
k8s.io/klog/v2 v2.130.1
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
sigs.k8s.io/controller-runtime v0.19.1
sigs.k8s.io/karpenter v1.0.1-0.20241007233822-633135958bc4
sigs.k8s.io/karpenter v1.0.1-0.20241108203843-2f8035457601
sigs.k8s.io/yaml v1.4.0
)

Expand Down Expand Up @@ -117,9 +117,9 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/cloud-provider v0.31.1 // indirect
k8s.io/cloud-provider v0.31.2 // indirect
k8s.io/component-base v0.31.2 // indirect
k8s.io/csi-translation-lib v0.31.1 // indirect
k8s.io/csi-translation-lib v0.31.2 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM=
github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
github.com/awslabs/amazon-eks-ami/nodeadm v0.0.0-20240229193347-cfab22a10647 h1:8yRBVsjGmI7qQsPWtIrbWP+XfwHO9Wq7gdLVzjqiZFs=
github.com/awslabs/amazon-eks-ami/nodeadm v0.0.0-20240229193347-cfab22a10647/go.mod h1:9NafTAUHL0FlMeL6Cu5PXnMZ1q/LnC9X2emLXHsVbM8=
github.com/awslabs/operatorpkg v0.0.0-20240920182301-771460b3160b h1:aG1+YRmKIf5nLTZJNhw1NmuxvjUprWYyluqJ2jmVqiU=
github.com/awslabs/operatorpkg v0.0.0-20240920182301-771460b3160b/go.mod h1:RI+iNDn57c3WX0tsZg4rvkmM58lWsEC5cc6E4vJJld8=
github.com/awslabs/operatorpkg v0.0.0-20241108183842-a2ebef231d52 h1:k8f1ukVs49+nC6JbN8r8bxs8g1TPE3Iki/dK/LGwf3A=
github.com/awslabs/operatorpkg v0.0.0-20241108183842-a2ebef231d52/go.mod h1:nq1PLBLCojzjfqSK8SG3ymxqwW6e/cHLJvddKOSFkfw=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
Expand Down Expand Up @@ -307,12 +307,12 @@ k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw=
k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
k8s.io/client-go v0.31.2 h1:Y2F4dxU5d3AQj+ybwSMqQnpZH9F30//1ObxOKlTI9yc=
k8s.io/client-go v0.31.2/go.mod h1:NPa74jSVR/+eez2dFsEIHNa+3o09vtNaWwWwb1qSxSs=
k8s.io/cloud-provider v0.31.1 h1:40b6AgDizwm5eWratZbqubTHMob25VWr6NX2Ei5TwZA=
k8s.io/cloud-provider v0.31.1/go.mod h1:xAdkE7fdZdu9rKLuOZUMBfagu7bM+bas3iPux/2nLGg=
k8s.io/cloud-provider v0.31.2 h1:ZdstxJOcHzP45j8giE79VJmgNckBbw1ldtIqnhZvKIA=
k8s.io/cloud-provider v0.31.2/go.mod h1:+4L8YpYCEx1Ko5EKS/PzXyBY5YREwDKChsJjAxHRf08=
k8s.io/component-base v0.31.2 h1:Z1J1LIaC0AV+nzcPRFqfK09af6bZ4D1nAOpWsy9owlA=
k8s.io/component-base v0.31.2/go.mod h1:9PeyyFN/drHjtJZMCTkSpQJS3U9OXORnHQqMLDz0sUQ=
k8s.io/csi-translation-lib v0.31.1 h1:ps9kya8+ih0CVL59JO2B4AYH8U/e3WLQxl9sx19NjjM=
k8s.io/csi-translation-lib v0.31.1/go.mod h1:VeYSucPZJbAt6RT25AzfG7WjyxCcmqxtr4V/CaDdNZc=
k8s.io/csi-translation-lib v0.31.2 h1:nCOE28rTUVOjwUKs4wl8wIZBHEnbQU5MkI0P6YM/Ylg=
k8s.io/csi-translation-lib v0.31.2/go.mod h1:X0paKG/WAqDyrfpiTyj8ga4srG0guOm2Sj2pNi4kP10=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
Expand All @@ -323,8 +323,8 @@ sigs.k8s.io/controller-runtime v0.19.1 h1:Son+Q40+Be3QWb+niBXAg2vFiYWolDjjRfO8hn
sigs.k8s.io/controller-runtime v0.19.1/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/karpenter v1.0.1-0.20241007233822-633135958bc4 h1:9j4MtUlunojW56lQxngksTsbOf1xTo6GBrvCWjskFaI=
sigs.k8s.io/karpenter v1.0.1-0.20241007233822-633135958bc4/go.mod h1:yJpNex/ZqhiL8TMck91gsDqAQJ+yg0hv4Y2Y90egL2o=
sigs.k8s.io/karpenter v1.0.1-0.20241108203843-2f8035457601 h1:X6L2Da47OoPcEAyoA2TCpdW3+X9G5cL1JfANRv09TUg=
sigs.k8s.io/karpenter v1.0.1-0.20241108203843-2f8035457601/go.mod h1:bnHSuhilh2JTejYG0F0dD/rqLuO4EU1VmoR/ZnoVrAA=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/crds/karpenter.sh_nodeclaims.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.3
controller-gen.kubebuilder.io/version: v0.16.5
name: nodeclaims.karpenter.sh
spec:
group: karpenter.sh
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/crds/karpenter.sh_nodepools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.3
controller-gen.kubebuilder.io/version: v0.16.5
name: nodepools.karpenter.sh
spec:
group: karpenter.sh
Expand Down
5 changes: 2 additions & 3 deletions pkg/batcher/batcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"time"

"github.com/mitchellh/hashstructure/v2"
"github.com/prometheus/client_golang/prometheus"
"github.com/samber/lo"
"golang.org/x/sync/errgroup"

Expand Down Expand Up @@ -139,7 +138,7 @@ func (b *Batcher[T, U]) run() {
return
case <-b.trigger:
// wait to start the batch of create fleet calls
measureDuration = metrics.Measure(batchWindowDuration.WithLabelValues(b.options.Name))
measureDuration = metrics.Measure(BatchWindowDuration, map[string]string{batcherNameLabel: b.options.Name})
}
b.waitForIdle()
measureDuration() // Observe the length of time between the start of the batch and now
Expand Down Expand Up @@ -184,7 +183,7 @@ func (b *Batcher[T, U]) waitForIdle() {

func (b *Batcher[T, U]) runCalls(requests []*request[T, U]) {
// Measure the size of the request batch
batchSize.With(prometheus.Labels{batcherNameLabel: b.options.Name}).Observe(float64(len(requests)))
BatchSize.Observe(float64(len(requests)), map[string]string{batcherNameLabel: b.options.Name})
requestIdx := 0
for _, result := range b.options.BatchExecutor(requests[0].ctx, lo.Map(requests, func(req *request[T, U], _ int) *T { return req.input })) {
requests[requestIdx].requestor <- result
Expand Down
9 changes: 3 additions & 6 deletions pkg/batcher/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ limitations under the License.
package batcher

import (
opmetrics "github.com/awslabs/operatorpkg/metrics"
"github.com/prometheus/client_golang/prometheus"
crmetrics "sigs.k8s.io/controller-runtime/pkg/metrics"

Expand All @@ -34,22 +35,18 @@ func SizeBuckets() []float64 {
}

var (
batchWindowDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{
BatchWindowDuration = opmetrics.NewPrometheusHistogram(crmetrics.Registry, prometheus.HistogramOpts{
Namespace: metrics.Namespace,
Subsystem: batcherSubsystem,
Name: "batch_time_seconds",
Help: "Duration of the batching window per batcher",
Buckets: metrics.DurationBuckets(),
}, []string{batcherNameLabel})
batchSize = prometheus.NewHistogramVec(prometheus.HistogramOpts{
BatchSize = opmetrics.NewPrometheusHistogram(crmetrics.Registry, prometheus.HistogramOpts{
Namespace: metrics.Namespace,
Subsystem: batcherSubsystem,
Name: "batch_size",
Help: "Size of the request batch per batcher",
Buckets: SizeBuckets(),
}, []string{batcherNameLabel})
)

func init() {
crmetrics.Registry.MustRegister(batchWindowDuration, batchSize)
}
2 changes: 1 addition & 1 deletion pkg/cloudprovider/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ var _ = BeforeSuite(func() {
cloudProvider = cloudprovider.New(awsEnv.InstanceTypesProvider, awsEnv.InstanceProvider, recorder,
env.Client, awsEnv.AMIProvider, awsEnv.SecurityGroupProvider)
cluster = state.NewCluster(fakeClock, env.Client)
prov = provisioning.NewProvisioner(env.Client, recorder, cloudProvider, cluster)
prov = provisioning.NewProvisioner(env.Client, recorder, cloudProvider, cluster, fakeClock)
})

var _ = AfterSuite(func() {
Expand Down
11 changes: 5 additions & 6 deletions pkg/controllers/interruption/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"fmt"
"time"

"github.com/prometheus/client_golang/prometheus"
"sigs.k8s.io/karpenter/pkg/metrics"

ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
Expand Down Expand Up @@ -150,7 +149,7 @@ func (c *Controller) handleMessage(ctx context.Context, nodeClaimInstanceIDMap m
nodeInstanceIDMap map[string]*corev1.Node, msg messages.Message) (err error) {

ctx = log.IntoContext(ctx, log.FromContext(ctx).WithValues("messageKind", msg.Kind()))
receivedMessages.WithLabelValues(string(msg.Kind())).Inc()
ReceivedMessages.Inc(map[string]string{messageTypeLabel: string(msg.Kind())})

if msg.Kind() == messages.NoOpKind {
return nil
Expand All @@ -165,7 +164,7 @@ func (c *Controller) handleMessage(ctx context.Context, nodeClaimInstanceIDMap m
err = multierr.Append(err, e)
}
}
messageLatency.Observe(time.Since(msg.StartTime()).Seconds())
MessageLatency.Observe(time.Since(msg.StartTime()).Seconds(), nil)
if err != nil {
return fmt.Errorf("acting on NodeClaims, %w", err)
}
Expand All @@ -177,7 +176,7 @@ func (c *Controller) deleteMessage(ctx context.Context, msg *sqstypes.Message) e
if err := c.sqsProvider.DeleteSQSMessage(ctx, msg); err != nil {
return fmt.Errorf("deleting sqs message, %w", err)
}
deletedMessages.Inc()
DeletedMessages.Inc(nil)
return nil
}

Expand Down Expand Up @@ -216,11 +215,11 @@ func (c *Controller) deleteNodeClaim(ctx context.Context, msg messages.Message,
}
log.FromContext(ctx).Info("initiating delete from interruption message")
c.recorder.Publish(interruptionevents.TerminatingOnInterruption(node, nodeClaim)...)
metrics.NodeClaimsDisruptedTotal.With(prometheus.Labels{
metrics.NodeClaimsDisruptedTotal.Inc(map[string]string{
metrics.ReasonLabel: string(msg.Kind()),
metrics.NodePoolLabel: nodeClaim.Labels[karpv1.NodePoolLabelKey],
metrics.CapacityTypeLabel: nodeClaim.Labels[karpv1.CapacityTypeLabelKey],
}).Inc()
})
return nil
}

Expand Down
16 changes: 9 additions & 7 deletions pkg/controllers/interruption/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ limitations under the License.
package interruption

import (
opmetrics "github.com/awslabs/operatorpkg/metrics"
"github.com/prometheus/client_golang/prometheus"
crmetrics "sigs.k8s.io/controller-runtime/pkg/metrics"

Expand All @@ -27,7 +28,8 @@ const (
)

var (
receivedMessages = prometheus.NewCounterVec(
ReceivedMessages = opmetrics.NewPrometheusCounter(
crmetrics.Registry,
prometheus.CounterOpts{
Namespace: metrics.Namespace,
Subsystem: interruptionSubsystem,
Expand All @@ -36,25 +38,25 @@ var (
},
[]string{messageTypeLabel},
)
deletedMessages = prometheus.NewCounter(
DeletedMessages = opmetrics.NewPrometheusCounter(
crmetrics.Registry,
prometheus.CounterOpts{
Namespace: metrics.Namespace,
Subsystem: interruptionSubsystem,
Name: "deleted_messages_total",
Help: "Count of messages deleted from the SQS queue.",
},
[]string{},
)
messageLatency = prometheus.NewHistogram(
MessageLatency = opmetrics.NewPrometheusHistogram(
crmetrics.Registry,
prometheus.HistogramOpts{
Namespace: metrics.Namespace,
Subsystem: interruptionSubsystem,
Name: "message_queue_duration_seconds",
Help: "Amount of time an interruption message is on the queue before it is processed by karpenter.",
Buckets: metrics.DurationBuckets(),
},
[]string{},
)
)

func init() {
crmetrics.Registry.MustRegister(receivedMessages, deletedMessages, messageLatency)
}
17 changes: 8 additions & 9 deletions pkg/providers/instancetype/instancetype.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (

"github.com/mitchellh/hashstructure/v2"
"github.com/patrickmn/go-cache"
"github.com/prometheus/client_golang/prometheus"
corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/log"
karpv1 "sigs.k8s.io/karpenter/pkg/apis/v1"
Expand Down Expand Up @@ -147,12 +146,12 @@ func (p *DefaultProvider) List(ctx context.Context, nodeClass *v1.EC2NodeClass)
return s.Zone, s.ZoneID
})
result := lo.Map(p.instanceTypesInfo, func(i ec2types.InstanceTypeInfo, _ int) *cloudprovider.InstanceType {
instanceTypeVCPU.With(prometheus.Labels{
InstanceTypeVCPU.Set(float64(lo.FromPtr(i.VCpuInfo.DefaultVCpus)), map[string]string{
instanceTypeLabel: string(i.InstanceType),
}).Set(float64(lo.FromPtr(i.VCpuInfo.DefaultVCpus)))
instanceTypeMemory.With(prometheus.Labels{
})
InstanceTypeMemory.Set(float64(lo.FromPtr(i.MemoryInfo.SizeInMiB)*1024*1024), map[string]string{
instanceTypeLabel: string(i.InstanceType),
}).Set(float64(lo.FromPtr(i.MemoryInfo.SizeInMiB) * 1024 * 1024))
})

zoneData := lo.Map(allZones.UnsortedList(), func(zoneName string, _ int) ZoneData {
if !p.instanceTypesOfferings[string(i.InstanceType)].Has(zoneName) || !subnetZones.Has(zoneName) {
Expand All @@ -173,16 +172,16 @@ func (p *DefaultProvider) List(ctx context.Context, nodeClass *v1.EC2NodeClass)
it.Capacity[corev1.ResourceMemory] = cached.(resource.Quantity)
}
for _, of := range it.Offerings {
instanceTypeOfferingAvailable.With(prometheus.Labels{
InstanceTypeOfferingAvailable.Set(float64(lo.Ternary(of.Available, 1, 0)), map[string]string{
instanceTypeLabel: it.Name,
capacityTypeLabel: of.Requirements.Get(karpv1.CapacityTypeLabelKey).Any(),
zoneLabel: of.Requirements.Get(corev1.LabelTopologyZone).Any(),
}).Set(float64(lo.Ternary(of.Available, 1, 0)))
instanceTypeOfferingPriceEstimate.With(prometheus.Labels{
})
InstanceTypeOfferingPriceEstimate.Set(of.Price, map[string]string{
instanceTypeLabel: it.Name,
capacityTypeLabel: of.Requirements.Get(karpv1.CapacityTypeLabelKey).Any(),
zoneLabel: of.Requirements.Get(corev1.LabelTopologyZone).Any(),
}).Set(of.Price)
})
}
return it
})
Expand Down
17 changes: 9 additions & 8 deletions pkg/providers/instancetype/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ limitations under the License.
package instancetype

import (
opmetrics "github.com/awslabs/operatorpkg/metrics"
"github.com/prometheus/client_golang/prometheus"
crmetrics "sigs.k8s.io/controller-runtime/pkg/metrics"

Expand All @@ -29,7 +30,8 @@ const (
)

var (
instanceTypeVCPU = prometheus.NewGaugeVec(
InstanceTypeVCPU = opmetrics.NewPrometheusGauge(
crmetrics.Registry,
prometheus.GaugeOpts{
Namespace: metrics.Namespace,
Subsystem: cloudProviderSubsystem,
Expand All @@ -40,7 +42,8 @@ var (
instanceTypeLabel,
},
)
instanceTypeMemory = prometheus.NewGaugeVec(
InstanceTypeMemory = opmetrics.NewPrometheusGauge(
crmetrics.Registry,
prometheus.GaugeOpts{
Namespace: metrics.Namespace,
Subsystem: cloudProviderSubsystem,
Expand All @@ -51,7 +54,8 @@ var (
instanceTypeLabel,
},
)
instanceTypeOfferingAvailable = prometheus.NewGaugeVec(
InstanceTypeOfferingAvailable = opmetrics.NewPrometheusGauge(
crmetrics.Registry,
prometheus.GaugeOpts{
Namespace: metrics.Namespace,
Subsystem: cloudProviderSubsystem,
Expand All @@ -64,7 +68,8 @@ var (
zoneLabel,
},
)
instanceTypeOfferingPriceEstimate = prometheus.NewGaugeVec(
InstanceTypeOfferingPriceEstimate = opmetrics.NewPrometheusGauge(
crmetrics.Registry,
prometheus.GaugeOpts{
Namespace: metrics.Namespace,
Subsystem: cloudProviderSubsystem,
Expand All @@ -77,7 +82,3 @@ var (
zoneLabel,
})
)

func init() {
crmetrics.Registry.MustRegister(instanceTypeVCPU, instanceTypeMemory, instanceTypeOfferingAvailable, instanceTypeOfferingPriceEstimate)
}
2 changes: 1 addition & 1 deletion pkg/providers/instancetype/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ var _ = BeforeSuite(func() {
cloudProvider = cloudprovider.New(awsEnv.InstanceTypesProvider, awsEnv.InstanceProvider, events.NewRecorder(&record.FakeRecorder{}),
env.Client, awsEnv.AMIProvider, awsEnv.SecurityGroupProvider)
cluster = state.NewCluster(fakeClock, env.Client)
prov = provisioning.NewProvisioner(env.Client, events.NewRecorder(&record.FakeRecorder{}), cloudProvider, cluster)
prov = provisioning.NewProvisioner(env.Client, events.NewRecorder(&record.FakeRecorder{}), cloudProvider, cluster, fakeClock)
})

var _ = AfterSuite(func() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/launchtemplate/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ var _ = BeforeSuite(func() {
cloudProvider = cloudprovider.New(awsEnv.InstanceTypesProvider, awsEnv.InstanceProvider, events.NewRecorder(&record.FakeRecorder{}),
env.Client, awsEnv.AMIProvider, awsEnv.SecurityGroupProvider)
cluster = state.NewCluster(fakeClock, env.Client)
prov = provisioning.NewProvisioner(env.Client, events.NewRecorder(&record.FakeRecorder{}), cloudProvider, cluster)
prov = provisioning.NewProvisioner(env.Client, events.NewRecorder(&record.FakeRecorder{}), cloudProvider, cluster, fakeClock)
})

var _ = AfterSuite(func() {
Expand Down

0 comments on commit 6ffb599

Please sign in to comment.