Skip to content

go.*,pkg,vendor: Bump controller-runtime to v0.10.1 #2368

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

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
25 changes: 13 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/mitchellh/hashstructure v1.0.0
github.com/mitchellh/mapstructure v1.1.2
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.13.0
github.com/onsi/gomega v1.15.0
github.com/openshift/api v0.0.0-20200331152225-585af27e34fd
github.com/openshift/client-go v0.0.0-20200326155132-2a6cd50aedd0
github.com/operator-framework/api v0.10.3
Expand All @@ -41,28 +41,29 @@ require (
google.golang.org/grpc v1.38.0
gopkg.in/yaml.v2 v2.4.0
helm.sh/helm/v3 v3.6.1
k8s.io/api v0.22.0
k8s.io/apiextensions-apiserver v0.22.0
k8s.io/apimachinery v0.22.0
k8s.io/apiserver v0.22.0
k8s.io/client-go v0.22.0
k8s.io/code-generator v0.22.0
k8s.io/component-base v0.22.0
k8s.io/api v0.22.2
k8s.io/apiextensions-apiserver v0.22.2
k8s.io/apimachinery v0.22.2
k8s.io/apiserver v0.22.2
k8s.io/client-go v0.22.2
k8s.io/code-generator v0.22.2
k8s.io/component-base v0.22.2
k8s.io/klog v1.0.0
k8s.io/kube-aggregator v0.22.0
k8s.io/kube-openapi v0.0.0-20210527164424-3c818078ee3d
k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a
rsc.io/letsencrypt v0.0.3 // indirect
sigs.k8s.io/controller-runtime v0.9.2
sigs.k8s.io/controller-runtime v0.10.0
sigs.k8s.io/controller-tools v0.6.1
sigs.k8s.io/kind v0.11.1
)

replace (
// controller runtime
github.com/openshift/api => github.com/openshift/api v0.0.0-20200331152225-585af27e34fd // release-4.5
github.com/openshift/api => github.com/openshift/api v0.0.0-20211014063134-be2a7fb8aa44
github.com/openshift/client-go => github.com/openshift/client-go v0.0.0-20200326155132-2a6cd50aedd0 // release-4.5

// Patch for a race condition involving metadata-only
// informers until it can be resolved upstream:
sigs.k8s.io/controller-runtime v0.9.2 => github.com/benluddy/controller-runtime v0.9.3-0.20210720171926-9bcb99bd9bd3
sigs.k8s.io/controller-runtime v0.10.0 => github.com/timflannagan/controller-runtime v0.10.1-0.20211210161403-6756a4203e70
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracking the removal of this pin in #2353 (comment).

)
67 changes: 47 additions & 20 deletions go.sum

Large diffs are not rendered by default.

