Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scorecard: use api repo v1alpha3 API, remove existing #3622

Merged
merged 1 commit into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions changelog/fragments/move-scorecard-apis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
entries:
- description: >
Moved scorecard API v1alpha3 to the [api repo](https://github.com/operator-framework/api)
under `pkg/apis/scorecard/v1alpha3`. All future scorecard APIs will be released in this repo.
kind: removal
breaking: true
migration:
header: Update scorecard API Go import paths
body: >
The scorecard v1alpha3 API has been moved to a separate repo. Update your Go import paths:
From: `github.com/operator-framework/operator-framework/pkg/apis/scorecard/v1alpha3`
To: `github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3`
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ require (
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334
github.com/kr/text v0.1.0
github.com/markbates/inflect v1.0.4
github.com/mattn/go-isatty v0.0.12
github.com/onsi/ginkgo v1.12.1
github.com/onsi/gomega v1.10.1
github.com/operator-framework/api v0.3.8
github.com/operator-framework/api v0.3.12-0.20200731162302-333d0644352a
github.com/operator-framework/operator-lib v0.1.0
github.com/operator-framework/operator-registry v1.13.4
github.com/prometheus/client_golang v1.5.1
Expand Down
12 changes: 5 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,8 @@ github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
Expand Down Expand Up @@ -573,12 +572,12 @@ github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.m
github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs=
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
github.com/operator-framework/api v0.3.7-0.20200602203552-431198de9fc2/go.mod h1:Xbje9x0SHmh0nihE21kpesB38vk3cyxnE6JdDS8Jo1Q=
github.com/operator-framework/api v0.3.8 h1:tJykTCmwGKZBsPVTCfxbwz6nTF6dzmKydWJtC40erc8=
github.com/operator-framework/api v0.3.8/go.mod h1:Xbje9x0SHmh0nihE21kpesB38vk3cyxnE6JdDS8Jo1Q=
github.com/operator-framework/operator-registry v1.13.4 h1:GH7essHnVRP4kYgAWYV9obsS0Cnaj/KjT3BmQXmKAOE=
github.com/operator-framework/operator-registry v1.13.4/go.mod h1:YhnIzOVjRU2ZwZtzt+fjcjW8ujJaSFynBEu7QVKaSdU=
github.com/operator-framework/api v0.3.12-0.20200731162302-333d0644352a h1:x/oRKFmHiAAkNUNEeVcmlCfSFcJBtWSuWT7UcrnqQ7U=
github.com/operator-framework/api v0.3.12-0.20200731162302-333d0644352a/go.mod h1:Xbje9x0SHmh0nihE21kpesB38vk3cyxnE6JdDS8Jo1Q=
github.com/operator-framework/operator-lib v0.1.0 h1:7Qy6v2ZccvCeFLWEkrGnN+U+DkaeIWp0gAZaBM9T3DI=
github.com/operator-framework/operator-lib v0.1.0/go.mod h1:HLw61JTIEeq0YLeVf4dwYx/zt4DmLGZUVWI1y3Lf5Hg=
github.com/operator-framework/operator-registry v1.13.4 h1:GH7essHnVRP4kYgAWYV9obsS0Cnaj/KjT3BmQXmKAOE=
github.com/operator-framework/operator-registry v1.13.4/go.mod h1:YhnIzOVjRU2ZwZtzt+fjcjW8ujJaSFynBEu7QVKaSdU=
github.com/otiai10/copy v1.2.0 h1:HvG945u96iNadPoG2/Ja2+AUJeW5YuFQMixq9yirC+k=
github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw=
github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE=
Expand Down Expand Up @@ -860,7 +859,6 @@ golang.org/x/sys v0.0.0-20191020212454-3e7259c5e7c2/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down
2 changes: 1 addition & 1 deletion images/scorecard-test-kuttl/cmd/test-kuttl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"log"
"os"

"github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha3"
"github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
)

// The scorecard test kuttl binary processes the
Expand Down
2 changes: 1 addition & 1 deletion images/scorecard-test/cmd/test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import (
"log"
"os"

scapiv1alpha3 "github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
apimanifests "github.com/operator-framework/api/pkg/manifests"

registryutil "github.com/operator-framework/operator-sdk/internal/registry"
"github.com/operator-framework/operator-sdk/internal/scorecard"
"github.com/operator-framework/operator-sdk/internal/scorecard/tests"
scapiv1alpha3 "github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha3"
)

// this is the scorecard test binary that ultimately executes the
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/operator-sdk/generate/bundle/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"sort"
"strings"

"github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
"github.com/operator-framework/operator-registry/pkg/lib/bundle"
"sigs.k8s.io/kubebuilder/pkg/model/config"
"sigs.k8s.io/yaml"
Expand All @@ -35,7 +36,6 @@ import (
"github.com/operator-framework/operator-sdk/internal/registry"
"github.com/operator-framework/operator-sdk/internal/scorecard"
"github.com/operator-framework/operator-sdk/internal/util/projutil"
"github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha3"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/operator-sdk/scorecard/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"path/filepath"
"time"

"github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand All @@ -33,7 +34,6 @@ import (
"github.com/operator-framework/operator-sdk/internal/flags"
registryutil "github.com/operator-framework/operator-sdk/internal/registry"
"github.com/operator-framework/operator-sdk/internal/scorecard"
"github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha3"
)

type scorecardCmd struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/generate/collector/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"os"
"path/filepath"

scorecardv1alpha3 "github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
log "github.com/sirupsen/logrus"
admissionregv1 "k8s.io/api/admissionregistration/v1"
appsv1 "k8s.io/api/apps/v1"
Expand All @@ -33,7 +34,6 @@ import (
"sigs.k8s.io/yaml"

"github.com/operator-framework/operator-sdk/internal/util/k8sutil"
scorecardv1alpha3 "github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha3"
)

// Manifests holds a collector of all manifests relevant to CSV updates.
Expand All @@ -59,7 +59,7 @@ var (
v1beta1crdGK = apiextv1beta1.SchemeGroupVersion.WithKind("CustomResourceDefinition").GroupKind()
validatingWebhookCfgGK = admissionregv1.SchemeGroupVersion.WithKind("ValidatingWebhookConfiguration").GroupKind()
mutatingWebhookCfgGK = admissionregv1.SchemeGroupVersion.WithKind("MutatingWebhookConfiguration").GroupKind()
v1alpha3ScorecardCfgGK = scorecardv1alpha3.SchemeGroupVersion.WithKind("Configuration").GroupKind()
v1alpha3ScorecardCfgGK = scorecardv1alpha3.GroupVersion.WithKind("Configuration").GroupKind()
)

// UpdateFromDirs adds Roles, ClusterRoles, Deployments, and Custom Resource examples
Expand Down
6 changes: 3 additions & 3 deletions internal/plugins/scorecard/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import (
"path/filepath"
"text/template"

"github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/kubebuilder/pkg/model/config"
"sigs.k8s.io/yaml"

"github.com/operator-framework/operator-sdk/internal/plugins/util/kustomize"
"github.com/operator-framework/operator-sdk/internal/scorecard"
"github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha3"
)

const (
Expand Down Expand Up @@ -115,7 +115,7 @@ func generate(testImageTag, outputDir string) error {
}
kustomizationValues.ResourcePaths = append(kustomizationValues.ResourcePaths, relBasePath)
scorecardConfigTarget := patchTarget{
GroupVersionKind: v1alpha3.SchemeGroupVersion.WithKind(v1alpha3.ConfigurationKind),
GroupVersionKind: v1alpha3.GroupVersion.WithKind(v1alpha3.ConfigurationKind),
Name: defaultConfigName,
}

Expand Down Expand Up @@ -187,7 +187,7 @@ type jsonPatchObject struct {
// newConfigurationBase returns a scorecard componentconfig object with one parallel stage.
// The returned object is intended to be marshaled and written to disk as a kustomize base.
func newConfigurationBase(configName string) (cfg v1alpha3.Configuration) {
cfg.SetGroupVersionKind(v1alpha3.SchemeGroupVersion.WithKind(v1alpha3.ConfigurationKind))
cfg.SetGroupVersionKind(v1alpha3.GroupVersion.WithKind(v1alpha3.ConfigurationKind))
cfg.Metadata.Name = configName
cfg.Stages = []v1alpha3.StageConfiguration{
{
Expand Down
3 changes: 1 addition & 2 deletions internal/scorecard/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ package scorecard
import (
"io/ioutil"

"github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
"sigs.k8s.io/yaml"

"github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha3"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import (
"log"
"os"

scapiv1alpha3 "github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
apimanifests "github.com/operator-framework/api/pkg/manifests"

"github.com/operator-framework/operator-sdk/internal/scorecard"
"github.com/operator-framework/operator-sdk/internal/scorecard/examples/custom-scorecard-tests/internal/tests"

apimanifests "github.com/operator-framework/api/pkg/manifests"
scapiv1alpha3 "github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha3"
)

// This is the custom scorecard test example binary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package tests

import (
apimanifests "github.com/operator-framework/api/pkg/manifests"
scapiv1alpha3 "github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha3"
scapiv1alpha3 "github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
)

const (
Expand Down
3 changes: 1 addition & 2 deletions internal/scorecard/formatting.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ import (
"context"
"encoding/json"

"github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
v1 "k8s.io/api/core/v1"

"github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha3"
)

// getTestResult fetches the test pod log and converts it into
Expand Down
3 changes: 1 addition & 2 deletions internal/scorecard/labels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ package scorecard
import (
"testing"

"github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
"k8s.io/apimachinery/pkg/labels"

"github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha3"
)

func TestEmptySelector(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions internal/scorecard/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ import (
"testing"
"time"

"github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
"k8s.io/apimachinery/pkg/labels"

"github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha3"
)

// TODO(joelanford): rewrite to use ginkgo/gomega
Expand Down
2 changes: 1 addition & 1 deletion internal/scorecard/scorecard.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import (
"sync"
"time"

"github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/kubernetes"

registryutil "github.com/operator-framework/operator-sdk/internal/registry"
"github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha3"
)

type TestRunner interface {
Expand Down
3 changes: 1 addition & 2 deletions internal/scorecard/testpod.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ import (
"fmt"
"io"

"github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/rand"
"k8s.io/client-go/kubernetes"

"github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha3"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/scorecard/tests/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
package tests

import (
scapiv1alpha3 "github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
apimanifests "github.com/operator-framework/api/pkg/manifests"
scapiv1alpha3 "github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha3"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/scorecard/tests/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import (

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
scapiv1alpha3 "github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
apimanifests "github.com/operator-framework/api/pkg/manifests"
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"

registryutil "github.com/operator-framework/operator-sdk/internal/registry"
scapiv1alpha3 "github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha3"
)

var _ = Describe("Basic and OLM tests", func() {
Expand Down
2 changes: 1 addition & 1 deletion internal/scorecard/tests/olm.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"path/filepath"
"strings"

scapiv1alpha3 "github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
apimanifests "github.com/operator-framework/api/pkg/manifests"
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
apivalidation "github.com/operator-framework/api/pkg/validation"
Expand All @@ -33,7 +34,6 @@ import (

registryutil "github.com/operator-framework/operator-sdk/internal/registry"
"github.com/operator-framework/operator-sdk/internal/util/k8sutil"
scapiv1alpha3 "github.com/operator-framework/operator-sdk/pkg/apis/scorecard/v1alpha3"
)

const (
Expand Down
18 changes: 0 additions & 18 deletions pkg/apis/scorecard/v1alpha2/doc.go

This file was deleted.

Loading