Skip to content

Commit

Permalink
migrate injection
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdeal committed Oct 16, 2023
1 parent 16a1b5e commit 2acf4b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 0 additions & 3 deletions pkg/apis/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@ import (
"github.com/aws/karpenter-core/pkg/operator/scheme"
"github.com/aws/karpenter/pkg/apis/settings"
"github.com/aws/karpenter/pkg/apis/v1beta1"
"github.com/aws/karpenter/pkg/operator/options"

"github.com/samber/lo"

"github.com/aws/karpenter-core/pkg/apis"
coresettings "github.com/aws/karpenter-core/pkg/apis/settings"
coreoptions "github.com/aws/karpenter-core/pkg/operator/options"
"github.com/aws/karpenter-core/pkg/utils/functional"
"github.com/aws/karpenter/pkg/apis/v1alpha1"
)
Expand All @@ -44,7 +42,6 @@ var (
// AddToScheme may be used to add all resources defined in the project to a Scheme
AddToScheme = Builder.AddToScheme
Settings = []coresettings.Injectable{&settings.Settings{}}
Options = []coreoptions.Injectable{&options.Options{}}
)

//go:generate controller-gen crd object:headerFile="../../hack/boilerplate.go.txt" paths="./..." output:crd:artifacts:config=crds
Expand Down
3 changes: 0 additions & 3 deletions pkg/cloudprovider/cloudprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ import (

corev1beta1 "github.com/aws/karpenter-core/pkg/apis/v1beta1"
"github.com/aws/karpenter-core/pkg/events"
coreoptions "github.com/aws/karpenter-core/pkg/operator/options"
"github.com/aws/karpenter-core/pkg/utils/functional"
machineutil "github.com/aws/karpenter-core/pkg/utils/machine"
nodepoolutil "github.com/aws/karpenter-core/pkg/utils/nodepool"
"github.com/aws/karpenter/pkg/apis"
"github.com/aws/karpenter/pkg/apis/v1alpha1"
"github.com/aws/karpenter/pkg/apis/v1beta1"
"github.com/aws/karpenter/pkg/operator/options"
"github.com/aws/karpenter/pkg/utils"
nodeclassutil "github.com/aws/karpenter/pkg/utils/nodeclass"

Expand Down Expand Up @@ -65,7 +63,6 @@ func init() {
v1alpha5.NormalizedLabels = lo.Assign(v1alpha5.NormalizedLabels, map[string]string{"topology.ebs.csi.aws.com/zone": v1.LabelTopologyZone})
corev1beta1.NormalizedLabels = lo.Assign(corev1beta1.NormalizedLabels, map[string]string{"topology.ebs.csi.aws.com/zone": v1.LabelTopologyZone})
coreapis.Settings = append(coreapis.Settings, apis.Settings...)
coreoptions.Injectables = append(coreoptions.Injectables, &options.Options{})
}

var _ cloudprovider.CloudProvider = (*CloudProvider)(nil)
Expand Down
5 changes: 5 additions & 0 deletions pkg/operator/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ import (

"k8s.io/apimachinery/pkg/util/sets"

coreoptions "github.com/aws/karpenter-core/pkg/operator/options"
"github.com/aws/karpenter-core/pkg/utils/env"
"github.com/aws/karpenter/pkg/apis/settings"
)

func init() {
coreoptions.Injectables = append(coreoptions.Injectables, &Options{})
}

type optionsKey struct{}

type Options struct {
Expand Down

0 comments on commit 2acf4b1

Please sign in to comment.