Skip to content
Open
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
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ require (
github.com/stretchr/testify v1.11.1
go.podman.io/image/v5 v5.40.0
go.uber.org/mock v0.6.0
go.yaml.in/yaml/v3 v3.0.4
golang.org/x/net v0.56.0
golang.org/x/sync v0.21.0
golang.org/x/time v0.15.0
google.golang.org/grpc v1.82.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.36.2
k8s.io/apiextensions-apiserver v0.36.2
k8s.io/apimachinery v0.36.2
Expand Down Expand Up @@ -174,7 +174,6 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.1 // indirect
go.yaml.in/yaml/v2 v2.4.4 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.53.0 // indirect
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f // indirect
golang.org/x/mod v0.37.0 // indirect
Expand All @@ -193,6 +192,7 @@ require (
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/gengo/v2 v2.0.0-20250922181213-ec3ebc5fd46b // indirect
Comment on lines 193 to 196

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is an indirect dependency which will be removedonce the direct dependencies migrate to the maintained yaml gomodule

k8s.io/kms v0.36.2 // indirect
k8s.io/streaming v0.36.2 // indirect
Expand Down
43 changes: 29 additions & 14 deletions pkg/controller/operators/catalog/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (

"github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"
"go.yaml.in/yaml/v3"
"golang.org/x/time/rate"
"gopkg.in/yaml.v3"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
Expand Down Expand Up @@ -219,7 +219,8 @@ func TestTransitionInstallPlan(t *testing.T) {

func TestSyncInstallPlanUnhappy(t *testing.T) {
namespace := "ns"
ipWithSteps := withSteps(installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
ipWithSteps := withSteps(
installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
[]*v1alpha1.Step{
{
Resource: v1alpha1.StepResource{
Expand Down Expand Up @@ -421,7 +422,8 @@ func TestExecutePlan(t *testing.T) {
},
{
testName: "MultipleSteps",
in: withSteps(installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
in: withSteps(
installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
[]*v1alpha1.Step{
{
Resource: v1alpha1.StepResource{
Expand Down Expand Up @@ -454,7 +456,8 @@ func TestExecutePlan(t *testing.T) {
},
{
testName: "CreateServiceAccount",
in: withSteps(installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
in: withSteps(
installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
[]*v1alpha1.Step{
{
Resource: v1alpha1.StepResource{
Expand All @@ -476,7 +479,8 @@ func TestExecutePlan(t *testing.T) {
},
{
testName: "CreateConfigMap",
in: withSteps(installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
in: withSteps(
installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
[]*v1alpha1.Step{
{
Resource: v1alpha1.StepResource{
Expand All @@ -497,7 +501,8 @@ func TestExecutePlan(t *testing.T) {
},
{
testName: "CreateSecretFromBundle",
in: withSteps(installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
in: withSteps(
installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
[]*v1alpha1.Step{
{
Resource: v1alpha1.StepResource{
Expand All @@ -518,7 +523,8 @@ func TestExecutePlan(t *testing.T) {
},
{
testName: "DoesNotCreateSecretNotFromBundle",
in: withSteps(installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
in: withSteps(
installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
[]*v1alpha1.Step{
{
Resource: v1alpha1.StepResource{
Expand All @@ -539,7 +545,8 @@ func TestExecutePlan(t *testing.T) {
},
{
testName: "UpdateServiceAccountWithSameFields",
in: withSteps(installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
in: withSteps(
installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
[]*v1alpha1.Step{
{
Resource: v1alpha1.StepResource{
Expand Down Expand Up @@ -573,7 +580,8 @@ func TestExecutePlan(t *testing.T) {
},
{
testName: "UpdateServiceAccountWithDiffFields",
in: withSteps(installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
in: withSteps(
installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
[]*v1alpha1.Step{
{
Resource: v1alpha1.StepResource{
Expand Down Expand Up @@ -607,7 +615,8 @@ func TestExecutePlan(t *testing.T) {
},
{
testName: "DynamicResourcesAreOwnerReferencedToCSV",
in: withSteps(installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
in: withSteps(
installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
[]*v1alpha1.Step{
{
Resolving: "csv",
Expand Down Expand Up @@ -640,7 +649,8 @@ func TestExecutePlan(t *testing.T) {
extObjs: []runtime.Object{decodeFile(t, "./testdata/prometheusrule.crd.yaml", &apiextensionsv1beta1.CustomResourceDefinition{})},
want: []runtime.Object{
csv("csv", namespace, nil, nil),
modify(t, decodeFile(t, "./testdata/prometheusrule.cr.yaml", &unstructured.Unstructured{}),
modify(
t, decodeFile(t, "./testdata/prometheusrule.cr.yaml", &unstructured.Unstructured{}),
withNamespace(namespace),
withOwner(csv("csv", namespace, nil, nil)),
modifyMeta(func(m metav1.Object) {
Expand Down Expand Up @@ -809,7 +819,8 @@ func TestExecutePlanDynamicResources(t *testing.T) {
}{
{
testName: "UnsupportedObject",
in: withSteps(installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
in: withSteps(
installPlan("p", namespace, v1alpha1.InstallPlanPhaseInstalling, "csv"),
[]*v1alpha1.Step{
{
Resource: v1alpha1.StepResource{
Expand Down Expand Up @@ -2212,7 +2223,8 @@ func NewFakeOperator(ctx context.Context, namespace string, namespaces []string,
configMapInformer := factory.Core().V1().ConfigMaps()
networkPolicyInformer := factory.Networking().V1().NetworkPolicies()

sharedInformers = append(sharedInformers,
sharedInformers = append(
sharedInformers,
roleInformer.Informer(),
roleBindingInformer.Informer(),
serviceAccountInformer.Informer(),
Expand Down Expand Up @@ -2257,7 +2269,8 @@ func NewFakeOperator(ctx context.Context, namespace string, namespaces []string,
),
workqueue.TypedRateLimitingQueueConfig[types.NamespacedName]{
Name: "resolver",
}),
},
),
resolver: config.resolver,
reconciler: config.reconciler,
recorder: config.recorder,
Expand Down Expand Up @@ -2294,6 +2307,7 @@ func NewFakeOperator(ctx context.Context, namespace string, namespaces []string,

return op, nil
}

func installPlan(name, namespace string, phase v1alpha1.InstallPlanPhase, names ...string) *v1alpha1.InstallPlan {
return &v1alpha1.InstallPlan{
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -2415,6 +2429,7 @@ func configMap(name, namespace string) *corev1.ConfigMap {
func grpcServerNetworkPolicy(catSrc *v1alpha1.CatalogSource, matchLabels map[string]string) *networkingv1.NetworkPolicy {
return reconciler.DesiredGRPCServerNetworkPolicy(catSrc, matchLabels)
}

func unpackBundlesNetworkPolicy(catSrc *v1alpha1.CatalogSource) *networkingv1.NetworkPolicy {
return reconciler.DesiredUnpackBundlesNetworkPolicy(catSrc)
}
Expand Down
2 changes: 1 addition & 1 deletion util/cpb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/operator-framework/operator-registry/pkg/lib/bundle"
"github.com/otiai10/copy"
"github.com/spf13/cobra"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
)

func main() {
Expand Down
Loading