Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
8fafb65
Add pedjak to OWNER_ALIASES as reviwer (#2227)
perdasilva Sep 19, 2025
ee3456a
:seedling: Bump regex from 2025.9.1 to 2025.9.18 (#2228)
dependabot[bot] Sep 19, 2025
5478ac6
:sparkles: OPRUN-4150: Relax webhook support preconditions (#2222)
perdasilva Sep 19, 2025
d3e8883
:sparkles: OPRUN-4151: Add webhook rule validation (#2226)
perdasilva Sep 19, 2025
31e8b60
:seedling: Bump lxml from 6.0.1 to 6.0.2 (#2229)
dependabot[bot] Sep 22, 2025
16d1089
Make `ClusterExtensionRevision` `.spec.phases` optional (#2230)
pedjak Sep 22, 2025
47f8d31
Load CRDs for envtests from chart directory (#2232)
pedjak Sep 23, 2025
64147e3
Merge branch 'main' into synchronize
Sep 24, 2025
5a397ba
UPSTREAM: <carry>: Add OpenShift specific files
dtfranz Oct 26, 2023
5d48201
UPSTREAM: <carry>: Fix catalogd.Dockerfile to use new paths
tmshort Feb 26, 2025
45247cf
UPSTREAM: <carry>: Update DOWNSTREAM_OWNERS_ALIASES
tmshort Mar 6, 2025
4e7a25f
UPSTREAM: <carry>: Add openshift node selector annotation
oceanc80 Mar 26, 2025
b6f3753
UPSTREAM: <carry>: Add caalogd-cas-dir option to op-con
tmshort Apr 15, 2025
bfdb8d0
UPSTREAM: <carry>: set the SElinux type
jianzhangbjz Apr 27, 2025
8a5c775
UPSTREAM: <carry>: Add initial stack to run tests to validate the cat…
camilamacedo86 Apr 17, 2025
e3cf1c4
UPSTREAM: <carry>: Add vendor files for the catalog-sync tests
camilamacedo86 Apr 17, 2025
cb860eb
UPSTREAM: <carry>: Bump catalog versions to 4.19
tmshort Apr 24, 2025
675887e
UPSTREAM: <carry>: revert "Bump catalog versions to 4.19"
tmshort May 15, 2025
45b1cf1
UPSTREAM: <carry>: Update HOWTO-origin-tests
tmshort May 14, 2025
20b3496
UPSTREAM: <carry>: [DefaultCatalogTests]: Allow to pass auth path for…
camilamacedo86 May 16, 2025
256d38d
UPSTREAM: <carry>: fix: set NoLchown=true to allow image unpack on OCPci
camilamacedo86 May 19, 2025
531ff60
UPSTREAM: <carry>: [DefaultCatalogTests]: Moving parse of ENVVAR to t…
camilamacedo86 May 17, 2025
159cc0b
UPSTREAM: <carry>: [Default Catalog]: Create tmp dir to extract layer…
camilamacedo86 May 20, 2025
f299f63
UPSTREAM: <carry>: [Default Catalog](cleanp) Remove hack directory wh…
camilamacedo86 May 19, 2025
eef4198
UPSTREAM: <carry>: Change code implementation to extract layers in OC…
camilamacedo86 May 21, 2025
193ec35
UPSTREAM: <carry>: Add vendor files for change in the extract code im…
camilamacedo86 May 21, 2025
d4765dc
UPSTREAM: <carry>: [Default Catalog Tests]: Final cleanups and enhanc…
camilamacedo86 May 22, 2025
8db0864
UPSTREAM: <carry>: SELinux type for operator-controller
jianzhangbjz May 22, 2025
ca6ef39
UPSTREAM: <carry>: Bump catalog versions to 4.19
tmshort Apr 24, 2025
0b17887
UPSTREAM: <carry>: [Default Catalog Consistency Test] (feat) add chec…
camilamacedo86 May 28, 2025
a6ec245
UPSTREAM: <carry>: [Default Catalog Consistency Test]: fix junit outp…
camilamacedo86 Jun 2, 2025
6af73aa
UPSTREAM: <carry>: [Default Catalog Consistency Test] (feat) add chec…
camilamacedo86 May 29, 2025
553711d
UPSTREAM: <carry>: [Default Catalog Consistency Test]: Enable Catalog…
camilamacedo86 Jun 4, 2025
b912e67
UPSTREAM: <carry>: [Default Catalog Consistency Test]: Rename Tests s…
camilamacedo86 Jun 4, 2025
c431338
UPSTREAM: <carry>: Updating ose-olm-operator-controller-container ima…
Jun 18, 2025
649568e
UPSTREAM: <carry>: Updating ose-olm-catalogd-container image to be co…
Jun 18, 2025
4ae2565
UPSTREAM: <carry>: Update e2e registry to use 1.24/4.20
tmshort Jun 30, 2025
26e132b
UPSTREAM: <carry>: [Catalog Default Tests]: Upgrade go version to 1.2…
camilamacedo86 Jul 1, 2025
8759dbb
UPSTREAM: <carry>: Add structure to allow move the orgin tests using OTE
camilamacedo86 Jun 13, 2025
c65772a
UPSTREAM: <carry>: Add support for experimental manifests
tmshort Jul 2, 2025
8b957ea
UPSTREAM: <carry>: [OTE] - chore: follow up #383 – remove unreachable…
camilamacedo86 Jul 10, 2025
3088079
UPSTREAM: <carry>: Remove build of test image registry
tmshort Jul 9, 2025
9ae1a1a
UPSTREAM: <carry>: Add test-experimental-e2e target to openshift Make…
tmshort Jul 15, 2025
f233815
UPSTREAM: <carry>: [OTE]: Add binary in the operator controller image…
camilamacedo86 Jul 11, 2025
1f2cefb
UPSTREAM: <carry>: Fix experimental manifest copying
tmshort Jul 17, 2025
5790150
UPSTREAM: <carry>: Update manifest generation for upstream rbac/webhooks
tmshort Jul 17, 2025
52fc6a1
UPSTREAM: <carry>: [OTE] - Add tracking mechanism
camilamacedo86 Jul 17, 2025
35f56bc
UPSTREAM: <carry>: Update OTE dep to get fix
camilamacedo86 Jul 22, 2025
402ac4c
UPSTREAM: <carry>: [OTE] Add Readme
camilamacedo86 Jul 24, 2025
eec5c94
UPSTREAM: <carry>: set GIT_COMMIT env from SOURCE_GIT_COMMIT in Docke…
rashmigottipati Jun 6, 2025
4e2230d
UPSTREAM: <carry>: add openshift specific build target to pass commit…
ankitathomas Jun 11, 2025
17ae349
UPSTREAM: <carry>: add source commit into binaries when linking
bentito Jul 9, 2025
833306e
UPSTREAM: <carry>: OTE add first test from openshift/origin olmv1.go
camilamacedo86 Jul 19, 2025
74a908c
UPSTREAM: <carry>: Migrate tasks from openshift/origin olm v1.go file…
camilamacedo86 Jul 31, 2025
9aaa26b
UPSTREAM: <carry>: OTE - How to test locally with OCP instances
camilamacedo86 Aug 6, 2025
f72155a
UPSTREAM: <carry>: [OTE] Refac: refac helper and olmv1 test to create…
camilamacedo86 Aug 8, 2025
1f8405b
UPSTREAM: <carry>: [OTE] add webhook tests
camilamacedo86 Jul 31, 2025
4207a6c
UPSTREAM: <carry>: OTE: rewrite the upgrade incompatible operator test
tmshort Aug 11, 2025
a8860b9
UPSTREAM: <carry>: Handle service-ca cert availability/rotation
tmshort Aug 15, 2025
bfe7c9d
UPSTREAM: <carry>: [OTE] add webhook tests
sosiouxme Aug 14, 2025
eaa3050
UPSTREAM: <carry>: Upgrade OCP Catalog images from 4.19 to 4.20
camilamacedo86 Aug 13, 2025
a77a1db
UPSTREAM: <carry>: Remove bindata generation from build
tmshort Aug 15, 2025
ca4958a
UPSTREAM: <carry>: [OTE] Add webhook tests
camilamacedo86 Aug 13, 2025
834930c
UPSTREAM: <carry>: OTE add logs and dumps for olmv1 test and fix help…
camilamacedo86 Aug 15, 2025
91916d9
UPSTREAM: <carry>: [OTE] Migrate preflight checks from openshift/origin
camilamacedo86 Jul 31, 2025
59397ca
UPSTREAM: <carry>: [OTE] Add webhook to validate openshift-service-ca…
camilamacedo86 Aug 13, 2025
bf0f8ac
UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret dele…
camilamacedo86 Aug 21, 2025
e64e344
UPSTREAM: <carry>: [OTE] - Readme:Add info to help use payload-aggreg…
camilamacedo86 Aug 20, 2025
ad71a9f
UPSTREAM: <carry>: remove obsolete owners
grokspawn Aug 21, 2025
ba1230e
UPSTREAM: <carry>: [OTE] add catalog tests from openshift/origin
camilamacedo86 Jul 31, 2025
bd82396
UPSTREAM: <carry>: Migrate single/own namespace tests
camilamacedo86 Aug 8, 2025
048c1b0
UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret dele…
neisw Aug 25, 2025
cb1bb25
UPSTREAM: <carry>: Ensure unique name for bad-catalog tests
camilamacedo86 Aug 27, 2025
9a39c0b
UPSTREAM: <carry>: Revert "Handle service-ca cert availability/rotation"
tmshort Aug 29, 2025
3c38669
UPSTREAM: <carry>: grant QE approver permission for OTE
jianzhangbjz Aug 27, 2025
4c2f622
UPSTREAM: <carry>: Update webhook ote tests to use latest webhook-ope…
Sep 4, 2025
ed61477
UPSTREAM: <carry>: update operator-controller to v1.5.1
anik120 Sep 11, 2025
a2e3fbe
UPSTREAM: <carry>: configure watchnamespace using spec.config for OTE…
anik120 Sep 11, 2025
52f3797
UPSTREAM: <carry>: add jiazha to approvers
jianzhangbjz Sep 16, 2025
a43ef50
UPSTREAM: <carry>: Create combined manifests for comparison
tmshort Aug 14, 2025
5e0d008
UPSTREAM: <carry>: Use Helm charts for openshift manifests
tmshort Jul 24, 2025
5e78cb7
UPSTREAM: <carry>: add support for tests-private cases and add the case
kuiwang02 Sep 1, 2025
8881f52
UPSTREAM: <drop>: go mod vendor
Sep 24, 2025
138bdf3
UPSTREAM: <drop>: remove upstream GitHub configuration
Sep 24, 2025
dfdeb48
UPSTREAM: <drop>: configure the commit-checker
Sep 24, 2025
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
1 change: 1 addition & 0 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ aliases:
- thetechnick
- tmshort
- trgeiger
- pedjak

api-approvers:
- grokspawn
Expand Down
7 changes: 4 additions & 3 deletions api/v1/clusterextensionrevision_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ type ClusterExtensionRevisionSpec struct {
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="revision is immutable"
Revision int64 `json:"revision"`
// Phases are groups of objects that will be applied at the same time.
// All objects in the a phase will have to pass their probes in order to progress to the next phase.
// All objects in the phase will have to pass their probes in order to progress to the next phase.
//
// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="self == oldSelf || oldSelf.size() == 0", message="phases is immutable"
// +listType=map
// +listMapKey=name
Phases []ClusterExtensionRevisionPhase `json:"phases"`
// +optional
Phases []ClusterExtensionRevisionPhase `json:"phases,omitempty"`
// Previous references previous revisions that objects can be adopted from.
//
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="previous is immutable"
Expand Down Expand Up @@ -104,6 +104,7 @@ type ClusterExtensionRevisionObject struct {
// already existing on the cluster or even owned by another controller.
//
// +kubebuilder:default="Prevent"
// +optional
CollisionProtection CollisionProtection `json:"collisionProtection,omitempty"`
}

Expand Down
94 changes: 94 additions & 0 deletions api/v1/clusterextensionrevision_types_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package v1

import (
"context"
"fmt"
"testing"

"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func TestClusterExtensionRevisionImmutability(t *testing.T) {
c := newClient(t)
ctx := context.Background()
i := 0
for name, tc := range map[string]struct {
spec ClusterExtensionRevisionSpec
updateFunc func(*ClusterExtensionRevision)
allowed bool
}{
"revision is immutable": {
spec: ClusterExtensionRevisionSpec{
Revision: 1,
},
updateFunc: func(cer *ClusterExtensionRevision) {
cer.Spec.Revision = 2
},
},
"phases may be initially empty": {
spec: ClusterExtensionRevisionSpec{
Phases: []ClusterExtensionRevisionPhase{},
},
updateFunc: func(cer *ClusterExtensionRevision) {
cer.Spec.Phases = []ClusterExtensionRevisionPhase{
{
Name: "foo",
Objects: []ClusterExtensionRevisionObject{},
},
}
},
allowed: true,
},
"phases may be initially unset": {
spec: ClusterExtensionRevisionSpec{},
updateFunc: func(cer *ClusterExtensionRevision) {
cer.Spec.Phases = []ClusterExtensionRevisionPhase{
{
Name: "foo",
Objects: []ClusterExtensionRevisionObject{},
},
}
},
allowed: true,
},
"phases are immutable if not empty": {
spec: ClusterExtensionRevisionSpec{
Phases: []ClusterExtensionRevisionPhase{
{
Name: "foo",
Objects: []ClusterExtensionRevisionObject{},
},
},
},
updateFunc: func(cer *ClusterExtensionRevision) {
cer.Spec.Phases = []ClusterExtensionRevisionPhase{
{
Name: "foo2",
Objects: []ClusterExtensionRevisionObject{},
},
}
},
},
} {
t.Run(name, func(t *testing.T) {
cer := &ClusterExtensionRevision{
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("foo%d", i),
},
Spec: tc.spec,
}
i = i + 1
require.NoError(t, c.Create(ctx, cer))
tc.updateFunc(cer)
err := c.Update(ctx, cer)
if tc.allowed && err != nil {
t.Fatal("expected update to succeed, but got:", err)
}
if !tc.allowed && !errors.IsInvalid(err) {
t.Fatal("expected update to fail due to invalid payload, but got:", err)
}
})
}
}
61 changes: 61 additions & 0 deletions api/v1/suite_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
Copyright 2025.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1

import (
"log"
"os"
"testing"

"github.com/stretchr/testify/require"
apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/operator-framework/operator-controller/test"
)

func newScheme(t *testing.T) *apimachineryruntime.Scheme {
sch := apimachineryruntime.NewScheme()
require.NoError(t, AddToScheme(sch))
return sch
}

func newClient(t *testing.T) client.Client {
cl, err := client.New(config, client.Options{Scheme: newScheme(t)})
require.NoError(t, err)
require.NotNil(t, cl)
return cl
}

var config *rest.Config

func TestMain(m *testing.M) {
testEnv := test.NewEnv()

var err error
config, err = testEnv.Start()
utilruntime.Must(err)
if config == nil {
log.Panic("expected cfg to not be nil")
}

code := m.Run()
utilruntime.Must(testEnv.Stop())
os.Exit(code)
}
2 changes: 1 addition & 1 deletion commitchecker.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
expectedMergeBase: 33fdce258350eb563885ee41da087491a15829bd
expectedMergeBase: 47f8d312187f9f6a41118ee1c5c2f11c09afb7ce
upstreamBranch: main
upstreamOrg: operator-framework
upstreamRepo: operator-controller
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
phases:
description: |-
Phases are groups of objects that will be applied at the same time.
All objects in the a phase will have to pass their probes in order to progress to the next phase.
All objects in the phase will have to pass their probes in order to progress to the next phase.
items:
description: |-
ClusterExtensionRevisionPhase are groups of objects that will be applied at the same time.
Expand Down Expand Up @@ -130,7 +130,6 @@ spec:
- message: revision is immutable
rule: self == oldSelf
required:
- phases
- revision
type: object
status:
Expand Down
37 changes: 2 additions & 35 deletions internal/operator-controller/controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,18 @@ import (
"io/fs"
"log"
"os"
"path/filepath"
"testing"

"github.com/stretchr/testify/require"
apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
crfinalizer "sigs.k8s.io/controller-runtime/pkg/finalizer"

ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/operator-controller/controllers"
"github.com/operator-framework/operator-controller/test"
)

func newScheme(t *testing.T) *apimachineryruntime.Scheme {
Expand Down Expand Up @@ -93,27 +92,7 @@ func newClientAndReconciler(t *testing.T) (client.Client, *controllers.ClusterEx
var config *rest.Config

func TestMain(m *testing.M) {
testEnv := &envtest.Environment{
CRDDirectoryPaths: []string{
filepath.Join("..", "..", "..", "config", "base", "operator-controller", "crd", "experimental"),
},
ErrorIfCRDPathMissing: true,
}

// ENVTEST-based tests require specific binaries. By default, these binaries are located
// in paths defined by controller-runtime. However, the `BinaryAssetsDirectory` needs
// to be explicitly set when running tests directly (e.g., debugging tests in an IDE)
// without using the Makefile targets.
//
// This is equivalent to configuring your IDE to export the `KUBEBUILDER_ASSETS` environment
// variable before each test execution. The following function simplifies this process
// by handling the configuration for you.
//
// To ensure the binaries are in the expected path without manual configuration, run:
// `make envtest-k8s-bins`
if getFirstFoundEnvTestBinaryDir() != "" {
testEnv.BinaryAssetsDirectory = getFirstFoundEnvTestBinaryDir()
}
testEnv := test.NewEnv()

var err error
config, err = testEnv.Start()
Expand All @@ -126,15 +105,3 @@ func TestMain(m *testing.M) {
utilruntime.Must(testEnv.Stop())
os.Exit(code)
}

// getFirstFoundEnvTestBinaryDir finds and returns the first directory under the given path.
func getFirstFoundEnvTestBinaryDir() string {
basePath := filepath.Join("..", "..", "bin", "envtest-binaries", "k8s")
entries, _ := os.ReadDir(basePath)
for _, entry := range entries {
if entry.IsDir() {
return filepath.Join(basePath, entry.Name())
}
}
return ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ var BundleValidator = render.BundleValidator{
validators.CheckCRDResourceUniqueness,
validators.CheckOwnedCRDExistence,
validators.CheckPackageNameNotEmpty,
validators.CheckConversionWebhookSupport,
validators.CheckWebhookDeploymentReferentialIntegrity,
validators.CheckWebhookNameUniqueness,
validators.CheckWebhookNameIsDNS1123SubDomain,
validators.CheckConversionWebhookCRDReferenceUniqueness,
validators.CheckConversionWebhooksReferenceOwnedCRDs,
validators.CheckWebhookRules,
}

// ResourceGenerators a slice of ResourceGenerators required to generate plain resource manifests for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ func Test_BundleValidatorHasAllValidationFns(t *testing.T) {
validators.CheckCRDResourceUniqueness,
validators.CheckOwnedCRDExistence,
validators.CheckPackageNameNotEmpty,
validators.CheckConversionWebhookSupport,
validators.CheckWebhookDeploymentReferentialIntegrity,
validators.CheckWebhookNameUniqueness,
validators.CheckWebhookNameIsDNS1123SubDomain,
validators.CheckConversionWebhookCRDReferenceUniqueness,
validators.CheckConversionWebhooksReferenceOwnedCRDs,
validators.CheckWebhookRules,
}
actualValidationFns := registryv1.BundleValidator

Expand Down
Loading