Skip to content

Commit

Permalink
refactor: drop supported package
Browse files Browse the repository at this point in the history
  • Loading branch information
lzap committed Sep 6, 2023
1 parent f2faf47 commit ceb9b19
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 582 deletions.
7 changes: 4 additions & 3 deletions internal/clients/architecture.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package clients

import (
"context"
"errors"
"fmt"

"github.com/RHEnVision/provisioning-backend/internal/clients/supported"
)

type ArchitectureType string
Expand All @@ -17,6 +16,8 @@ const (
ArchitectureTypeAppleArm64 ArchitectureType = "apple-arm64"
)

var ErrArchitectureNotSupported = errors.New("architecture is not supported")

func (at *ArchitectureType) String() string {
return string(*at)
}
Expand All @@ -34,5 +35,5 @@ func MapArchitectures(_ context.Context, arch string) (ArchitectureType, error)
case arch == "aarch64" || arch == "arm64" || arch == "Arm64" || arch == "arm":
return ArchitectureTypeArm64, nil
}
return "", fmt.Errorf("%s: %w", arch, supported.ErrArchitectureNotSupported)
return "", fmt.Errorf("%s: %w", arch, ErrArchitectureNotSupported)
}
3 changes: 1 addition & 2 deletions internal/clients/http/ec2/aws_supported_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"

"github.com/RHEnVision/provisioning-backend/internal/clients"
"github.com/RHEnVision/provisioning-backend/internal/clients/supported"
"github.com/aws/aws-sdk-go-v2/service/ec2/types"
"github.com/rs/zerolog"
)
Expand All @@ -27,7 +26,7 @@ func NewInstanceTypes(ctx context.Context, types []types.InstanceTypeInfo) ([]*c
Cores: *types[i].VCpuInfo.DefaultCores,
MemoryMiB: *types[i].MemoryInfo.SizeInMiB,
Architecture: arch,
Supported: supported.IsSupported(string(types[i].InstanceType)),
Supported: *types[i].MemoryInfo.SizeInMiB >= 2000,
}
if types[i].InstanceStorageInfo != nil {
it.EphemeralStorageGB = *types[i].InstanceStorageInfo.TotalSizeInGB
Expand Down
41 changes: 0 additions & 41 deletions internal/clients/supported/filter_instances.go

This file was deleted.

87 changes: 0 additions & 87 deletions internal/clients/supported/filter_instances_test.go

This file was deleted.

3 changes: 0 additions & 3 deletions internal/clients/supported/package.go

This file was deleted.

Loading

0 comments on commit ceb9b19

Please sign in to comment.