11 changes: 4 additions & 7 deletions pkg/controller/operators/adoption_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ var _ = Describe("Adoption Controller", func() {
Spec: &operatorsv1alpha1.SubscriptionSpec{
Package: "poultry",
},
Status: operatorsv1alpha1.SubscriptionStatus{
InstalledCSV: "turkey",
LastUpdated: metav1.Now(),
},
}
sub.SetNamespace(ns.GetName())
sub.SetName(sub.Spec.Package)
Expand All @@ -94,13 +90,14 @@ var _ = Describe("Adoption Controller", func() {
created = append(created, sub)

// Set the Subscription's status separately
status := sub.DeepCopy().Status
Eventually(func() error {
if err := k8sClient.Get(ctx, testobj.NamespacedName(sub), sub); err != nil {
return err
}
sub.Status = status

sub.Status = operatorsv1alpha1.SubscriptionStatus{
InstalledCSV: "turkey",
LastUpdated: metav1.Now(),
}
return k8sClient.Status().Update(ctx, sub)
}, timeout, interval).Should(Succeed())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var _ = Describe("ClusterOperator controller", func() {
}).Should(Succeed())

cv.Status = configv1.ClusterVersionStatus{
Desired: configv1.Update{
Desired: configv1.Release{
Version: clusterVersion,
},
}
Expand Down Expand Up @@ -161,7 +161,7 @@ var _ = Describe("ClusterOperator controller", func() {
}))

cv.Status = configv1.ClusterVersionStatus{
Desired: configv1.Update{
Desired: configv1.Release{
Version: clusterVersion,
},
}
Expand Down
14 changes: 7 additions & 7 deletions pkg/controller/operators/openshift/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func TestIncompatibleOperators(t *testing.T) {
Name: "version",
},
Status: configv1.ClusterVersionStatus{
Desired: configv1.Update{
Desired: configv1.Release{
Version: "1.0.0",
},
},
Expand Down Expand Up @@ -266,7 +266,7 @@ func TestIncompatibleOperators(t *testing.T) {
Name: "version",
},
Status: configv1.ClusterVersionStatus{
Desired: configv1.Update{
Desired: configv1.Release{
Version: "1.0.0",
},
},
Expand Down Expand Up @@ -336,7 +336,7 @@ func TestIncompatibleOperators(t *testing.T) {
Name: "version",
},
Status: configv1.ClusterVersionStatus{
Desired: configv1.Update{
Desired: configv1.Release{
Version: "1.0.0",
},
},
Expand Down Expand Up @@ -381,7 +381,7 @@ func TestIncompatibleOperators(t *testing.T) {
Name: "version",
},
Status: configv1.ClusterVersionStatus{
Desired: configv1.Update{
Desired: configv1.Release{
Version: "1.0.0",
},
},
Expand Down Expand Up @@ -429,7 +429,7 @@ func TestIncompatibleOperators(t *testing.T) {
Name: "version",
},
Status: configv1.ClusterVersionStatus{
Desired: configv1.Update{
Desired: configv1.Release{
Version: "", // This should result in an transient error
},
},
Expand Down Expand Up @@ -458,7 +458,7 @@ func TestIncompatibleOperators(t *testing.T) {
Name: "version",
},
Status: configv1.ClusterVersionStatus{
Desired: configv1.Update{
Desired: configv1.Release{
Version: "1.0.1", // Next Y-stream is 1.1.0, NOT 1.1.1
},
},
Expand All @@ -482,7 +482,7 @@ func TestIncompatibleOperators(t *testing.T) {
Name: "version",
},
Status: configv1.ClusterVersionStatus{
Desired: configv1.Update{
Desired: configv1.Release{
Version: "1.1.0-pre", // Next Y-stream is 1.1.0, NOT 1.2.0
},
},
Expand Down
5 changes: 3 additions & 2 deletions pkg/controller/operators/openshift/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
. "github.com/onsi/gomega"
configv1 "github.com/openshift/api/config/v1"
"github.com/operator-framework/api/crds"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/rest"
ctrl "sigs.k8s.io/controller-runtime"
Expand Down Expand Up @@ -54,8 +55,8 @@ var _ = BeforeSuite(func() {
base := filepath.Join("..", "..", "..", "..", "vendor", "github.com", "openshift", "api", "config", "v1")
testEnv = &envtest.Environment{
ErrorIfCRDPathMissing: true,
CRDs: []client.Object{
crds.ClusterServiceVersion(),
CRDs: []apiextensionsv1.CustomResourceDefinition{
*crds.ClusterServiceVersion(),
},
CRDDirectoryPaths: []string{
filepath.Join(base, "0000_00_cluster-version-operator_01_clusteroperator.crd.yaml"),
Expand Down
16 changes: 8 additions & 8 deletions pkg/controller/operators/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ var _ = BeforeSuite(func() {
useExisting := false
testEnv = &envtest.Environment{
UseExistingCluster: &useExisting,
CRDs: []client.Object{
crds.CatalogSource(),
crds.ClusterServiceVersion(),
crds.InstallPlan(),
crds.Subscription(),
crds.OperatorGroup(),
crds.Operator(),
crds.OperatorCondition(),
CRDs: []apiextensionsv1.CustomResourceDefinition{
Copy link
Contributor

@tylerslaton tylerslaton Dec 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nb: Is this something we should move to across the board when using controller-runtime moving forward?

*crds.CatalogSource(),
*crds.ClusterServiceVersion(),
*crds.InstallPlan(),
*crds.Subscription(),
*crds.OperatorGroup(),
*crds.Operator(),
*crds.OperatorCondition(),
},
}

Expand Down
48 changes: 25 additions & 23 deletions test/e2e/deprecated_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ var _ = Describe("Not found APIs", func() {
// each entry is an installplan with a deprecated resource
type payload struct {
name string
ip *operatorsv1alpha1.InstallPlan
IP *operatorsv1alpha1.InstallPlan
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: Why was this exported?

errMessage string
}

var tableEntries []table.TableEntry
tableEntries = []table.TableEntry{
table.Entry("contains an entry with a missing API not found on cluster ", payload{
name: "installplan contains a missing API",
ip: &operatorsv1alpha1.InstallPlan{
IP: &operatorsv1alpha1.InstallPlan{
ObjectMeta: metav1.ObjectMeta{
Namespace: *namespace, // this is necessary due to ginkgo table semantics, see https://github.com/onsi/ginkgo/issues/378
Name: "test-plan-api",
Expand All @@ -48,41 +48,43 @@ var _ = Describe("Not found APIs", func() {
Approved: true,
ClusterServiceVersionNames: []string{},
},
Status: operatorsv1alpha1.InstallPlanStatus{
Phase: operatorsv1alpha1.InstallPlanPhaseInstalling,
CatalogSources: []string{},
Plan: []*operatorsv1alpha1.Step{
{
Resolving: "test-csv",
Status: operatorsv1alpha1.StepStatusUnknown,
Resource: operatorsv1alpha1.StepResource{
Name: "my.thing",
Group: "verticalpodautoscalers.autoscaling.k8s.io",
Version: "v1",
Kind: "VerticalPodAutoscaler",
Manifest: missingAPI,
},
},
},
},
},
errMessage: "api-server resource not found installing VerticalPodAutoscaler my.thing: GroupVersionKind " +
"verticalpodautoscalers.autoscaling.k8s.io/v1, Kind=VerticalPodAutoscaler not found on the cluster",
}),
}

table.DescribeTable("the ip enters a failed state with a helpful error message", func(tt payload) {
Expect(ctx.Ctx().Client().Create(context.Background(), tt.ip)).To(Succeed())
Expect(ctx.Ctx().Client().Status().Update(context.Background(), tt.ip)).To(Succeed())
Expect(ctx.Ctx().Client().Create(context.Background(), tt.IP)).To(Succeed())

tt.IP.Status = operatorsv1alpha1.InstallPlanStatus{
Phase: operatorsv1alpha1.InstallPlanPhaseInstalling,
CatalogSources: []string{},
Plan: []*operatorsv1alpha1.Step{
{
Resolving: "test-csv",
Status: operatorsv1alpha1.StepStatusUnknown,
Resource: operatorsv1alpha1.StepResource{
Name: "my.thing",
Group: "verticalpodautoscalers.autoscaling.k8s.io",
Version: "v1",
Kind: "VerticalPodAutoscaler",
Manifest: missingAPI,
},
},
},
}

Expect(ctx.Ctx().Client().Status().Update(context.Background(), tt.IP)).To(Succeed(), "failed to update the resource")

// The IP sits in the Installing phase with the GVK missing error
Eventually(func() (*operatorsv1alpha1.InstallPlan, error) {
return tt.ip, ctx.Ctx().Client().Get(context.Background(), client.ObjectKeyFromObject(tt.ip), tt.ip)
return tt.IP, ctx.Ctx().Client().Get(context.Background(), client.ObjectKeyFromObject(tt.IP), tt.IP)
}).Should(And(HavePhase(operatorsv1alpha1.InstallPlanPhaseInstalling)), HaveMessage(tt.errMessage))

// Eventually the IP fails with the GVK missing error, after installplan retries, which is by default 1 minute.
Eventually(func() (*operatorsv1alpha1.InstallPlan, error) {
return tt.ip, ctx.Ctx().Client().Get(context.Background(), client.ObjectKeyFromObject(tt.ip), tt.ip)
return tt.IP, ctx.Ctx().Client().Get(context.Background(), client.ObjectKeyFromObject(tt.IP), tt.IP)
}, 2*time.Minute).Should(And(HavePhase(operatorsv1alpha1.InstallPlanPhaseFailed)), HaveMessage(tt.errMessage))
}, tableEntries...)
})
Expand Down
Loading