refactor: move ecr resource owner to domain

This commit is contained in:
joshsiv-mulga
2026-10-01 14:35:36 +10:00
parent a010f731e0
commit 93084043a9
40 changed files with 38 additions and 36 deletions
+1 -1
View File
@@ -40,6 +40,7 @@ import (
"github.com/mulgadc/spinifex/spinifex/bootstrap/preflight"
"github.com/mulgadc/spinifex/spinifex/clustersize"
"github.com/mulgadc/spinifex/spinifex/domains/ec2/instancetypes"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
"github.com/mulgadc/spinifex/spinifex/foundation/state/kvutil"
"github.com/mulgadc/spinifex/spinifex/foundation/telemetry"
@@ -62,7 +63,6 @@ import (
handlers_ec2_tags "github.com/mulgadc/spinifex/spinifex/handlers/ec2/tags"
handlers_ec2_volume "github.com/mulgadc/spinifex/spinifex/handlers/ec2/volume"
handlers_ec2_vpc "github.com/mulgadc/spinifex/spinifex/handlers/ec2/vpc"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
handlers_ecs "github.com/mulgadc/spinifex/spinifex/handlers/ecs"
handlers_eks "github.com/mulgadc/spinifex/spinifex/handlers/eks"
handlers_elbv2 "github.com/mulgadc/spinifex/spinifex/handlers/elbv2"
@@ -1,7 +1,9 @@
// Package ecr holds the ECR registry handlers and the predastore storage
// layout that backs them. v1 stores everything for one account in a single
// per-account bucket; blobs are content-addressable and deduplicated per
// account, while manifests and tags are indexed per repository.
// Package ecr owns ECR repository and blob semantics, including the
// S3-compatible storage layout that backs registry data. v1 stores everything
// for one account in a single per-account bucket; blobs are content-addressable
// and deduplicated per account, while manifests and tags are indexed per
// repository. Generic gateway packages own HTTP and SigV4 mechanics and reach
// this domain through its explicit service and metadata interfaces.
package ecr
import (
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"log/slog"
"time"
"github.com/mulgadc/spinifex/spinifex/handlers/ecr"
"github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/telemetry"
)
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"testing"
"time"
"github.com/mulgadc/spinifex/spinifex/handlers/ecr"
"github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
+1 -1
View File
@@ -21,7 +21,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/mulgadc/spinifex/spinifex/handlers/ecr"
"github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/providers/objectstore"
)
@@ -7,7 +7,7 @@ import (
"net/http"
"testing"
"github.com/mulgadc/spinifex/spinifex/handlers/ecr"
"github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/providers/objectstore"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+1 -1
View File
@@ -13,7 +13,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/mulgadc/spinifex/spinifex/handlers/ecr"
"github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/providers/objectstore"
)
+1 -1
View File
@@ -11,7 +11,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/mulgadc/spinifex/internal/testkit"
"github.com/mulgadc/spinifex/spinifex/handlers/ecr"
"github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/providers/objectstore"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+1 -1
View File
@@ -13,7 +13,7 @@ import (
"strings"
"testing"
"github.com/mulgadc/spinifex/spinifex/handlers/ecr"
"github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/providers/objectstore"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"testing"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/mulgadc/spinifex/spinifex/handlers/ecr"
"github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/providers/objectstore"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -9,9 +9,9 @@ import (
"testing"
"time"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
"github.com/mulgadc/spinifex/internal/testkit"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
"github.com/nats-io/nats.go"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+1 -1
View File
@@ -10,9 +10,9 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ecr"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
gateway_ecrapi "github.com/mulgadc/spinifex/spinifex/gateway/ecrapi"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
)
// createRepositoryRequest is the camelCase AWS JSON 1.1 input shape. ecr.Tag
+1 -1
View File
@@ -8,9 +8,9 @@ import (
"net/http"
"github.com/aws/aws-sdk-go/service/ecr"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
gateway_ecrapi "github.com/mulgadc/spinifex/spinifex/gateway/ecrapi"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
)
// deleteRepositoryRequest is the camelCase AWS JSON 1.1 input shape. force=true
+1 -1
View File
@@ -8,9 +8,9 @@ import (
"net/http"
"github.com/aws/aws-sdk-go/service/ecr"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
gateway_ecrapi "github.com/mulgadc/spinifex/spinifex/gateway/ecrapi"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
)
// describeRepositoriesRequest is the camelCase AWS JSON 1.1 input shape. The SDK
@@ -9,8 +9,8 @@ import (
"testing"
"time"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
"github.com/mulgadc/spinifex/internal/testkit"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/utils"
"github.com/nats-io/nats.go"
"github.com/stretchr/testify/assert"
+1 -1
View File
@@ -11,10 +11,10 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ecr"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
gateway_ecr "github.com/mulgadc/spinifex/spinifex/gateway/ecr"
gateway_ecrapi "github.com/mulgadc/spinifex/spinifex/gateway/ecrapi"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
)
// maxImageBatch is the per-call cap on imageIds for the batch image actions.
+1 -1
View File
@@ -10,9 +10,9 @@ import (
"testing"
"github.com/aws/aws-sdk-go/service/ecr"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
gateway_ecr "github.com/mulgadc/spinifex/spinifex/gateway/ecr"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
"github.com/mulgadc/spinifex/spinifex/providers/objectstore"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+1 -1
View File
@@ -7,9 +7,9 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ecr"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
gateway_ecrapi "github.com/mulgadc/spinifex/spinifex/gateway/ecrapi"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
)
// lifecyclePreviewRequest is the camelCase AWS JSON 1.1 input shared by the two
+1 -1
View File
@@ -3,7 +3,7 @@ package gateway
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ecr"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
)
// buildRepository projects a RepoMeta record into the AWS *ecr.Repository
+1 -1
View File
@@ -9,9 +9,9 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ecr"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
gateway_ecrapi "github.com/mulgadc/spinifex/spinifex/gateway/ecrapi"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
)
// putImageTagMutabilityRequest is the camelCase AWS JSON 1.1 input shape.
+1 -1
View File
@@ -7,8 +7,8 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ecr"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
"github.com/nats-io/nats.go"
)
+1 -1
View File
@@ -7,8 +7,8 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ecr"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
"github.com/nats-io/nats.go"
)
@@ -6,9 +6,9 @@ import (
"testing"
"github.com/aws/aws-sdk-go/service/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
"github.com/mulgadc/spinifex/internal/testkit"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
"github.com/nats-io/nats.go"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+1 -1
View File
@@ -7,8 +7,8 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ecr"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
"github.com/nats-io/nats.go"
)
@@ -8,9 +8,9 @@ import (
"time"
"github.com/aws/aws-sdk-go/service/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
"github.com/mulgadc/spinifex/internal/testkit"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
"github.com/mulgadc/spinifex/spinifex/utils"
"github.com/nats-io/nats.go"
"github.com/stretchr/testify/assert"
+1 -1
View File
@@ -9,8 +9,8 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ecr"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
"github.com/nats-io/nats.go"
)
+1 -1
View File
@@ -6,8 +6,8 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ecr"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
)
// repositoryNamePattern is the expression AWS names when it refuses a
+1 -1
View File
@@ -22,6 +22,7 @@ import (
"github.com/mulgadc/spinifex/spinifex/admin"
"github.com/mulgadc/spinifex/spinifex/bootstrap/config"
"github.com/mulgadc/spinifex/spinifex/daemon"
"github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/foundation/lifecycle/reconciler"
"github.com/mulgadc/spinifex/spinifex/foundation/state/kvstore"
"github.com/mulgadc/spinifex/spinifex/foundation/state/kvutil"
@@ -32,7 +33,6 @@ import (
gateway_ecrauth "github.com/mulgadc/spinifex/spinifex/gateway/ecrauth"
handlers_bedrock "github.com/mulgadc/spinifex/spinifex/handlers/bedrock"
handlers_ec2_instance "github.com/mulgadc/spinifex/spinifex/handlers/ec2/instance"
"github.com/mulgadc/spinifex/spinifex/handlers/ecr"
handlers_iam "github.com/mulgadc/spinifex/spinifex/handlers/iam"
handlers_ochrevector "github.com/mulgadc/spinifex/spinifex/handlers/ochrevector"
handlers_quota "github.com/mulgadc/spinifex/spinifex/handlers/quota"
+1 -1
View File
@@ -5,7 +5,7 @@ package integration
import (
"testing"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/nats-io/nats.go"
)
+1 -1
View File
@@ -33,11 +33,11 @@ import (
"github.com/aws/aws-sdk-go/service/iam"
"github.com/aws/aws-sdk-go/service/sts"
clusterv1 "github.com/mulgadc/spinifex/contracts/cluster/v1"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/domains/ecr"
"github.com/mulgadc/spinifex/spinifex/gateway"
gateway_bedrock "github.com/mulgadc/spinifex/spinifex/gateway/bedrock"
gateway_ecr "github.com/mulgadc/spinifex/spinifex/gateway/ecr"
gateway_ecrauth "github.com/mulgadc/spinifex/spinifex/gateway/ecrauth"
handlers_ecr "github.com/mulgadc/spinifex/spinifex/handlers/ecr"
handlers_iam "github.com/mulgadc/spinifex/spinifex/handlers/iam"
handlers_sts "github.com/mulgadc/spinifex/spinifex/handlers/sts"
"github.com/mulgadc/spinifex/spinifex/providers/objectstore"