From 55a71cc2916be9a4e579956674d9781264d2145b Mon Sep 17 00:00:00 2001 From: Amine Date: Mon, 23 Dec 2024 16:22:22 -0400 Subject: [PATCH] refactor: move core packages from internal to pkg directory Move controller, graph, metadata, and runtime packages from `internal/` to `pkg/` directory to make them available for external consumption. --- cmd/controller/main.go | 4 ++-- .../controller/instance/controller.go | 4 ++-- .../controller/instance/controller_reconcile.go | 4 ++-- .../controller/instance/controller_status.go | 0 .../controller/instance/instance_state.go | 0 {internal => pkg}/controller/instance/metrics.go | 0 .../controller/resourcegroup/controller.go | 4 ++-- .../controller/resourcegroup/controller_cleanup.go | 2 +- .../resourcegroup/controller_reconcile.go | 6 +++--- .../controller/resourcegroup/controller_status.go | 2 +- pkg/dynamiccontroller/dynamic_controller.go | 2 +- {internal => pkg}/graph/builder.go | 14 +++++++------- {internal => pkg}/graph/builder_test.go | 8 ++++---- {internal => pkg}/graph/crd/crd.go | 0 {internal => pkg}/graph/crd/defaults.go | 0 {internal => pkg}/graph/dag/dag.go | 0 {internal => pkg}/graph/dag/dag_test.go | 0 {internal => pkg}/graph/emulator/emulator.go | 0 {internal => pkg}/graph/emulator/emulator_test.go | 0 {internal => pkg}/graph/fieldpath/builder.go | 0 {internal => pkg}/graph/fieldpath/builder_test.go | 0 {internal => pkg}/graph/fieldpath/parser.go | 0 {internal => pkg}/graph/fieldpath/parser_test.go | 0 {internal => pkg}/graph/graph.go | 4 ++-- {internal => pkg}/graph/parser/cel.go | 0 {internal => pkg}/graph/parser/cel_test.go | 0 {internal => pkg}/graph/parser/conditions.go | 0 {internal => pkg}/graph/parser/conditions_test.go | 0 {internal => pkg}/graph/parser/parser.go | 2 +- {internal => pkg}/graph/parser/parser_test.go | 2 +- {internal => pkg}/graph/parser/schemaless.go | 2 +- {internal => pkg}/graph/parser/schemaless_test.go | 2 +- {internal => pkg}/graph/resource.go | 4 ++-- {internal => pkg}/graph/resource_test.go | 0 {internal => pkg}/graph/schema/conversion_cel.go | 0 .../graph/schema/conversion_schema.go | 0 {internal => pkg}/graph/schema/field_descriptor.go | 2 +- {internal => pkg}/graph/schema/resolver.go | 0 {internal => pkg}/graph/schema/schema.go | 0 {internal => pkg}/graph/validation.go | 0 {internal => pkg}/graph/validation_test.go | 0 {internal => pkg}/graph/variable/variable.go | 0 {internal => pkg}/metadata/finalizers.go | 0 {internal => pkg}/metadata/finalizers_test.go | 0 {internal => pkg}/metadata/groupversion.go | 0 {internal => pkg}/metadata/groupversion_test.go | 0 {internal => pkg}/metadata/labels.go | 0 {internal => pkg}/metadata/labels_test.go | 0 {internal => pkg}/metadata/owner_reference.go | 0 {internal => pkg}/metadata/selectors.go | 0 {internal => pkg}/runtime/interfaces.go | 2 +- {internal => pkg}/runtime/resolver/resolver.go | 4 ++-- .../runtime/resolver/resolver_test.go | 2 +- {internal => pkg}/runtime/runtime.go | 4 ++-- {internal => pkg}/runtime/runtime_test.go | 2 +- {internal => pkg}/runtime/state.go | 2 +- .../testutil/generator/resourcegroup.go | 0 {internal => pkg}/testutil/k8s/discovery.go | 0 test/integration/environment/setup.go | 6 +++--- test/integration/suites/ackekscluster/generator.go | 2 +- .../integration/suites/ackekscluster/suite_test.go | 2 +- test/integration/suites/core/conditional_test.go | 2 +- test/integration/suites/core/crd_test.go | 2 +- test/integration/suites/core/readiness_test.go | 2 +- test/integration/suites/core/recover_test.go | 2 +- test/integration/suites/core/setup_test.go | 2 +- test/integration/suites/core/status_test.go | 2 +- test/integration/suites/core/topology_test.go | 2 +- test/integration/suites/core/validation_test.go | 2 +- .../suites/deploymentservice/generator.go | 2 +- .../suites/deploymentservice/suite_test.go | 2 +- .../suites/networkingstack/generator.go | 2 +- .../suites/networkingstack/suite_test.go | 2 +- 73 files changed, 59 insertions(+), 59 deletions(-) rename {internal => pkg}/controller/instance/controller.go (99%) rename {internal => pkg}/controller/instance/controller_reconcile.go (99%) rename {internal => pkg}/controller/instance/controller_status.go (100%) rename {internal => pkg}/controller/instance/instance_state.go (100%) rename {internal => pkg}/controller/instance/metrics.go (100%) rename {internal => pkg}/controller/resourcegroup/controller.go (97%) rename {internal => pkg}/controller/resourcegroup/controller_cleanup.go (98%) rename {internal => pkg}/controller/resourcegroup/controller_reconcile.go (97%) rename {internal => pkg}/controller/resourcegroup/controller_status.go (99%) rename {internal => pkg}/graph/builder.go (98%) rename {internal => pkg}/graph/builder_test.go (99%) rename {internal => pkg}/graph/crd/crd.go (100%) rename {internal => pkg}/graph/crd/defaults.go (100%) rename {internal => pkg}/graph/dag/dag.go (100%) rename {internal => pkg}/graph/dag/dag_test.go (100%) rename {internal => pkg}/graph/emulator/emulator.go (100%) rename {internal => pkg}/graph/emulator/emulator_test.go (100%) rename {internal => pkg}/graph/fieldpath/builder.go (100%) rename {internal => pkg}/graph/fieldpath/builder_test.go (100%) rename {internal => pkg}/graph/fieldpath/parser.go (100%) rename {internal => pkg}/graph/fieldpath/parser_test.go (100%) rename {internal => pkg}/graph/graph.go (95%) rename {internal => pkg}/graph/parser/cel.go (100%) rename {internal => pkg}/graph/parser/cel_test.go (100%) rename {internal => pkg}/graph/parser/conditions.go (100%) rename {internal => pkg}/graph/parser/conditions_test.go (100%) rename {internal => pkg}/graph/parser/parser.go (99%) rename {internal => pkg}/graph/parser/parser_test.go (99%) rename {internal => pkg}/graph/parser/schemaless.go (98%) rename {internal => pkg}/graph/parser/schemaless_test.go (99%) rename {internal => pkg}/graph/resource.go (98%) rename {internal => pkg}/graph/resource_test.go (100%) rename {internal => pkg}/graph/schema/conversion_cel.go (100%) rename {internal => pkg}/graph/schema/conversion_schema.go (100%) rename {internal => pkg}/graph/schema/field_descriptor.go (99%) rename {internal => pkg}/graph/schema/resolver.go (100%) rename {internal => pkg}/graph/schema/schema.go (100%) rename {internal => pkg}/graph/validation.go (100%) rename {internal => pkg}/graph/validation_test.go (100%) rename {internal => pkg}/graph/variable/variable.go (100%) rename {internal => pkg}/metadata/finalizers.go (100%) rename {internal => pkg}/metadata/finalizers_test.go (100%) rename {internal => pkg}/metadata/groupversion.go (100%) rename {internal => pkg}/metadata/groupversion_test.go (100%) rename {internal => pkg}/metadata/labels.go (100%) rename {internal => pkg}/metadata/labels_test.go (100%) rename {internal => pkg}/metadata/owner_reference.go (100%) rename {internal => pkg}/metadata/selectors.go (100%) rename {internal => pkg}/runtime/interfaces.go (99%) rename {internal => pkg}/runtime/resolver/resolver.go (98%) rename {internal => pkg}/runtime/resolver/resolver_test.go (99%) rename {internal => pkg}/runtime/runtime.go (99%) rename {internal => pkg}/runtime/runtime_test.go (99%) rename {internal => pkg}/runtime/state.go (98%) rename {internal => pkg}/testutil/generator/resourcegroup.go (100%) rename {internal => pkg}/testutil/k8s/discovery.go (100%) diff --git a/cmd/controller/main.go b/cmd/controller/main.go index 471282a..699e553 100644 --- a/cmd/controller/main.go +++ b/cmd/controller/main.go @@ -32,10 +32,10 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" xv1alpha1 "github.com/awslabs/kro/api/v1alpha1" - resourcegroupctrl "github.com/awslabs/kro/internal/controller/resourcegroup" - "github.com/awslabs/kro/internal/graph" kroclient "github.com/awslabs/kro/pkg/client" + resourcegroupctrl "github.com/awslabs/kro/pkg/controller/resourcegroup" "github.com/awslabs/kro/pkg/dynamiccontroller" + "github.com/awslabs/kro/pkg/graph" //+kubebuilder:scaffold:imports ) diff --git a/internal/controller/instance/controller.go b/pkg/controller/instance/controller.go similarity index 99% rename from internal/controller/instance/controller.go rename to pkg/controller/instance/controller.go index cb35697..6e8d865 100644 --- a/internal/controller/instance/controller.go +++ b/pkg/controller/instance/controller.go @@ -28,9 +28,9 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "github.com/awslabs/kro/api/v1alpha1" - "github.com/awslabs/kro/internal/graph" - "github.com/awslabs/kro/internal/metadata" kroclient "github.com/awslabs/kro/pkg/client" + "github.com/awslabs/kro/pkg/graph" + "github.com/awslabs/kro/pkg/metadata" ) // ReconcileConfig holds configuration parameters for the recnociliation process. diff --git a/internal/controller/instance/controller_reconcile.go b/pkg/controller/instance/controller_reconcile.go similarity index 99% rename from internal/controller/instance/controller_reconcile.go rename to pkg/controller/instance/controller_reconcile.go index eab154b..ef1a8ae 100644 --- a/internal/controller/instance/controller_reconcile.go +++ b/pkg/controller/instance/controller_reconcile.go @@ -25,9 +25,9 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/dynamic" - "github.com/awslabs/kro/internal/metadata" - "github.com/awslabs/kro/internal/runtime" + "github.com/awslabs/kro/pkg/metadata" "github.com/awslabs/kro/pkg/requeue" + "github.com/awslabs/kro/pkg/runtime" ) // instanceGraphReconciler is responsible for reconciling a single instance and diff --git a/internal/controller/instance/controller_status.go b/pkg/controller/instance/controller_status.go similarity index 100% rename from internal/controller/instance/controller_status.go rename to pkg/controller/instance/controller_status.go diff --git a/internal/controller/instance/instance_state.go b/pkg/controller/instance/instance_state.go similarity index 100% rename from internal/controller/instance/instance_state.go rename to pkg/controller/instance/instance_state.go diff --git a/internal/controller/instance/metrics.go b/pkg/controller/instance/metrics.go similarity index 100% rename from internal/controller/instance/metrics.go rename to pkg/controller/instance/metrics.go diff --git a/internal/controller/resourcegroup/controller.go b/pkg/controller/resourcegroup/controller.go similarity index 97% rename from internal/controller/resourcegroup/controller.go rename to pkg/controller/resourcegroup/controller.go index dc69e11..15dc06c 100644 --- a/internal/controller/resourcegroup/controller.go +++ b/pkg/controller/resourcegroup/controller.go @@ -24,10 +24,10 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" "github.com/awslabs/kro/api/v1alpha1" - "github.com/awslabs/kro/internal/graph" - "github.com/awslabs/kro/internal/metadata" kroclient "github.com/awslabs/kro/pkg/client" "github.com/awslabs/kro/pkg/dynamiccontroller" + "github.com/awslabs/kro/pkg/graph" + "github.com/awslabs/kro/pkg/metadata" ) //+kubebuilder:rbac:groups=kro.run,resources=resourcegroups,verbs=get;list;watch;create;update;patch;delete diff --git a/internal/controller/resourcegroup/controller_cleanup.go b/pkg/controller/resourcegroup/controller_cleanup.go similarity index 98% rename from internal/controller/resourcegroup/controller_cleanup.go rename to pkg/controller/resourcegroup/controller_cleanup.go index 9515d5a..e863e98 100644 --- a/internal/controller/resourcegroup/controller_cleanup.go +++ b/pkg/controller/resourcegroup/controller_cleanup.go @@ -23,7 +23,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "github.com/awslabs/kro/api/v1alpha1" - "github.com/awslabs/kro/internal/metadata" + "github.com/awslabs/kro/pkg/metadata" ) // cleanupResourceGroup handles the deletion of a ResourceGroup by shutting down its associated diff --git a/internal/controller/resourcegroup/controller_reconcile.go b/pkg/controller/resourcegroup/controller_reconcile.go similarity index 97% rename from internal/controller/resourcegroup/controller_reconcile.go rename to pkg/controller/resourcegroup/controller_reconcile.go index 4ad00e5..c2004ac 100644 --- a/internal/controller/resourcegroup/controller_reconcile.go +++ b/pkg/controller/resourcegroup/controller_reconcile.go @@ -23,10 +23,10 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "github.com/awslabs/kro/api/v1alpha1" - instancectrl "github.com/awslabs/kro/internal/controller/instance" - "github.com/awslabs/kro/internal/graph" - "github.com/awslabs/kro/internal/metadata" + instancectrl "github.com/awslabs/kro/pkg/controller/instance" "github.com/awslabs/kro/pkg/dynamiccontroller" + "github.com/awslabs/kro/pkg/graph" + "github.com/awslabs/kro/pkg/metadata" ) // reconcileResourceGroup orchestrates the reconciliation of a ResourceGroup by: diff --git a/internal/controller/resourcegroup/controller_status.go b/pkg/controller/resourcegroup/controller_status.go similarity index 99% rename from internal/controller/resourcegroup/controller_status.go rename to pkg/controller/resourcegroup/controller_status.go index 23214fa..0be9847 100644 --- a/internal/controller/resourcegroup/controller_status.go +++ b/pkg/controller/resourcegroup/controller_status.go @@ -23,7 +23,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/awslabs/kro/api/v1alpha1" - "github.com/awslabs/kro/internal/metadata" + "github.com/awslabs/kro/pkg/metadata" "github.com/go-logr/logr" ) diff --git a/pkg/dynamiccontroller/dynamic_controller.go b/pkg/dynamiccontroller/dynamic_controller.go index 467eacc..989d015 100644 --- a/pkg/dynamiccontroller/dynamic_controller.go +++ b/pkg/dynamiccontroller/dynamic_controller.go @@ -75,7 +75,7 @@ import ( "k8s.io/client-go/util/workqueue" ctrl "sigs.k8s.io/controller-runtime" - "github.com/awslabs/kro/internal/metadata" + "github.com/awslabs/kro/pkg/metadata" "github.com/awslabs/kro/pkg/requeue" ) diff --git a/internal/graph/builder.go b/pkg/graph/builder.go similarity index 98% rename from internal/graph/builder.go rename to pkg/graph/builder.go index ff91350..a00e66c 100644 --- a/internal/graph/builder.go +++ b/pkg/graph/builder.go @@ -29,15 +29,15 @@ import ( "k8s.io/client-go/rest" "github.com/awslabs/kro/api/v1alpha1" - "github.com/awslabs/kro/internal/graph/crd" - "github.com/awslabs/kro/internal/graph/dag" - "github.com/awslabs/kro/internal/graph/emulator" - "github.com/awslabs/kro/internal/graph/parser" - "github.com/awslabs/kro/internal/graph/schema" - "github.com/awslabs/kro/internal/graph/variable" - "github.com/awslabs/kro/internal/metadata" krocel "github.com/awslabs/kro/pkg/cel" "github.com/awslabs/kro/pkg/cel/ast" + "github.com/awslabs/kro/pkg/graph/crd" + "github.com/awslabs/kro/pkg/graph/dag" + "github.com/awslabs/kro/pkg/graph/emulator" + "github.com/awslabs/kro/pkg/graph/parser" + "github.com/awslabs/kro/pkg/graph/schema" + "github.com/awslabs/kro/pkg/graph/variable" + "github.com/awslabs/kro/pkg/metadata" "github.com/awslabs/kro/pkg/simpleschema" ) diff --git a/internal/graph/builder_test.go b/pkg/graph/builder_test.go similarity index 99% rename from internal/graph/builder_test.go rename to pkg/graph/builder_test.go index 64aab11..7293437 100644 --- a/internal/graph/builder_test.go +++ b/pkg/graph/builder_test.go @@ -20,10 +20,10 @@ import ( "github.com/stretchr/testify/require" "k8s.io/client-go/rest" - "github.com/awslabs/kro/internal/graph/emulator" - "github.com/awslabs/kro/internal/graph/variable" - "github.com/awslabs/kro/internal/testutil/generator" - "github.com/awslabs/kro/internal/testutil/k8s" + "github.com/awslabs/kro/pkg/graph/emulator" + "github.com/awslabs/kro/pkg/graph/variable" + "github.com/awslabs/kro/pkg/testutil/generator" + "github.com/awslabs/kro/pkg/testutil/k8s" ) func TestGraphBuilder_Validation(t *testing.T) { diff --git a/internal/graph/crd/crd.go b/pkg/graph/crd/crd.go similarity index 100% rename from internal/graph/crd/crd.go rename to pkg/graph/crd/crd.go diff --git a/internal/graph/crd/defaults.go b/pkg/graph/crd/defaults.go similarity index 100% rename from internal/graph/crd/defaults.go rename to pkg/graph/crd/defaults.go diff --git a/internal/graph/dag/dag.go b/pkg/graph/dag/dag.go similarity index 100% rename from internal/graph/dag/dag.go rename to pkg/graph/dag/dag.go diff --git a/internal/graph/dag/dag_test.go b/pkg/graph/dag/dag_test.go similarity index 100% rename from internal/graph/dag/dag_test.go rename to pkg/graph/dag/dag_test.go diff --git a/internal/graph/emulator/emulator.go b/pkg/graph/emulator/emulator.go similarity index 100% rename from internal/graph/emulator/emulator.go rename to pkg/graph/emulator/emulator.go diff --git a/internal/graph/emulator/emulator_test.go b/pkg/graph/emulator/emulator_test.go similarity index 100% rename from internal/graph/emulator/emulator_test.go rename to pkg/graph/emulator/emulator_test.go diff --git a/internal/graph/fieldpath/builder.go b/pkg/graph/fieldpath/builder.go similarity index 100% rename from internal/graph/fieldpath/builder.go rename to pkg/graph/fieldpath/builder.go diff --git a/internal/graph/fieldpath/builder_test.go b/pkg/graph/fieldpath/builder_test.go similarity index 100% rename from internal/graph/fieldpath/builder_test.go rename to pkg/graph/fieldpath/builder_test.go diff --git a/internal/graph/fieldpath/parser.go b/pkg/graph/fieldpath/parser.go similarity index 100% rename from internal/graph/fieldpath/parser.go rename to pkg/graph/fieldpath/parser.go diff --git a/internal/graph/fieldpath/parser_test.go b/pkg/graph/fieldpath/parser_test.go similarity index 100% rename from internal/graph/fieldpath/parser_test.go rename to pkg/graph/fieldpath/parser_test.go diff --git a/internal/graph/graph.go b/pkg/graph/graph.go similarity index 95% rename from internal/graph/graph.go rename to pkg/graph/graph.go index f87a22b..380adcd 100644 --- a/internal/graph/graph.go +++ b/pkg/graph/graph.go @@ -16,8 +16,8 @@ package graph import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "github.com/awslabs/kro/internal/graph/dag" - "github.com/awslabs/kro/internal/runtime" + "github.com/awslabs/kro/pkg/graph/dag" + "github.com/awslabs/kro/pkg/runtime" ) // Graph represents a processed resourcegroup. It contains the DAG representation diff --git a/internal/graph/parser/cel.go b/pkg/graph/parser/cel.go similarity index 100% rename from internal/graph/parser/cel.go rename to pkg/graph/parser/cel.go diff --git a/internal/graph/parser/cel_test.go b/pkg/graph/parser/cel_test.go similarity index 100% rename from internal/graph/parser/cel_test.go rename to pkg/graph/parser/cel_test.go diff --git a/internal/graph/parser/conditions.go b/pkg/graph/parser/conditions.go similarity index 100% rename from internal/graph/parser/conditions.go rename to pkg/graph/parser/conditions.go diff --git a/internal/graph/parser/conditions_test.go b/pkg/graph/parser/conditions_test.go similarity index 100% rename from internal/graph/parser/conditions_test.go rename to pkg/graph/parser/conditions_test.go diff --git a/internal/graph/parser/parser.go b/pkg/graph/parser/parser.go similarity index 99% rename from internal/graph/parser/parser.go rename to pkg/graph/parser/parser.go index 55745a5..e761274 100644 --- a/internal/graph/parser/parser.go +++ b/pkg/graph/parser/parser.go @@ -19,7 +19,7 @@ import ( "k8s.io/kube-openapi/pkg/validation/spec" - "github.com/awslabs/kro/internal/graph/variable" + "github.com/awslabs/kro/pkg/graph/variable" ) const ( diff --git a/internal/graph/parser/parser_test.go b/pkg/graph/parser/parser_test.go similarity index 99% rename from internal/graph/parser/parser_test.go rename to pkg/graph/parser/parser_test.go index d9dc903..a885eee 100644 --- a/internal/graph/parser/parser_test.go +++ b/pkg/graph/parser/parser_test.go @@ -19,7 +19,7 @@ import ( "k8s.io/kube-openapi/pkg/validation/spec" - "github.com/awslabs/kro/internal/graph/variable" + "github.com/awslabs/kro/pkg/graph/variable" ) func TestParseResource(t *testing.T) { diff --git a/internal/graph/parser/schemaless.go b/pkg/graph/parser/schemaless.go similarity index 98% rename from internal/graph/parser/schemaless.go rename to pkg/graph/parser/schemaless.go index baa63ff..268e672 100644 --- a/internal/graph/parser/schemaless.go +++ b/pkg/graph/parser/schemaless.go @@ -17,7 +17,7 @@ import ( "fmt" "strings" - "github.com/awslabs/kro/internal/graph/variable" + "github.com/awslabs/kro/pkg/graph/variable" ) // ParseSchemalessResource extracts CEL expressions without a schema, this is useful diff --git a/internal/graph/parser/schemaless_test.go b/pkg/graph/parser/schemaless_test.go similarity index 99% rename from internal/graph/parser/schemaless_test.go rename to pkg/graph/parser/schemaless_test.go index c7ba53b..14f94bf 100644 --- a/internal/graph/parser/schemaless_test.go +++ b/pkg/graph/parser/schemaless_test.go @@ -17,7 +17,7 @@ import ( "sort" "testing" - "github.com/awslabs/kro/internal/graph/variable" + "github.com/awslabs/kro/pkg/graph/variable" ) func areEqualExpressionFields(a, b []variable.FieldDescriptor) bool { diff --git a/internal/graph/resource.go b/pkg/graph/resource.go similarity index 98% rename from internal/graph/resource.go rename to pkg/graph/resource.go index fecddd1..e62a2cd 100644 --- a/internal/graph/resource.go +++ b/pkg/graph/resource.go @@ -21,8 +21,8 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/kube-openapi/pkg/validation/spec" - rgschema "github.com/awslabs/kro/internal/graph/schema" - "github.com/awslabs/kro/internal/graph/variable" + rgschema "github.com/awslabs/kro/pkg/graph/schema" + "github.com/awslabs/kro/pkg/graph/variable" ) // Resource represents a resource in a resource group, it hholds diff --git a/internal/graph/resource_test.go b/pkg/graph/resource_test.go similarity index 100% rename from internal/graph/resource_test.go rename to pkg/graph/resource_test.go diff --git a/internal/graph/schema/conversion_cel.go b/pkg/graph/schema/conversion_cel.go similarity index 100% rename from internal/graph/schema/conversion_cel.go rename to pkg/graph/schema/conversion_cel.go diff --git a/internal/graph/schema/conversion_schema.go b/pkg/graph/schema/conversion_schema.go similarity index 100% rename from internal/graph/schema/conversion_schema.go rename to pkg/graph/schema/conversion_schema.go diff --git a/internal/graph/schema/field_descriptor.go b/pkg/graph/schema/field_descriptor.go similarity index 99% rename from internal/graph/schema/field_descriptor.go rename to pkg/graph/schema/field_descriptor.go index 4dbffcb..d600e59 100644 --- a/internal/graph/schema/field_descriptor.go +++ b/pkg/graph/schema/field_descriptor.go @@ -21,7 +21,7 @@ import ( "github.com/google/cel-go/common/types/ref" extv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - "github.com/awslabs/kro/internal/graph/fieldpath" + "github.com/awslabs/kro/pkg/graph/fieldpath" ) // fieldDescriptor represents a field in an OpenAPI schema. Typically this field diff --git a/internal/graph/schema/resolver.go b/pkg/graph/schema/resolver.go similarity index 100% rename from internal/graph/schema/resolver.go rename to pkg/graph/schema/resolver.go diff --git a/internal/graph/schema/schema.go b/pkg/graph/schema/schema.go similarity index 100% rename from internal/graph/schema/schema.go rename to pkg/graph/schema/schema.go diff --git a/internal/graph/validation.go b/pkg/graph/validation.go similarity index 100% rename from internal/graph/validation.go rename to pkg/graph/validation.go diff --git a/internal/graph/validation_test.go b/pkg/graph/validation_test.go similarity index 100% rename from internal/graph/validation_test.go rename to pkg/graph/validation_test.go diff --git a/internal/graph/variable/variable.go b/pkg/graph/variable/variable.go similarity index 100% rename from internal/graph/variable/variable.go rename to pkg/graph/variable/variable.go diff --git a/internal/metadata/finalizers.go b/pkg/metadata/finalizers.go similarity index 100% rename from internal/metadata/finalizers.go rename to pkg/metadata/finalizers.go diff --git a/internal/metadata/finalizers_test.go b/pkg/metadata/finalizers_test.go similarity index 100% rename from internal/metadata/finalizers_test.go rename to pkg/metadata/finalizers_test.go diff --git a/internal/metadata/groupversion.go b/pkg/metadata/groupversion.go similarity index 100% rename from internal/metadata/groupversion.go rename to pkg/metadata/groupversion.go diff --git a/internal/metadata/groupversion_test.go b/pkg/metadata/groupversion_test.go similarity index 100% rename from internal/metadata/groupversion_test.go rename to pkg/metadata/groupversion_test.go diff --git a/internal/metadata/labels.go b/pkg/metadata/labels.go similarity index 100% rename from internal/metadata/labels.go rename to pkg/metadata/labels.go diff --git a/internal/metadata/labels_test.go b/pkg/metadata/labels_test.go similarity index 100% rename from internal/metadata/labels_test.go rename to pkg/metadata/labels_test.go diff --git a/internal/metadata/owner_reference.go b/pkg/metadata/owner_reference.go similarity index 100% rename from internal/metadata/owner_reference.go rename to pkg/metadata/owner_reference.go diff --git a/internal/metadata/selectors.go b/pkg/metadata/selectors.go similarity index 100% rename from internal/metadata/selectors.go rename to pkg/metadata/selectors.go diff --git a/internal/runtime/interfaces.go b/pkg/runtime/interfaces.go similarity index 99% rename from internal/runtime/interfaces.go rename to pkg/runtime/interfaces.go index 9f6cda7..2e376ee 100644 --- a/internal/runtime/interfaces.go +++ b/pkg/runtime/interfaces.go @@ -17,7 +17,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" - "github.com/awslabs/kro/internal/graph/variable" + "github.com/awslabs/kro/pkg/graph/variable" ) // Interface defines the main runtime interface for managing and synchronizing diff --git a/internal/runtime/resolver/resolver.go b/pkg/runtime/resolver/resolver.go similarity index 98% rename from internal/runtime/resolver/resolver.go rename to pkg/runtime/resolver/resolver.go index 54ce9a9..cba1264 100644 --- a/internal/runtime/resolver/resolver.go +++ b/pkg/runtime/resolver/resolver.go @@ -17,8 +17,8 @@ import ( "fmt" "strings" - "github.com/awslabs/kro/internal/graph/fieldpath" - "github.com/awslabs/kro/internal/graph/variable" + "github.com/awslabs/kro/pkg/graph/fieldpath" + "github.com/awslabs/kro/pkg/graph/variable" ) // ResolutionResult represents the result of resolving a single expression. diff --git a/internal/runtime/resolver/resolver_test.go b/pkg/runtime/resolver/resolver_test.go similarity index 99% rename from internal/runtime/resolver/resolver_test.go rename to pkg/runtime/resolver/resolver_test.go index aef1eca..8d00ade 100644 --- a/internal/runtime/resolver/resolver_test.go +++ b/pkg/runtime/resolver/resolver_test.go @@ -20,7 +20,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/awslabs/kro/internal/graph/variable" + "github.com/awslabs/kro/pkg/graph/variable" ) func TestGetValueFromPath(t *testing.T) { diff --git a/internal/runtime/runtime.go b/pkg/runtime/runtime.go similarity index 99% rename from internal/runtime/runtime.go rename to pkg/runtime/runtime.go index d69fcb6..4a0fb1d 100644 --- a/internal/runtime/runtime.go +++ b/pkg/runtime/runtime.go @@ -22,9 +22,9 @@ import ( "golang.org/x/exp/maps" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "github.com/awslabs/kro/internal/graph/variable" - "github.com/awslabs/kro/internal/runtime/resolver" krocel "github.com/awslabs/kro/pkg/cel" + "github.com/awslabs/kro/pkg/graph/variable" + "github.com/awslabs/kro/pkg/runtime/resolver" ) // Compile time proof to ensure that ResourceGroupRuntime implements the diff --git a/internal/runtime/runtime_test.go b/pkg/runtime/runtime_test.go similarity index 99% rename from internal/runtime/runtime_test.go rename to pkg/runtime/runtime_test.go index ce873d0..b318567 100644 --- a/internal/runtime/runtime_test.go +++ b/pkg/runtime/runtime_test.go @@ -23,8 +23,8 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" - "github.com/awslabs/kro/internal/graph/variable" krocel "github.com/awslabs/kro/pkg/cel" + "github.com/awslabs/kro/pkg/graph/variable" ) func Test_RuntimeWorkflow(t *testing.T) { diff --git a/internal/runtime/state.go b/pkg/runtime/state.go similarity index 98% rename from internal/runtime/state.go rename to pkg/runtime/state.go index 09f5219..c14e2b0 100644 --- a/internal/runtime/state.go +++ b/pkg/runtime/state.go @@ -13,7 +13,7 @@ package runtime -import "github.com/awslabs/kro/internal/graph/variable" +import "github.com/awslabs/kro/pkg/graph/variable" // ResourceState represents the current state of a resource in the runtime. // It indicates the resource's readiness for processing or what it's waiting on. diff --git a/internal/testutil/generator/resourcegroup.go b/pkg/testutil/generator/resourcegroup.go similarity index 100% rename from internal/testutil/generator/resourcegroup.go rename to pkg/testutil/generator/resourcegroup.go diff --git a/internal/testutil/k8s/discovery.go b/pkg/testutil/k8s/discovery.go similarity index 100% rename from internal/testutil/k8s/discovery.go rename to pkg/testutil/k8s/discovery.go diff --git a/test/integration/environment/setup.go b/test/integration/environment/setup.go index ef87463..1c0322c 100644 --- a/test/integration/environment/setup.go +++ b/test/integration/environment/setup.go @@ -29,11 +29,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/metrics/server" krov1alpha1 "github.com/awslabs/kro/api/v1alpha1" - ctrlinstance "github.com/awslabs/kro/internal/controller/instance" - ctrlresourcegroup "github.com/awslabs/kro/internal/controller/resourcegroup" - "github.com/awslabs/kro/internal/graph" kroclient "github.com/awslabs/kro/pkg/client" + ctrlinstance "github.com/awslabs/kro/pkg/controller/instance" + ctrlresourcegroup "github.com/awslabs/kro/pkg/controller/resourcegroup" "github.com/awslabs/kro/pkg/dynamiccontroller" + "github.com/awslabs/kro/pkg/graph" ) type Environment struct { diff --git a/test/integration/suites/ackekscluster/generator.go b/test/integration/suites/ackekscluster/generator.go index 6fad8eb..2410b69 100644 --- a/test/integration/suites/ackekscluster/generator.go +++ b/test/integration/suites/ackekscluster/generator.go @@ -18,7 +18,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" krov1alpha1 "github.com/awslabs/kro/api/v1alpha1" - "github.com/awslabs/kro/internal/testutil/generator" + "github.com/awslabs/kro/pkg/testutil/generator" ) func eksCluster( diff --git a/test/integration/suites/ackekscluster/suite_test.go b/test/integration/suites/ackekscluster/suite_test.go index 85b9a7d..b21bb06 100644 --- a/test/integration/suites/ackekscluster/suite_test.go +++ b/test/integration/suites/ackekscluster/suite_test.go @@ -29,7 +29,7 @@ import ( "k8s.io/apimachinery/pkg/util/rand" krov1alpha1 "github.com/awslabs/kro/api/v1alpha1" - ctrlinstance "github.com/awslabs/kro/internal/controller/instance" + ctrlinstance "github.com/awslabs/kro/pkg/controller/instance" "github.com/awslabs/kro/test/integration/environment" ) diff --git a/test/integration/suites/core/conditional_test.go b/test/integration/suites/core/conditional_test.go index 852bbe7..ae6aa62 100644 --- a/test/integration/suites/core/conditional_test.go +++ b/test/integration/suites/core/conditional_test.go @@ -30,7 +30,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" krov1alpha1 "github.com/awslabs/kro/api/v1alpha1" - "github.com/awslabs/kro/internal/testutil/generator" + "github.com/awslabs/kro/pkg/testutil/generator" ) var _ = Describe("Conditions", func() { diff --git a/test/integration/suites/core/crd_test.go b/test/integration/suites/core/crd_test.go index 934f352..be52c52 100644 --- a/test/integration/suites/core/crd_test.go +++ b/test/integration/suites/core/crd_test.go @@ -26,7 +26,7 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/rand" - "github.com/awslabs/kro/internal/testutil/generator" + "github.com/awslabs/kro/pkg/testutil/generator" ) var _ = Describe("CRD", func() { diff --git a/test/integration/suites/core/readiness_test.go b/test/integration/suites/core/readiness_test.go index 20de3b2..3782430 100644 --- a/test/integration/suites/core/readiness_test.go +++ b/test/integration/suites/core/readiness_test.go @@ -30,7 +30,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" krov1alpha1 "github.com/awslabs/kro/api/v1alpha1" - "github.com/awslabs/kro/internal/testutil/generator" + "github.com/awslabs/kro/pkg/testutil/generator" ) var _ = Describe("Readiness", func() { diff --git a/test/integration/suites/core/recover_test.go b/test/integration/suites/core/recover_test.go index 69456fb..d2b7a1a 100644 --- a/test/integration/suites/core/recover_test.go +++ b/test/integration/suites/core/recover_test.go @@ -29,7 +29,7 @@ import ( "k8s.io/apimachinery/pkg/util/rand" krov1alpha1 "github.com/awslabs/kro/api/v1alpha1" - "github.com/awslabs/kro/internal/testutil/generator" + "github.com/awslabs/kro/pkg/testutil/generator" ) var _ = Describe("Recovery", func() { diff --git a/test/integration/suites/core/setup_test.go b/test/integration/suites/core/setup_test.go index a19618a..6be06d6 100644 --- a/test/integration/suites/core/setup_test.go +++ b/test/integration/suites/core/setup_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/runtime" - ctrlinstance "github.com/awslabs/kro/internal/controller/instance" + ctrlinstance "github.com/awslabs/kro/pkg/controller/instance" "github.com/awslabs/kro/test/integration/environment" ) diff --git a/test/integration/suites/core/status_test.go b/test/integration/suites/core/status_test.go index 5a44309..71e6da2 100644 --- a/test/integration/suites/core/status_test.go +++ b/test/integration/suites/core/status_test.go @@ -26,7 +26,7 @@ import ( "k8s.io/apimachinery/pkg/util/rand" krov1alpha1 "github.com/awslabs/kro/api/v1alpha1" - "github.com/awslabs/kro/internal/testutil/generator" + "github.com/awslabs/kro/pkg/testutil/generator" ) var _ = Describe("Status", func() { diff --git a/test/integration/suites/core/topology_test.go b/test/integration/suites/core/topology_test.go index 3522b96..a3dc15d 100644 --- a/test/integration/suites/core/topology_test.go +++ b/test/integration/suites/core/topology_test.go @@ -26,7 +26,7 @@ import ( "k8s.io/apimachinery/pkg/util/rand" krov1alpha1 "github.com/awslabs/kro/api/v1alpha1" - "github.com/awslabs/kro/internal/testutil/generator" + "github.com/awslabs/kro/pkg/testutil/generator" ) var _ = Describe("Topology", func() { diff --git a/test/integration/suites/core/validation_test.go b/test/integration/suites/core/validation_test.go index 2cb882c..4788e07 100644 --- a/test/integration/suites/core/validation_test.go +++ b/test/integration/suites/core/validation_test.go @@ -26,7 +26,7 @@ import ( "k8s.io/apimachinery/pkg/util/rand" krov1alpha1 "github.com/awslabs/kro/api/v1alpha1" - "github.com/awslabs/kro/internal/testutil/generator" + "github.com/awslabs/kro/pkg/testutil/generator" ) var _ = Describe("Validation", func() { diff --git a/test/integration/suites/deploymentservice/generator.go b/test/integration/suites/deploymentservice/generator.go index 300d810..6e78d81 100644 --- a/test/integration/suites/deploymentservice/generator.go +++ b/test/integration/suites/deploymentservice/generator.go @@ -18,7 +18,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" krov1alpha1 "github.com/awslabs/kro/api/v1alpha1" - "github.com/awslabs/kro/internal/testutil/generator" + "github.com/awslabs/kro/pkg/testutil/generator" ) // deploymentService creates a ResourceGroup for testing deployment+service combinations diff --git a/test/integration/suites/deploymentservice/suite_test.go b/test/integration/suites/deploymentservice/suite_test.go index 9e32caf..7eb56de 100644 --- a/test/integration/suites/deploymentservice/suite_test.go +++ b/test/integration/suites/deploymentservice/suite_test.go @@ -30,7 +30,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" krov1alpha1 "github.com/awslabs/kro/api/v1alpha1" - ctrlinstance "github.com/awslabs/kro/internal/controller/instance" + ctrlinstance "github.com/awslabs/kro/pkg/controller/instance" "github.com/awslabs/kro/test/integration/environment" ) diff --git a/test/integration/suites/networkingstack/generator.go b/test/integration/suites/networkingstack/generator.go index 19685d4..70f3aac 100644 --- a/test/integration/suites/networkingstack/generator.go +++ b/test/integration/suites/networkingstack/generator.go @@ -18,7 +18,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" krov1alpha1 "github.com/awslabs/kro/api/v1alpha1" - "github.com/awslabs/kro/internal/testutil/generator" + "github.com/awslabs/kro/pkg/testutil/generator" ) func networkingStack( diff --git a/test/integration/suites/networkingstack/suite_test.go b/test/integration/suites/networkingstack/suite_test.go index bc8aa04..fd72b26 100644 --- a/test/integration/suites/networkingstack/suite_test.go +++ b/test/integration/suites/networkingstack/suite_test.go @@ -29,7 +29,7 @@ import ( "k8s.io/apimachinery/pkg/util/rand" krov1alpha1 "github.com/awslabs/kro/api/v1alpha1" - ctrlinstance "github.com/awslabs/kro/internal/controller/instance" + ctrlinstance "github.com/awslabs/kro/pkg/controller/instance" "github.com/awslabs/kro/test/integration/environment" )