Skip to content

Commit

Permalink
Refactored expiration controller into node controller
Browse files Browse the repository at this point in the history
  • Loading branch information
ellistarn committed Aug 3, 2021
1 parent feaa736 commit 1eccfd9
Show file tree
Hide file tree
Showing 20 changed files with 534 additions and 820 deletions.
4 changes: 0 additions & 4 deletions cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ import (
"github.com/awslabs/karpenter/pkg/cloudprovider/registry"
"github.com/awslabs/karpenter/pkg/controllers"
"github.com/awslabs/karpenter/pkg/controllers/allocation"
"github.com/awslabs/karpenter/pkg/controllers/expiration"
"github.com/awslabs/karpenter/pkg/controllers/node"
"github.com/awslabs/karpenter/pkg/controllers/reallocation"
"github.com/awslabs/karpenter/pkg/controllers/termination"
"github.com/go-logr/zapr"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -82,9 +80,7 @@ func main() {
HealthProbeBindAddress: fmt.Sprintf(":%d", options.HealthProbePort),
})
if err := manager.RegisterControllers(ctx,
expiration.NewController(manager.GetClient()),
allocation.NewController(manager.GetClient(), clientSet.CoreV1(), cloudProvider),
reallocation.NewController(manager.GetClient(), cloudProvider),
termination.NewController(ctx, manager.GetClient(), clientSet.CoreV1(), cloudProvider),
node.NewController(manager.GetClient()),
).Start(ctx); err != nil {
Expand Down
3 changes: 1 addition & 2 deletions pkg/apis/provisioning/v1alpha3/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ var (
NotReadyTaintKey = SchemeGroupVersion.Group + "/not-ready"

// Reserved labels
ProvisionerNameLabelKey = SchemeGroupVersion.Group + "/provisioner-name"
ProvisionerUnderutilizedLabelKey = SchemeGroupVersion.Group + "/underutilized"
ProvisionerNameLabelKey = SchemeGroupVersion.Group + "/provisioner-name"

// Reserved annotations
KarpenterDoNotEvictPodAnnotation = SchemeGroupVersion.Group + "/do-not-evict"
Expand Down
1 change: 0 additions & 1 deletion pkg/apis/provisioning/v1alpha3/provisioner_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ var (
ArchitectureLabelKey,
OperatingSystemLabelKey,
ProvisionerNameLabelKey,
ProvisionerUnderutilizedLabelKey,
ProvisionerTTLAfterEmptyKey,
ZoneLabelKey,
InstanceTypeLabelKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ var _ = Describe("Validation", func() {
ArchitectureLabelKey,
OperatingSystemLabelKey,
ProvisionerNameLabelKey,
ProvisionerUnderutilizedLabelKey,
ZoneLabelKey,
InstanceTypeLabelKey,
} {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cloudprovider/aws/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (p *InstanceProvider) getInstance(ctx context.Context, id *string, instance
}
*instance = *describeInstancesOutput.Reservations[0].Instances[0]
if len(aws.StringValue(instance.PrivateDnsName)) == 0 {
return fmt.Errorf("expected PrivateDnsName to be set")
return fmt.Errorf("got instance %s but PrivateDnsName was not set", aws.StringValue(instance.InstanceId))
}
return nil
}
Expand Down
119 changes: 0 additions & 119 deletions pkg/controllers/expiration/controller.go

This file was deleted.

115 changes: 0 additions & 115 deletions pkg/controllers/expiration/suite_test.go

This file was deleted.

Loading

0 comments on commit 1eccfd9

Please sign in to comment.