Skip to content

Commit

Permalink
move internal to alpha to make subpackages available for importing fr…
Browse files Browse the repository at this point in the history
…om other projects (#759)

Signed-off-by: Joe Lanford <[email protected]>
  • Loading branch information
joelanford authored Aug 19, 2021
1 parent 7fba6ad commit a0bb1e5
Show file tree
Hide file tree
Showing 102 changed files with 69 additions and 59 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static: build

.PHONY: unit
unit:
$(GO) test -coverprofile=coverage.out $(SPECIFIC_UNIT_TEST) $(TAGS) $(TEST_RACE) -count=1 -v ./pkg/... ./internal/...
$(GO) test -coverprofile=coverage.out $(SPECIFIC_UNIT_TEST) $(TAGS) $(TEST_RACE) -count=1 -v ./pkg/... ./alpha/...

.PHONY: sanity-check
sanity-check:
Expand Down
4 changes: 2 additions & 2 deletions internal/action/diff.go → alpha/action/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"github.com/sirupsen/logrus"

"github.com/operator-framework/operator-registry/internal/declcfg"
"github.com/operator-framework/operator-registry/internal/model"
"github.com/operator-framework/operator-registry/alpha/declcfg"
"github.com/operator-framework/operator-registry/alpha/model"
"github.com/operator-framework/operator-registry/pkg/image"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/action/diff_test.go → alpha/action/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/operator-framework/operator-registry/internal/action"
"github.com/operator-framework/operator-registry/internal/declcfg"
"github.com/operator-framework/operator-registry/alpha/action"
"github.com/operator-framework/operator-registry/alpha/declcfg"
"github.com/operator-framework/operator-registry/pkg/containertools"
"github.com/operator-framework/operator-registry/pkg/image"
"github.com/operator-framework/operator-registry/pkg/lib/bundle"
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion internal/action/init.go → alpha/action/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/h2non/filetype"

"github.com/operator-framework/operator-registry/internal/declcfg"
"github.com/operator-framework/operator-registry/alpha/declcfg"
)

type Init struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/action/init_test.go → alpha/action/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"github.com/stretchr/testify/require"

"github.com/operator-framework/operator-registry/internal/action"
"github.com/operator-framework/operator-registry/internal/declcfg"
"github.com/operator-framework/operator-registry/alpha/action"
"github.com/operator-framework/operator-registry/alpha/declcfg"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions internal/action/list.go → alpha/action/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

"github.com/operator-framework/api/pkg/operators/v1alpha1"

"github.com/operator-framework/operator-registry/internal/declcfg"
"github.com/operator-framework/operator-registry/internal/model"
"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/declcfg"
"github.com/operator-framework/operator-registry/alpha/model"
"github.com/operator-framework/operator-registry/alpha/property"
)

