diff --git a/go.mod b/go.mod index 78090bff..800c0e4a 100644 --- a/go.mod +++ b/go.mod @@ -24,10 +24,11 @@ require ( github.com/sirupsen/logrus v1.8.1 github.com/spf13/cobra v1.4.0 github.com/spf13/pflag v1.0.5 - github.com/spotinst/spotinst-sdk-go v1.152.0 + github.com/spotinst/spotinst-sdk-go v1.334.0 github.com/stretchr/testify v1.8.1 golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + gopkg.in/ini.v1 v1.67.0 // indirect k8s.io/api v0.23.5 k8s.io/apimachinery v0.23.5 k8s.io/client-go v0.23.5 diff --git a/go.sum b/go.sum index 01b43516..c5e05160 100644 --- a/go.sum +++ b/go.sum @@ -295,8 +295,8 @@ github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spotinst/spotinst-sdk-go v1.152.0 h1:QyW/4Cry0WpHWmvriSepDCCsPyCCgxIqBHkWwsD/Ins= -github.com/spotinst/spotinst-sdk-go v1.152.0/go.mod h1:Ku9c4p+kRWnQqmXkzGcTMHLcQKgLHrQZISxeKY7mPqE= +github.com/spotinst/spotinst-sdk-go v1.334.0 h1:CniPPiBwJWNIs9RA8S47P6KXT9Qm0BMsSl5viepTKaI= +github.com/spotinst/spotinst-sdk-go v1.334.0/go.mod h1:C6mrT7+mqOgPyabacjyYTvilu8Xm96mvTvrZQhj99WI= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -308,6 +308,7 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= @@ -671,6 +672,7 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= diff --git a/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/providers/aws/cluster.go b/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/providers/aws/cluster.go index 050e7393..e02ac221 100644 --- a/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/providers/aws/cluster.go +++ b/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/providers/aws/cluster.go @@ -105,6 +105,32 @@ type Task struct { type InstanceTypes struct { Whitelist []string `json:"whitelist,omitempty"` Blacklist []string `json:"blacklist,omitempty"` + Filters *Filters `json:"filters,omitempty"` + + forceSendFields []string + nullFields []string +} + +type Filters struct { + Architectures []string `json:"architectures,omitempty"` + Categories []string `json:"categories,omitempty"` + DiskTypes []string `json:"diskTypes,omitempty"` + ExcludeFamilies []string `json:"excludeFamilies,omitempty"` + ExcludeMetal *bool `json:"excludeMetal,omitempty"` + Hypervisor []string `json:"hypervisor,omitempty"` + IncludeFamilies []string `json:"includeFamilies,omitempty"` + IsEnaSupported *bool `json:"isEnaSupported,omitempty"` + MaxGpu *int `json:"maxGpu,omitempty"` + MaxMemoryGiB *float64 `json:"maxMemoryGiB,omitempty"` + MaxNetworkPerformance *int `json:"maxNetworkPerformance,omitempty"` + MaxVcpu *int `json:"maxVcpu,omitempty"` + MinEnis *int `json:"minEnis,omitempty"` + MinGpu *int `json:"minGpu,omitempty"` + MinMemoryGiB *float64 `json:"minMemoryGiB,omitempty"` + MinNetworkPerformance *int `json:"minNetworkPerformance,omitempty"` + MinVcpu *int `json:"minVcpu,omitempty"` + RootDeviceTypes []string `json:"rootDeviceTypes,omitempty"` + VirtualizationTypes []string `json:"virtualizationTypes,omitempty"` forceSendFields []string nullFields []string @@ -1319,6 +1345,13 @@ func (o *InstanceTypes) SetBlacklist(v []string) *InstanceTypes { return o } +func (o *InstanceTypes) SetFilters(v *Filters) *InstanceTypes { + if o.Filters = v; o.Filters == nil { + o.nullFields = append(o.nullFields, "Filters") + } + return o +} + // endregion // region LaunchSpecification @@ -1815,3 +1848,144 @@ func (o *S3) SetId(v *string) *S3 { } // endregion + +// region Filters + +func (o Filters) MarshalJSON() ([]byte, error) { + type noMethod Filters + raw := noMethod(o) + return jsonutil.MarshalJSON(raw, o.forceSendFields, o.nullFields) +} + +func (o *Filters) SetArchitectures(v []string) *Filters { + if o.Architectures = v; o.Architectures == nil { + o.nullFields = append(o.nullFields, "Architectures") + } + return o +} + +func (o *Filters) SetCategories(v []string) *Filters { + if o.Categories = v; o.Categories == nil { + o.nullFields = append(o.nullFields, "Categories") + } + return o +} + +func (o *Filters) SetDiskTypes(v []string) *Filters { + if o.DiskTypes = v; o.DiskTypes == nil { + o.nullFields = append(o.nullFields, "DiskTypes") + } + return o +} + +func (o *Filters) SetExcludeFamilies(v []string) *Filters { + if o.ExcludeFamilies = v; o.ExcludeFamilies == nil { + o.nullFields = append(o.nullFields, "ExcludeFamilies") + } + return o +} + +func (o *Filters) SetExcludeMetal(v *bool) *Filters { + if o.ExcludeMetal = v; o.ExcludeMetal == nil { + o.nullFields = append(o.nullFields, "ExcludeMetal") + } + return o +} + +func (o *Filters) SetHypervisor(v []string) *Filters { + if o.Hypervisor = v; o.Hypervisor == nil { + o.nullFields = append(o.nullFields, "Hypervisor") + } + return o +} + +func (o *Filters) SetIncludeFamilies(v []string) *Filters { + if o.IncludeFamilies = v; o.IncludeFamilies == nil { + o.nullFields = append(o.nullFields, "IncludeFamilies") + } + return o +} + +func (o *Filters) SetIsEnaSupported(v *bool) *Filters { + if o.IsEnaSupported = v; o.IsEnaSupported == nil { + o.nullFields = append(o.nullFields, "IsEnaSupported") + } + return o +} + +func (o *Filters) SetMaxGpu(v *int) *Filters { + if o.MaxGpu = v; o.MaxGpu == nil { + o.nullFields = append(o.nullFields, "MaxGpu") + } + return o +} + +func (o *Filters) SetMaxMemoryGiB(v *float64) *Filters { + if o.MaxMemoryGiB = v; o.MaxMemoryGiB == nil { + o.nullFields = append(o.nullFields, "MaxMemoryGiB") + } + return o +} + +func (o *Filters) SetMaxNetworkPerformance(v *int) *Filters { + if o.MaxNetworkPerformance = v; o.MaxNetworkPerformance == nil { + o.nullFields = append(o.nullFields, "MaxNetworkPerformance") + } + return o +} + +func (o *Filters) SetMaxVcpu(v *int) *Filters { + if o.MaxVcpu = v; o.MaxVcpu == nil { + o.nullFields = append(o.nullFields, "MaxVcpu") + } + return o +} + +func (o *Filters) SetMinEnis(v *int) *Filters { + if o.MinEnis = v; o.MinEnis == nil { + o.nullFields = append(o.nullFields, "MinEnis") + } + return o +} + +func (o *Filters) SetMinGpu(v *int) *Filters { + if o.MinGpu = v; o.MinGpu == nil { + o.nullFields = append(o.nullFields, "MinGpu") + } + return o +} + +func (o *Filters) SetMinMemoryGiB(v *float64) *Filters { + if o.MinMemoryGiB = v; o.MinMemoryGiB == nil { + o.nullFields = append(o.nullFields, "MinMemoryGiB") + } + return o +} + +func (o *Filters) SetMinNetworkPerformance(v *int) *Filters { + if o.MinNetworkPerformance = v; o.MinNetworkPerformance == nil { + o.nullFields = append(o.nullFields, "MinNetworkPerformance") + } + return o +} + +func (o *Filters) SetMinVcpu(v *int) *Filters { + if o.MinVcpu = v; o.MinVcpu == nil { + o.nullFields = append(o.nullFields, "MinVcpu") + } + return o +} + +func (o *Filters) SetRootDeviceTypes(v []string) *Filters { + if o.RootDeviceTypes = v; o.RootDeviceTypes == nil { + o.nullFields = append(o.nullFields, "RootDeviceTypes") + } + return o +} + +func (o *Filters) SetVirtualizationTypes(v []string) *Filters { + if o.VirtualizationTypes = v; o.VirtualizationTypes == nil { + o.nullFields = append(o.nullFields, "VirtualizationTypes") + } + return o +} diff --git a/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/providers/aws/launchspec.go b/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/providers/aws/launchspec.go index 95665c9c..7b3da800 100644 --- a/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/providers/aws/launchspec.go +++ b/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/providers/aws/launchspec.go @@ -237,6 +237,7 @@ type UpdateLaunchSpecOutput struct { type DeleteLaunchSpecInput struct { LaunchSpecID *string `json:"launchSpecId,omitempty"` ForceDelete *bool `json:"-"` + DeleteNodes *bool `json:"-"` } type DeleteLaunchSpecOutput struct{} @@ -398,6 +399,9 @@ func (s *ServiceOp) DeleteLaunchSpec(ctx context.Context, input *DeleteLaunchSpe if input.ForceDelete != nil { r.Params.Set("forceDelete", strconv.FormatBool(spotinst.BoolValue(input.ForceDelete))) } + if input.DeleteNodes != nil { + r.Params.Set("deleteNodes", strconv.FormatBool(spotinst.BoolValue(input.DeleteNodes))) + } resp, err := client.RequireOK(s.Client.Do(ctx, r)) if err != nil { diff --git a/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/providers/aws/launchspec_ecs.go b/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/providers/aws/launchspec_ecs.go index fa67f1a9..381a5378 100644 --- a/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/providers/aws/launchspec_ecs.go +++ b/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/providers/aws/launchspec_ecs.go @@ -26,6 +26,8 @@ type ECSLaunchSpec struct { BlockDeviceMappings []*ECSBlockDeviceMapping `json:"blockDeviceMappings,omitempty"` Tags []*Tag `json:"tags,omitempty"` InstanceTypes []string `json:"instanceTypes,omitempty"` + PreferredSpotTypes []string `json:"preferredSpotTypes,omitempty"` + Strategy *ECSLaunchSpecStrategy `json:"strategy,omitempty"` RestrictScaleDown *bool `json:"restrictScaleDown,omitempty"` SubnetIDs []string `json:"subnetIds,omitempty"` LaunchSpecScheduling *ECSLaunchSpecScheduling `json:"scheduling,omitempty"` @@ -109,6 +111,13 @@ type ECSDynamicVolumeSize struct { nullFields []string } +type ECSLaunchSpecStrategy struct { + SpotPercentage *int `json:"spotPercentage,omitempty"` + + forceSendFields []string + nullFields []string +} + type ECSLaunchSpecScheduling struct { Tasks []*ECSLaunchSpecTask `json:"tasks,omitempty"` @@ -433,6 +442,13 @@ func (o *ECSLaunchSpec) SetInstanceTypes(v []string) *ECSLaunchSpec { return o } +func (o *ECSLaunchSpec) SetPreferredSpotTypes(v []string) *ECSLaunchSpec { + if o.PreferredSpotTypes = v; o.PreferredSpotTypes == nil { + o.nullFields = append(o.nullFields, "PreferredSpotTypes") + } + return o +} + func (o *ECSLaunchSpec) SetRestrictScaleDown(v *bool) *ECSLaunchSpec { if o.RestrictScaleDown = v; o.RestrictScaleDown == nil { o.nullFields = append(o.nullFields, "RestrictScaleDown") @@ -454,6 +470,13 @@ func (o *ECSLaunchSpec) SetScheduling(v *ECSLaunchSpecScheduling) *ECSLaunchSpec return o } +func (o *ECSLaunchSpec) SetStrategy(v *ECSLaunchSpecStrategy) *ECSLaunchSpec { + if o.Strategy = v; o.Strategy == nil { + o.nullFields = append(o.nullFields, "ECSLaunchSpecStrategy") + } + return o +} + // endregion // region Attributes @@ -670,6 +693,23 @@ func (o *ECSDynamicVolumeSize) SetSizePerResourceUnit(v *int) *ECSDynamicVolumeS // endregion +// region LaunchSpecStrategy + +func (o ECSLaunchSpecStrategy) MarshalJSON() ([]byte, error) { + type noMethod ECSLaunchSpecStrategy + raw := noMethod(o) + return jsonutil.MarshalJSON(raw, o.forceSendFields, o.nullFields) +} + +func (o *ECSLaunchSpecStrategy) SetSpotPercentage(v *int) *ECSLaunchSpecStrategy { + if o.SpotPercentage = v; o.SpotPercentage == nil { + o.nullFields = append(o.nullFields, "SpotPercentage") + } + return o +} + +// endregion + //region Scheduling func (o ECSLaunchSpecScheduling) MarshalJSON() ([]byte, error) { diff --git a/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/spark/cluster.go b/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/spark/cluster.go index 17fb0f86..5dbfa5ce 100644 --- a/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/spark/cluster.go +++ b/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/spark/cluster.go @@ -59,8 +59,47 @@ type WebhookConfig struct { } type IngressConfig struct { + // Deprecated: Use LoadBalancer.ServiceAnnotations instead. ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"` - DeployIngress *bool `json:"deployIngress,omitempty"` + // Deprecated: Has no effect. + DeployIngress *bool `json:"deployIngress,omitempty"` + + Controller *IngressConfigController `json:"controller,omitempty"` + CustomEndpoint *IngressConfigCustomEndpoint `json:"customEndpoint,omitempty"` + LoadBalancer *IngressConfigLoadBalancer `json:"loadBalancer,omitempty"` + PrivateLink *IngressConfigPrivateLink `json:"privateLink,omitempty"` + + forceSendFields []string + nullFields []string +} + +type IngressConfigController struct { + Managed *bool `json:"managed,omitempty"` + + forceSendFields []string + nullFields []string +} + +type IngressConfigCustomEndpoint struct { + Enabled *bool `json:"enabled,omitempty"` + Address *string `json:"address,omitempty"` + + forceSendFields []string + nullFields []string +} + +type IngressConfigLoadBalancer struct { + Managed *bool `json:"managed,omitempty"` + TargetGroupARN *string `json:"targetGroupArn,omitempty"` + ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"` + + forceSendFields []string + nullFields []string +} + +type IngressConfigPrivateLink struct { + Enabled *bool `json:"enabled,omitempty"` + VPCEndpointService *string `json:"vpcEndpointService,omitempty"` forceSendFields []string nullFields []string @@ -190,6 +229,130 @@ func (i *IngressConfig) SetDeployIngress(v *bool) *IngressConfig { return i } +func (i *IngressConfig) SetController(c *IngressConfigController) *IngressConfig { + if i.Controller = c; i.Controller == nil { + i.nullFields = append(i.nullFields, "Controller") + } + return i +} + +func (i *IngressConfig) SetLoadBalancer(lb *IngressConfigLoadBalancer) *IngressConfig { + if i.LoadBalancer = lb; i.LoadBalancer == nil { + i.nullFields = append(i.nullFields, "LoadBalancer") + } + return i +} + +func (i *IngressConfig) SetCustomEndpoint(ce *IngressConfigCustomEndpoint) *IngressConfig { + if i.CustomEndpoint = ce; i.CustomEndpoint == nil { + i.nullFields = append(i.nullFields, "CustomEndpoint") + } + return i +} + +func (i *IngressConfig) SetPrivateLink(pl *IngressConfigPrivateLink) *IngressConfig { + if i.PrivateLink = pl; i.PrivateLink == nil { + i.nullFields = append(i.nullFields, "PrivateLink") + } + return i +} + +// region Ingress controller + +func (c IngressConfigController) MarshalJSON() ([]byte, error) { + type noMethod IngressConfigController + raw := noMethod(c) + return jsonutil.MarshalJSON(raw, c.forceSendFields, c.nullFields) +} + +func (c *IngressConfigController) SetManaged(v *bool) *IngressConfigController { + if c.Managed = v; c.Managed == nil { + c.nullFields = append(c.nullFields, "Managed") + } + return c +} + +// endregion + +// region Ingress load balancer + +func (lb IngressConfigLoadBalancer) MarshalJSON() ([]byte, error) { + type noMethod IngressConfigLoadBalancer + raw := noMethod(lb) + return jsonutil.MarshalJSON(raw, lb.forceSendFields, lb.nullFields) +} + +func (lb *IngressConfigLoadBalancer) SetManaged(v *bool) *IngressConfigLoadBalancer { + if lb.Managed = v; lb.Managed == nil { + lb.nullFields = append(lb.nullFields, "Managed") + } + return lb +} + +func (lb *IngressConfigLoadBalancer) SetTargetGroupARN(v *string) *IngressConfigLoadBalancer { + if lb.TargetGroupARN = v; lb.TargetGroupARN == nil { + lb.nullFields = append(lb.nullFields, "TargetGroupARN") + } + return lb +} + +func (lb *IngressConfigLoadBalancer) SetServiceAnnotations(v map[string]string) *IngressConfigLoadBalancer { + if lb.ServiceAnnotations = v; lb.ServiceAnnotations == nil { + lb.nullFields = append(lb.nullFields, "ServiceAnnotations") + } + return lb +} + +// endregion + +// region Ingress custom endpoint + +func (ce IngressConfigCustomEndpoint) MarshalJSON() ([]byte, error) { + type noMethod IngressConfigCustomEndpoint + raw := noMethod(ce) + return jsonutil.MarshalJSON(raw, ce.forceSendFields, ce.nullFields) +} + +func (ce *IngressConfigCustomEndpoint) SetEnabled(v *bool) *IngressConfigCustomEndpoint { + if ce.Enabled = v; ce.Enabled == nil { + ce.nullFields = append(ce.nullFields, "Enabled") + } + return ce +} + +func (ce *IngressConfigCustomEndpoint) SetAddress(v *string) *IngressConfigCustomEndpoint { + if ce.Address = v; ce.Address == nil { + ce.nullFields = append(ce.nullFields, "Address") + } + return ce +} + +// endregion + +// region Ingress private link + +func (pl IngressConfigPrivateLink) MarshalJSON() ([]byte, error) { + type noMethod IngressConfigPrivateLink + raw := noMethod(pl) + return jsonutil.MarshalJSON(raw, pl.forceSendFields, pl.nullFields) +} + +func (pl *IngressConfigPrivateLink) SetEnabled(v *bool) *IngressConfigPrivateLink { + if pl.Enabled = v; pl.Enabled == nil { + pl.nullFields = append(pl.nullFields, "Enabled") + } + return pl +} + +func (pl *IngressConfigPrivateLink) SetVPCEndpointService(v *string) *IngressConfigPrivateLink { + if pl.VPCEndpointService = v; pl.VPCEndpointService == nil { + pl.nullFields = append(pl.nullFields, "VPCEndpointService") + } + return pl +} + +// endregion + // endregion // region Webhook diff --git a/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/spark/spark.go b/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/spark/spark.go index c14ebb9e..bb9f0a60 100644 --- a/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/spark/spark.go +++ b/vendor/github.com/spotinst/spotinst-sdk-go/service/ocean/spark/spark.go @@ -11,7 +11,7 @@ import ( "net/http" ) -//region Cluster +// region Cluster func (s *ServiceOp) ListClusters(ctx context.Context, input *ListClustersInput) (*ListClustersOutput, error) { r := client.NewRequest(http.MethodGet, "/ocean/spark/cluster") @@ -178,7 +178,7 @@ func clusterFromJSON(in []byte) (*Cluster, error) { //endregion -//region Virtual Node Group +// region Virtual Node Group func (s *ServiceOp) DetachVirtualNodeGroup(ctx context.Context, input *DetachVngInput) (*DetachVngOutput, error) { if input == nil { return nil, fmt.Errorf("input is nil") diff --git a/vendor/github.com/spotinst/spotinst-sdk-go/spotinst/util/jsonutil/json.go b/vendor/github.com/spotinst/spotinst-sdk-go/spotinst/util/jsonutil/json.go index 387bfdbe..e6a3ae66 100644 --- a/vendor/github.com/spotinst/spotinst-sdk-go/spotinst/util/jsonutil/json.go +++ b/vendor/github.com/spotinst/spotinst-sdk-go/spotinst/util/jsonutil/json.go @@ -14,9 +14,10 @@ import ( // MarshalJSON returns a JSON encoding of schema containing only selected fields. // A field is selected if any of the following is true: -// * it has a non-empty value -// * its field name is present in forceSendFields and it is not a nil pointer or nil interface -// * its field name is present in nullFields. +// - it has a non-empty value +// - its field name is present in forceSendFields and it is not a nil pointer or nil interface +// - its field name is present in nullFields. +// // The JSON key for each selected field is taken from the field's json: struct tag. func MarshalJSON(schema interface{}, forceSendFields, nullFields []string) ([]byte, error) { mustInclude := make(map[string]struct{}) diff --git a/vendor/github.com/spotinst/spotinst-sdk-go/spotinst/util/uritemplates/uritemplates.go b/vendor/github.com/spotinst/spotinst-sdk-go/spotinst/util/uritemplates/uritemplates.go index f6b208cc..6f2e00ab 100644 --- a/vendor/github.com/spotinst/spotinst-sdk-go/spotinst/util/uritemplates/uritemplates.go +++ b/vendor/github.com/spotinst/spotinst-sdk-go/spotinst/util/uritemplates/uritemplates.go @@ -14,7 +14,6 @@ // values["repo"] = "uritemplates" // expanded, _ := template.ExpandString(values) // fmt.Printf(expanded) -// package uritemplates import ( diff --git a/vendor/github.com/spotinst/spotinst-sdk-go/spotinst/version.go b/vendor/github.com/spotinst/spotinst-sdk-go/spotinst/version.go index a91393d6..2c6aa3c6 100644 --- a/vendor/github.com/spotinst/spotinst-sdk-go/spotinst/version.go +++ b/vendor/github.com/spotinst/spotinst-sdk-go/spotinst/version.go @@ -1,7 +1,7 @@ package spotinst // SDKVersion is the current version of the SDK. -const SDKVersion = "1.128.0" +const SDKVersion = "1.334.0" // SDKName is the name of the SDK. const SDKName = "spotinst-sdk-go" diff --git a/vendor/github.com/stretchr/testify/assert/assertion_compare.go b/vendor/github.com/stretchr/testify/assert/assertion_compare.go index 3bb22a97..95d8e59d 100644 --- a/vendor/github.com/stretchr/testify/assert/assertion_compare.go +++ b/vendor/github.com/stretchr/testify/assert/assertion_compare.go @@ -1,6 +1,7 @@ package assert import ( + "bytes" "fmt" "reflect" "time" @@ -32,7 +33,8 @@ var ( stringType = reflect.TypeOf("") - timeType = reflect.TypeOf(time.Time{}) + timeType = reflect.TypeOf(time.Time{}) + bytesType = reflect.TypeOf([]byte{}) ) func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { @@ -323,6 +325,26 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { return compare(timeObj1.UnixNano(), timeObj2.UnixNano(), reflect.Int64) } + case reflect.Slice: + { + // We only care about the []byte type. + if !canConvert(obj1Value, bytesType) { + break + } + + // []byte can be compared! + bytesObj1, ok := obj1.([]byte) + if !ok { + bytesObj1 = obj1Value.Convert(bytesType).Interface().([]byte) + + } + bytesObj2, ok := obj2.([]byte) + if !ok { + bytesObj2 = obj2Value.Convert(bytesType).Interface().([]byte) + } + + return CompareType(bytes.Compare(bytesObj1, bytesObj2)), true + } } return compareEqual, false diff --git a/vendor/github.com/stretchr/testify/assert/assertion_format.go b/vendor/github.com/stretchr/testify/assert/assertion_format.go index 27e2420e..7880b8f9 100644 --- a/vendor/github.com/stretchr/testify/assert/assertion_format.go +++ b/vendor/github.com/stretchr/testify/assert/assertion_format.go @@ -736,6 +736,16 @@ func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta tim return WithinDuration(t, expected, actual, delta, append([]interface{}{msg}, args...)...) } +// WithinRangef asserts that a time is within a time range (inclusive). +// +// assert.WithinRangef(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted") +func WithinRangef(t TestingT, actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return WithinRange(t, actual, start, end, append([]interface{}{msg}, args...)...) +} + // YAMLEqf asserts that two YAML strings are equivalent. func YAMLEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { diff --git a/vendor/github.com/stretchr/testify/assert/assertion_forward.go b/vendor/github.com/stretchr/testify/assert/assertion_forward.go index d9ea368d..339515b8 100644 --- a/vendor/github.com/stretchr/testify/assert/assertion_forward.go +++ b/vendor/github.com/stretchr/testify/assert/assertion_forward.go @@ -1461,6 +1461,26 @@ func (a *Assertions) WithinDurationf(expected time.Time, actual time.Time, delta return WithinDurationf(a.t, expected, actual, delta, msg, args...) } +// WithinRange asserts that a time is within a time range (inclusive). +// +// a.WithinRange(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second)) +func (a *Assertions) WithinRange(actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return WithinRange(a.t, actual, start, end, msgAndArgs...) +} + +// WithinRangef asserts that a time is within a time range (inclusive). +// +// a.WithinRangef(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted") +func (a *Assertions) WithinRangef(actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return WithinRangef(a.t, actual, start, end, msg, args...) +} + // YAMLEq asserts that two YAML strings are equivalent. func (a *Assertions) YAMLEq(expected string, actual string, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { diff --git a/vendor/github.com/stretchr/testify/assert/assertions.go b/vendor/github.com/stretchr/testify/assert/assertions.go index 0357b223..fa1245b1 100644 --- a/vendor/github.com/stretchr/testify/assert/assertions.go +++ b/vendor/github.com/stretchr/testify/assert/assertions.go @@ -8,6 +8,7 @@ import ( "fmt" "math" "os" + "path/filepath" "reflect" "regexp" "runtime" @@ -144,7 +145,8 @@ func CallerInfo() []string { if len(parts) > 1 { dir := parts[len(parts)-2] if (dir != "assert" && dir != "mock" && dir != "require") || file == "mock_test.go" { - callers = append(callers, fmt.Sprintf("%s:%d", file, line)) + path, _ := filepath.Abs(file) + callers = append(callers, fmt.Sprintf("%s:%d", path, line)) } } @@ -563,16 +565,17 @@ func isEmpty(object interface{}) bool { switch objValue.Kind() { // collection types are empty when they have no element - case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice: + case reflect.Chan, reflect.Map, reflect.Slice: return objValue.Len() == 0 - // pointers are empty if nil or if the value they point to is empty + // pointers are empty if nil or if the value they point to is empty case reflect.Ptr: if objValue.IsNil() { return true } deref := objValue.Elem().Interface() return isEmpty(deref) - // for all other types, compare against the zero value + // for all other types, compare against the zero value + // array types are empty when they match their zero-initialized state default: zero := reflect.Zero(objValue.Type()) return reflect.DeepEqual(object, zero.Interface()) @@ -815,7 +818,6 @@ func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok return true // we consider nil to be equal to the nil set } - subsetValue := reflect.ValueOf(subset) defer func() { if e := recover(); e != nil { ok = false @@ -825,14 +827,32 @@ func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok listKind := reflect.TypeOf(list).Kind() subsetKind := reflect.TypeOf(subset).Kind() - if listKind != reflect.Array && listKind != reflect.Slice { + if listKind != reflect.Array && listKind != reflect.Slice && listKind != reflect.Map { return Fail(t, fmt.Sprintf("%q has an unsupported type %s", list, listKind), msgAndArgs...) } - if subsetKind != reflect.Array && subsetKind != reflect.Slice { + if subsetKind != reflect.Array && subsetKind != reflect.Slice && listKind != reflect.Map { return Fail(t, fmt.Sprintf("%q has an unsupported type %s", subset, subsetKind), msgAndArgs...) } + subsetValue := reflect.ValueOf(subset) + if subsetKind == reflect.Map && listKind == reflect.Map { + listValue := reflect.ValueOf(list) + subsetKeys := subsetValue.MapKeys() + + for i := 0; i < len(subsetKeys); i++ { + subsetKey := subsetKeys[i] + subsetElement := subsetValue.MapIndex(subsetKey).Interface() + listElement := listValue.MapIndex(subsetKey).Interface() + + if !ObjectsAreEqual(subsetElement, listElement) { + return Fail(t, fmt.Sprintf("\"%s\" does not contain \"%s\"", list, subsetElement), msgAndArgs...) + } + } + + return true + } + for i := 0; i < subsetValue.Len(); i++ { element := subsetValue.Index(i).Interface() ok, found := containsElement(list, element) @@ -859,7 +879,6 @@ func NotSubset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) return Fail(t, "nil is the empty set which is a subset of every set", msgAndArgs...) } - subsetValue := reflect.ValueOf(subset) defer func() { if e := recover(); e != nil { ok = false @@ -869,14 +888,32 @@ func NotSubset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) listKind := reflect.TypeOf(list).Kind() subsetKind := reflect.TypeOf(subset).Kind() - if listKind != reflect.Array && listKind != reflect.Slice { + if listKind != reflect.Array && listKind != reflect.Slice && listKind != reflect.Map { return Fail(t, fmt.Sprintf("%q has an unsupported type %s", list, listKind), msgAndArgs...) } - if subsetKind != reflect.Array && subsetKind != reflect.Slice { + if subsetKind != reflect.Array && subsetKind != reflect.Slice && listKind != reflect.Map { return Fail(t, fmt.Sprintf("%q has an unsupported type %s", subset, subsetKind), msgAndArgs...) } + subsetValue := reflect.ValueOf(subset) + if subsetKind == reflect.Map && listKind == reflect.Map { + listValue := reflect.ValueOf(list) + subsetKeys := subsetValue.MapKeys() + + for i := 0; i < len(subsetKeys); i++ { + subsetKey := subsetKeys[i] + subsetElement := subsetValue.MapIndex(subsetKey).Interface() + listElement := listValue.MapIndex(subsetKey).Interface() + + if !ObjectsAreEqual(subsetElement, listElement) { + return true + } + } + + return Fail(t, fmt.Sprintf("%q is a subset of %q", subset, list), msgAndArgs...) + } + for i := 0; i < subsetValue.Len(); i++ { element := subsetValue.Index(i).Interface() ok, found := containsElement(list, element) @@ -1109,6 +1146,27 @@ func WithinDuration(t TestingT, expected, actual time.Time, delta time.Duration, return true } +// WithinRange asserts that a time is within a time range (inclusive). +// +// assert.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second)) +func WithinRange(t TestingT, actual, start, end time.Time, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + + if end.Before(start) { + return Fail(t, "Start should be before end", msgAndArgs...) + } + + if actual.Before(start) { + return Fail(t, fmt.Sprintf("Time %v expected to be in time range %v to %v, but is before the range", actual, start, end), msgAndArgs...) + } else if actual.After(end) { + return Fail(t, fmt.Sprintf("Time %v expected to be in time range %v to %v, but is after the range", actual, start, end), msgAndArgs...) + } + + return true +} + func toFloat(x interface{}) (float64, bool) { var xf float64 xok := true diff --git a/vendor/gopkg.in/ini.v1/deprecated.go b/vendor/gopkg.in/ini.v1/deprecated.go index e8bda06e..48b8e66d 100644 --- a/vendor/gopkg.in/ini.v1/deprecated.go +++ b/vendor/gopkg.in/ini.v1/deprecated.go @@ -14,12 +14,9 @@ package ini -const ( +var ( // Deprecated: Use "DefaultSection" instead. DEFAULT_SECTION = DefaultSection -) - -var ( // Deprecated: AllCapsUnderscore converts to format ALL_CAPS_UNDERSCORE. AllCapsUnderscore = SnackCase ) diff --git a/vendor/gopkg.in/ini.v1/ini.go b/vendor/gopkg.in/ini.v1/ini.go index ac2a93a5..99e7f865 100644 --- a/vendor/gopkg.in/ini.v1/ini.go +++ b/vendor/gopkg.in/ini.v1/ini.go @@ -23,15 +23,15 @@ import ( ) const ( - // DefaultSection is the name of default section. You can use this constant or the string literal. - // In most of cases, an empty string is all you need to access the section. - DefaultSection = "DEFAULT" - // Maximum allowed depth when recursively substituing variable names. depthValues = 99 ) var ( + // DefaultSection is the name of default section. You can use this var or the string literal. + // In most of cases, an empty string is all you need to access the section. + DefaultSection = "DEFAULT" + // LineBreak is the delimiter to determine or compose a new line. // This variable will be changed to "\r\n" automatically on Windows at package init time. LineBreak = "\n" diff --git a/vendor/modules.txt b/vendor/modules.txt index 6f082222..752a9cf3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -184,7 +184,7 @@ github.com/spf13/cobra # github.com/spf13/pflag v1.0.5 ## explicit github.com/spf13/pflag -# github.com/spotinst/spotinst-sdk-go v1.128.0 +# github.com/spotinst/spotinst-sdk-go v1.334.0 ## explicit github.com/spotinst/spotinst-sdk-go/service/ocean github.com/spotinst/spotinst-sdk-go/service/ocean/providers/aws @@ -200,7 +200,7 @@ github.com/spotinst/spotinst-sdk-go/spotinst/session github.com/spotinst/spotinst-sdk-go/spotinst/util/jsonutil github.com/spotinst/spotinst-sdk-go/spotinst/util/uritemplates github.com/spotinst/spotinst-sdk-go/spotinst/util/useragent -# github.com/stretchr/testify v1.7.2 +# github.com/stretchr/testify v1.8.1 ## explicit github.com/stretchr/testify/assert # github.com/ulikunitz/xz v0.5.9 @@ -279,7 +279,8 @@ google.golang.org/protobuf/types/known/timestamppb ## explicit # gopkg.in/inf.v0 v0.9.1 gopkg.in/inf.v0 -# gopkg.in/ini.v1 v1.66.6 +# gopkg.in/ini.v1 v1.67.0 +## explicit gopkg.in/ini.v1 # gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v2