Skip to content

Commit

Permalink
Validate v1beta1 conversion changes with snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis committed Aug 8, 2023
1 parent 96f96ab commit 3a41dfb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ require (
sigs.k8s.io/controller-runtime v0.14.6
)

replace github.com/aws/karpenter-core => github.com/jonathan-innis/karpenter-core v0.0.0-20230808063057-b6fe093fe6e5

require (
contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d // indirect
contrib.go.opencensus.io/exporter/prometheus v0.4.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHS
github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY=
github.com/aws/aws-sdk-go v1.44.294 h1:3x7GaEth+pDU9HwFcAU0awZlEix5CEdyIZvV08SlHa8=
github.com/aws/aws-sdk-go v1.44.294/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/karpenter-core v0.29.2-0.20230803235302-95bd9f61a18b h1:88YeEA65jQNCj4/AdH0qixJeuGuIOi5QxOzsRCXsJQA=
github.com/aws/karpenter-core v0.29.2-0.20230803235302-95bd9f61a18b/go.mod h1:+C8X0N378fQ/+YmopvRHflj2JFrVP8sPs9xL7v4A6eM=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
Expand Down Expand Up @@ -220,6 +218,8 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/jonathan-innis/karpenter-core v0.0.0-20230808063057-b6fe093fe6e5 h1:L9NYjqmZtdNh3/luVs3e3jBOBLIGaSI6a6iVBJ90eMU=
github.com/jonathan-innis/karpenter-core v0.0.0-20230808063057-b6fe093fe6e5/go.mod h1:+C8X0N378fQ/+YmopvRHflj2JFrVP8sPs9xL7v4A6eM=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
Expand Down
5 changes: 3 additions & 2 deletions test/pkg/environment/common/expectations.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import (
pscheduling "github.com/aws/karpenter-core/pkg/controllers/provisioning/scheduling"
"github.com/aws/karpenter-core/pkg/scheduling"
"github.com/aws/karpenter-core/pkg/test"
nodepoolutil "github.com/aws/karpenter-core/pkg/utils/nodepool"
)

func (env *Environment) ExpectCreatedWithOffset(offset int, objects ...client.Object) {
Expand Down Expand Up @@ -572,8 +573,8 @@ func (env *Environment) GetDaemonSetCount(prov *v1alpha5.Provisioner) int {

return lo.CountBy(daemonSetList.Items, func(d appsv1.DaemonSet) bool {
p := &v1.Pod{Spec: d.Spec.Template.Spec}
nodeTemplate := pscheduling.NewMachineTemplate(prov)
if err := nodeTemplate.Taints.Tolerates(p); err != nil {
nodeTemplate := pscheduling.NewNodeClaimTemplate(nodepoolutil.New(prov))
if err := scheduling.Taints(nodeTemplate.Spec.Taints).Tolerates(p); err != nil {
return false
}
if err := nodeTemplate.Requirements.Compatible(scheduling.NewPodRequirements(p)); err != nil {
Expand Down

0 comments on commit 3a41dfb

Please sign in to comment.