type ListPackages struct {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions internal/action/render.go → alpha/action/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/util/sets"

"github.com/operator-framework/operator-registry/internal/declcfg"
"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/declcfg"
"github.com/operator-framework/operator-registry/alpha/property"
"github.com/operator-framework/operator-registry/pkg/containertools"
"github.com/operator-framework/operator-registry/pkg/image"
"github.com/operator-framework/operator-registry/pkg/image/containerdregistry"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/util/yaml"

"github.com/operator-framework/operator-registry/internal/action"
"github.com/operator-framework/operator-registry/internal/declcfg"
"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/action"
"github.com/operator-framework/operator-registry/alpha/declcfg"
"github.com/operator-framework/operator-registry/alpha/property"
"github.com/operator-framework/operator-registry/pkg/containertools"
"github.com/operator-framework/operator-registry/pkg/image"
"github.com/operator-framework/operator-registry/pkg/lib/bundle"
Expand Down
2 changes: 1 addition & 1 deletion internal/declcfg/declcfg.go → alpha/declcfg/declcfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package declcfg
import (
"encoding/json"

"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/property"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import (
"fmt"

"github.com/blang/semver"
"github.com/operator-framework/operator-registry/internal/model"
"github.com/operator-framework/operator-registry/internal/property"

"github.com/operator-framework/operator-registry/alpha/model"
"github.com/operator-framework/operator-registry/alpha/property"
)

func ConvertToModel(cfg DeclarativeConfig) (model.Model, error) {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions internal/declcfg/diff.go → alpha/declcfg/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"github.com/mitchellh/hashstructure/v2"
"github.com/sirupsen/logrus"

"github.com/operator-framework/operator-registry/internal/model"
"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/model"
"github.com/operator-framework/operator-registry/alpha/property"
)

// DiffGenerator configures how diffs are created via Run().
Expand Down
4 changes: 2 additions & 2 deletions internal/declcfg/diff_test.go → alpha/declcfg/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

"github.com/stretchr/testify/require"

"github.com/operator-framework/operator-registry/internal/model"
"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/model"
"github.com/operator-framework/operator-registry/alpha/property"
)

type deprecated struct{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/operator-framework/operator-registry/internal/model"
"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/model"
"github.com/operator-framework/operator-registry/alpha/property"
)

func buildValidDeclarativeConfig(includeUnrecognized bool) DeclarativeConfig {
Expand Down
2 changes: 1 addition & 1 deletion internal/declcfg/load.go → alpha/declcfg/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/util/yaml"

"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/property"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/property"
)

func TestReadYAMLOrJSON(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package declcfg
import (
"sort"

"github.com/operator-framework/operator-registry/internal/model"
"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/model"
"github.com/operator-framework/operator-registry/alpha/property"
)

func ConvertFromModel(mpkgs model.Model) DeclarativeConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/operator-framework/operator-registry/internal/model"
"github.com/operator-framework/operator-registry/alpha/model"
)

func TestConvertFromModel(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package declcfg
import (
"fmt"

"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/property"
)

func parseProperties(props []property.Property) (*property.Properties, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/property"
)

func TestParseProperties(t *testing.T) {
Expand Down
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions alpha/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Package alpha contains subpackages that have unstable Go APIs.
// Subpackages that achieve maturity will be deprecated and moved
// to other modules or packages within operator-registry.
//
// Presence in the alpha package should not be construed as being
// of less quality than non-alpha packages. Subpackages in the
// alpha package have the same standard for testing as all other
// packages in this repository.
package alpha
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion internal/model/model.go → alpha/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/h2non/filetype/types"
svg "github.com/h2non/go-is-svg"

"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/property"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion internal/model/model_test.go → alpha/model/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/property"
)

type validator interface {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions cmd/opm/alpha/diff/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/spf13/cobra"
"k8s.io/kubectl/pkg/util/templates"

"github.com/operator-framework/operator-registry/internal/action"
"github.com/operator-framework/operator-registry/internal/declcfg"
"github.com/operator-framework/operator-registry/alpha/action"
"github.com/operator-framework/operator-registry/alpha/declcfg"
containerd "github.com/operator-framework/operator-registry/pkg/image/containerdregistry"
"github.com/operator-framework/operator-registry/pkg/lib/certs"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/opm/alpha/generate/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/operator-framework/operator-registry/internal/action"
"github.com/operator-framework/operator-registry/alpha/action"
"github.com/operator-framework/operator-registry/pkg/containertools"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/opm/alpha/list/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/operator-framework/operator-registry/internal/action"
"github.com/operator-framework/operator-registry/alpha/action"
)

const humanReadabilityOnlyNote = `NOTE: This is meant to be used for convenience and human-readability only. The
Expand Down
4 changes: 2 additions & 2 deletions cmd/opm/init/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/operator-framework/operator-registry/internal/action"
"github.com/operator-framework/operator-registry/internal/declcfg"
"github.com/operator-framework/operator-registry/alpha/action"
"github.com/operator-framework/operator-registry/alpha/declcfg"
)

func NewCmd() *cobra.Command {
Expand Down
4 changes: 2 additions & 2 deletions cmd/opm/render/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/operator-framework/operator-registry/internal/action"
"github.com/operator-framework/operator-registry/internal/declcfg"
"github.com/operator-framework/operator-registry/alpha/action"
"github.com/operator-framework/operator-registry/alpha/declcfg"
)

func NewCmd() *cobra.Command {
Expand Down
2 changes: 1 addition & 1 deletion cmd/opm/serve/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"

"github.com/operator-framework/operator-registry/internal/declcfg"
"github.com/operator-framework/operator-registry/alpha/declcfg"
"github.com/operator-framework/operator-registry/pkg/api"
health "github.com/operator-framework/operator-registry/pkg/api/grpc_health_v1"
"github.com/operator-framework/operator-registry/pkg/lib/dns"
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/api_to_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"sort"

"github.com/operator-framework/operator-registry/internal/model"
"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/model"
"github.com/operator-framework/operator-registry/alpha/property"
)

func ConvertAPIBundleToModelBundle(b *Bundle) (*model.Bundle, error) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/operator-framework/operator-registry/internal/model"
"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/model"
"github.com/operator-framework/operator-registry/alpha/property"
)

func TestConvertAPIBundleToModelBundle(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/model_to_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"encoding/json"
"fmt"

"github.com/operator-framework/operator-registry/internal/model"
"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/model"
"github.com/operator-framework/operator-registry/alpha/property"
)

func ConvertModelBundleToAPIBundle(b model.Bundle) (*Bundle, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/lib/config/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package config
import (
"io/fs"

"github.com/operator-framework/operator-registry/internal/declcfg"
"github.com/operator-framework/operator-registry/alpha/declcfg"
)

// Validate takes a filesystem containing the declarative config file(s)
Expand Down
4 changes: 2 additions & 2 deletions pkg/lib/registry/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"sigs.k8s.io/yaml"

"github.com/operator-framework/operator-registry/internal/model"
"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/model"
"github.com/operator-framework/operator-registry/alpha/property"
"github.com/operator-framework/operator-registry/pkg/image"
"github.com/operator-framework/operator-registry/pkg/lib/bundle"
"github.com/operator-framework/operator-registry/pkg/registry"
Expand Down
2 changes: 1 addition & 1 deletion pkg/registry/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"sort"

"github.com/operator-framework/operator-registry/internal/model"
"github.com/operator-framework/operator-registry/alpha/model"
"github.com/operator-framework/operator-registry/pkg/api"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/registry/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/operator-framework/operator-registry/internal/declcfg"
"github.com/operator-framework/operator-registry/alpha/declcfg"
)

var testModelQuerier = genTestModelQuerier()
Expand Down
4 changes: 2 additions & 2 deletions pkg/registry/registry_to_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"sort"
"strings"

"github.com/operator-framework/operator-registry/internal/model"
"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/model"
"github.com/operator-framework/operator-registry/alpha/property"
)

func ConvertRegistryBundleToModelBundles(b *Bundle) ([]model.Bundle, error) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/registry/registry_to_model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/operator-framework/operator-registry/internal/model"
"github.com/operator-framework/operator-registry/internal/property"
"github.com/operator-framework/operator-registry/alpha/model"
"github.com/operator-framework/operator-registry/alpha/property"
"github.com/operator-framework/operator-registry/pkg/image"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sqlite/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/operator-framework/api/pkg/operators/v1alpha1"
"github.com/sirupsen/logrus"

"github.com/operator-framework/operator-registry/internal/model"
"github.com/operator-framework/operator-registry/alpha/model"
"github.com/operator-framework/operator-registry/pkg/api"
"github.com/operator-framework/operator-registry/pkg/registry"
)
Expand Down

0 comments on commit a0bb1e5

Please sign in to comment.