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
1586800
Use dedicated Secret type for externalized object Secrets (#2613)
pedjak Mar 31, 2026
ba1e4cb
🌱 OCPBUGS-60693, OCPBUGS-60958: Upgrade sigs.k8s.io/crdify v0.5.0 => …
camilamacedo86 Mar 31, 2026
06ed356
Merge branch 'main' into synchronize
Apr 1, 2026
a3ab8e8
UPSTREAM: <carry>: Add OpenShift specific files
dtfranz Oct 26, 2023
4c5e41b
UPSTREAM: <carry>: Add new tests for single/own namespaces install modes
camilamacedo86 Oct 6, 2025
1154656
UPSTREAM: <carry>: Upgrade OCP image from 4.20 to 4.21
camilamacedo86 Oct 13, 2025
fb5fd47
UPSTREAM: <carry>: [Default Catalog Tests] - Change logic to get ocp …
camilamacedo86 Oct 13, 2025
854bdd5
UPSTREAM: <carry>: Update OCP catalogs to v4.21
tmshort Oct 13, 2025
2108296
UPSTREAM: <carry>: support singleown cases in disconnected
kuiwang02 Oct 16, 2025
bb145db
UPSTREAM: <carry>: fix cases 81696 and 74618 for product code changes
kuiwang02 Oct 17, 2025
ce4886d
UPSTREAM: <carry>: Define Default timeouts and apply their usage accr…
camilamacedo86 Oct 22, 2025
732f00d
UPSTREAM: <carry>: Update to new feature-gate options in helm
tmshort Oct 22, 2025
dc6b924
UPSTREAM: <carry>: Fix flake for single/own ns tests by ensuring uniq…
camilamacedo86 Oct 22, 2025
4d95ce8
UPSTREAM: <carry>: [OTE]: Enhance single/own ns based on review comme…
camilamacedo86 Oct 24, 2025
b247b96
UPSTREAM: <carry>: Update OwnSingle template to use spec.config.inlin…
kuiwang02 Nov 3, 2025
838bf00
UPSTREAM: <carry>: [OTE]: Add webhook cleanup validation on extension…
camilamacedo86 Nov 4, 2025
f174b1a
UPSTREAM: <carry>: Add [OTP] to migrated cases
kuiwang02 Nov 7, 2025
56fee8b
UPSTREAM: <carry>: [OTE]: Upgrade dependencies used
camilamacedo86 Nov 5, 2025
06b21de
UPSTREAM: <carry>: fix(OTE): fix OpenShift Kubernetes replace version…
camilamacedo86 Nov 10, 2025
f6a8b76
UPSTREAM: <carry>: [Default Catalog Tests] Upgrade go 1.24.6 and depe…
camilamacedo86 Nov 11, 2025
828189c
UPSTREAM: <carry>: add disconnected environment support with custom p…
kuiwang02 Nov 12, 2025
b3b5450
UPSTREAM: <carry>: migrate jiazha test cases to OTE
jianzhangbjz Nov 14, 2025
a63caef
UPSTREAM: <carry>: migrate clustercatalog case to ote
Xia-Zhao-rh Oct 17, 2025
0755110
UPSTREAM: <carry>: migrate olmv1 QE stress cases
kuiwang02 Nov 20, 2025
d5d3049
UPSTREAM: <carry>: Use busybox/httpd to simulate probes
tmshort Nov 25, 2025
b319bb7
UPSTREAM: <carry>: migrate olmv1 QE cases
Xia-Zhao-rh Nov 25, 2025
c925594
UPSTREAM: <carry>: add agent for olmv1 qe cases
kuiwang02 Oct 21, 2025
c145688
UPSTREAM: <carry>: Disable upstream PodDisruptionBudget
tmshort Dec 3, 2025
8d72ebe
UPSTREAM: <carry>: Add AGENTS.md for AI code contributions
rashmigottipati Dec 11, 2025
017d245
UPSTREAM: <carry>: address review comments through addl prompts
rashmigottipati Dec 11, 2025
9c69588
UPSTREAM: <carry>: addressing some more review comments
rashmigottipati Dec 11, 2025
20fdc38
UPSTREAM: <carry>: remove DCO line
rashmigottipati Dec 11, 2025
c5450ee
UPSTREAM: <carry>: migrate bandrade test cases to OTE
bandrade Nov 18, 2025
fde1eeb
UPSTREAM: <carry>: update metadata
bandrade Dec 3, 2025
3c842d9
UPSTREAM: <carry>: remove originalName
bandrade Dec 3, 2025
44bc169
UPSTREAM: <carry>: update 80458's timeout to 180s
jianzhangbjz Dec 8, 2025
725bed8
UPSTREAM: <carry>: update 83026 to specify the clustercatalog
jianzhangbjz Dec 15, 2025
c43e531
UPSTREAM: <carry>: Update to golang 1.25 and ocp 4.22
oceanc80 Dec 18, 2025
73263a5
UPSTREAM: <carry>: Use oc client for running e2e tests
pedjak Jan 13, 2026
9d9f46e
UPSTREAM: <carry>: Run upstream e2e tests tagged with `@catalogd-update`
pedjak Jan 14, 2026
1634730
UPSTREAM: <carry>: enhance case to make it more stable
kuiwang02 Jan 6, 2026
c2dbee3
UPSTREAM: <carry>: add service account to curl job
ehearne-redhat Jan 7, 2026
cf562ae
UPSTREAM: <carry>: move sa creation out of buildCurlJob()
ehearne-redhat Jan 8, 2026
7793fea
UPSTREAM: <carry>: comment out delete service account
ehearne-redhat Jan 9, 2026
c723049
UPSTREAM: <carry>: move defercleanup for sa for LIFO
ehearne-redhat Jan 9, 2026
64624ef
UPSTREAM: <carry>: add polling so job fully deleted before proceed
ehearne-redhat Jan 12, 2026
77464be
UPSTREAM: <carry>: Revert "Merge pull request #594 from ehearne-redha…
sosiouxme Jan 20, 2026
76328c3
UPSTREAM: <carry>: Remove openshift-redhat-marketplace catalog tests
camilamacedo86 Jan 8, 2026
f4fc7a3
UPSTREAM: <carry>: config watchnamespace cases
kuiwang02 Jan 6, 2026
41f0f5f
UPSTREAM: <carry>: enhance ocp-79770
Xia-Zhao-rh Jan 26, 2026
f4370f1
UPSTREAM: <carry>: upgrade version support case
kuiwang02 Jan 28, 2026
0af6940
UPSTREAM: <carry>: Remove installed condition check from auth preflig…
Jan 30, 2026
f61a552
UPSTREAM: <carry>: Add openshift/api dependency
Jan 30, 2026
22b958c
UPSTREAM: <carry>: Add boxcutter specific preflight auth test
Jan 30, 2026
2a5f12d
UPSTREAM: <carry>: adjust watchnamespace case based on change
kuiwang02 Feb 2, 2026
1aef165
UPSTREAM: <carry>: fix(ote): Use as operator-controller dep from root…
camilamacedo86 Feb 3, 2026
4314fa7
UPSTREAM: <carry>: add 83979 automation
bandrade Feb 2, 2026
4d9b60e
UPSTREAM: <carry>: add 85889 automation
bandrade Feb 2, 2026
29131bc
UPSTREAM: <carry>: Update test-operator startup script to fix pod pro…
Feb 4, 2026
66c5973
UPSTREAM: <carry>: Fix up own-namespace invalid configuration test
Feb 7, 2026
06afb82
UPSTREAM: <carry>: Preflight tests use in-cluster catalog and bundles…
camilamacedo86 Feb 24, 2026
f95cbb4
UPSTREAM: <carry>: adjust sa and permission test cases per new change…
kuiwang02 Feb 2, 2026
a5a19db
UPSTREAM: <carry>: Update OCP catalogs to v4.22
camilamacedo86 Feb 3, 2026
4513bbf
UPSTREAM: <carry>: chore(OTE and Default Catalog Tests) Update go and…
camilamacedo86 Feb 26, 2026
0bf2567
UPSTREAM: <carry>: fix 83026 for TP cluster
jianzhangbjz Feb 28, 2026
e415b28
UPSTREAM: <carry>: serviceAccount validation unified across all runtimes
kuiwang02 Mar 6, 2026
965d202
UPSTREAM: <carry>: Fix OLMv1 test operator to listen on IPv6
stbenjam Mar 6, 2026
73c7dd3
UPSTREAM: <carry>: Increase install timeout and add diagnostic loggin…
camilamacedo86 Mar 11, 2026
c6b474b
UPSTREAM: <carry>: add service account to curl job
ehearne-redhat Mar 2, 2026
93a34f6
UPSTREAM: <carry>: update OCP-75441 to support multi-arch
jianzhangbjz Mar 19, 2026
c3defb7
UPSTREAM: <carry>: deployment config cases
kuiwang02 Feb 6, 2026
3a10a93
UPSTREAM: <carry>: Add OTE tests for OLMv1 DeploymentConfig support
tmshort Mar 11, 2026
ee0436a
UPSTREAM: <carry>: Update openshift/api and client-go
tmshort Mar 19, 2026
2e71de2
UPSTREAM: <carry>: Add boxcutter tests
camilamacedo86 Mar 23, 2026
d08998c
UPSTREAM: <carry>: enhance QE cases
Xia-Zhao-rh Mar 17, 2026
a770540
UPSTREAM: <carry>: Update quay-operator version to one containing arm…
dtfranz Mar 24, 2026
42838f0
UPSTREAM: <carry>: verify volume/volumeMount override
kuiwang02 Mar 25, 2026
8b33a0b
UPSTREAM: <carry>: Add long-duration test script and documents
jianzhangbjz Mar 11, 2026
9a738ef
UPSTREAM: <carry>: Update grpc in default-catalog-consistency tests
tmshort Mar 27, 2026
0d87737
UPSTREAM: <carry>: Rename ClusterExtensionRevision to ClusterObjectSe…
camilamacedo86 Mar 31, 2026
97bb262
UPSTREAM: <carry>: Skip incompatible operator test when Boxcutter use…
camilamacedo86 Mar 31, 2026
dc07c0f
UPSTREAM: <carry>: Add fgiudici as reviewer
fgiudici Mar 31, 2026
73f4186
UPSTREAM: <drop>: go mod vendor
Apr 1, 2026
a499017
UPSTREAM: <drop>: remove upstream GitHub configuration
Apr 1, 2026
798fc30
UPSTREAM: <drop>: configure the commit-checker
Apr 1, 2026
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
6 changes: 3 additions & 3 deletions .bingo/Variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ $(CONTROLLER_GEN): $(BINGO_DIR)/controller-gen.mod
@echo "(re)installing $(GOBIN)/controller-gen-v0.20.1"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=controller-gen.mod -o=$(GOBIN)/controller-gen-v0.20.1 "sigs.k8s.io/controller-tools/cmd/controller-gen"

CRD_DIFF := $(GOBIN)/crd-diff-v0.5.0
CRD_DIFF := $(GOBIN)/crd-diff-v0.5.1-0.20260309184313-54162f2e3097
$(CRD_DIFF): $(BINGO_DIR)/crd-diff.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/crd-diff-v0.5.0"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=crd-diff.mod -o=$(GOBIN)/crd-diff-v0.5.0 "sigs.k8s.io/crdify"
@echo "(re)installing $(GOBIN)/crd-diff-v0.5.1-0.20260309184313-54162f2e3097"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=crd-diff.mod -o=$(GOBIN)/crd-diff-v0.5.1-0.20260309184313-54162f2e3097 "sigs.k8s.io/crdify"

CRD_REF_DOCS := $(GOBIN)/crd-ref-docs-v0.3.0
$(CRD_REF_DOCS): $(BINGO_DIR)/crd-ref-docs.mod
Expand Down
2 changes: 1 addition & 1 deletion .bingo/crd-diff.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.24.6

require sigs.k8s.io/crdify v0.5.0
require sigs.k8s.io/crdify v0.5.1-0.20260309184313-54162f2e3097
2 changes: 2 additions & 0 deletions .bingo/crd-diff.sum
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ sigs.k8s.io/controller-runtime v0.16.2 h1:mwXAVuEk3EQf478PQwQ48zGOXvW27UJc8NHktQ
sigs.k8s.io/controller-runtime v0.16.2/go.mod h1:vpMu3LpI5sYWtujJOa2uPK61nB5rbwlN7BAB8aSLvGU=
sigs.k8s.io/crdify v0.5.0 h1:mrMH9CgXQPTZUpTU6Klqfnlys8bggv/7uvLT2lXSP7A=
sigs.k8s.io/crdify v0.5.0/go.mod h1:ZIFxaYNgKYmFtZCLPysncXQ8oqwnNlHQbRUfxJHZwzU=
sigs.k8s.io/crdify v0.5.1-0.20260309184313-54162f2e3097 h1:gwDRFCc64lhEpxY944IJFW+CrmMFXWH+JjpE0JHp42Y=
sigs.k8s.io/crdify v0.5.1-0.20260309184313-54162f2e3097/go.mod h1:ZIFxaYNgKYmFtZCLPysncXQ8oqwnNlHQbRUfxJHZwzU=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
Expand Down
2 changes: 1 addition & 1 deletion .bingo/variables.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CONFTEST="${GOBIN}/conftest-v0.62.0"

CONTROLLER_GEN="${GOBIN}/controller-gen-v0.20.1"

CRD_DIFF="${GOBIN}/crd-diff-v0.5.0"
CRD_DIFF="${GOBIN}/crd-diff-v0.5.1-0.20260309184313-54162f2e3097"

CRD_REF_DOCS="${GOBIN}/crd-ref-docs-v0.3.0"

Expand Down
1 change: 1 addition & 0 deletions commitchecker.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
expectedMergeBase: ba1e4cb6e9705f0182c60c66889db00b0523b10f
upstreamBranch: main
upstreamOrg: operator-framework
upstreamRepo: operator-controller
18 changes: 14 additions & 4 deletions docs/concepts/large-bundle-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,19 @@ follow for consistency and safe lifecycle management.

Recommended conventions:

1. **Immutability**: Secrets should set `immutable: true`. Because COS phases
1. **Secret type**: Secrets should use the dedicated type
`olm.operatorframework.io/object-data` to distinguish them from user-created
Secrets and enable easy identification. The system always sets this type on
Secrets it creates. The reconciler does not enforce the type when resolving
refs — Secrets with any type are accepted — but producers should set it for
consistency.

2. **Immutability**: Secrets should set `immutable: true`. Because COS phases
are immutable, the content backing a ref should not change after creation.
Mutable referenced Secrets are not rejected, but modifying them after the
COS is created leads to undefined behavior.

2. **Owner references**: Referenced Secrets should carry an ownerReference to
3. **Owner references**: Referenced Secrets should carry an ownerReference to
the COS so that Kubernetes garbage collection removes them when the COS is
deleted:
```yaml
Expand All @@ -159,7 +166,7 @@ Recommended conventions:
Secret when the COS is deleted. The reconciler does not delete referenced
Secrets itself.

3. **Revision label**: A label identifying the owning revision aids discovery,
4. **Revision label**: A label identifying the owning revision aids discovery,
debugging, and bulk cleanup:
```
olm.operatorframework.io/revision-name: <COS-name>
Expand Down Expand Up @@ -237,6 +244,7 @@ metadata:
uid: <revision-uid>
controller: true
immutable: true
type: olm.operatorframework.io/object-data
data:
service-account: <base64(JSON ServiceAccount manifest)>
cluster-role: <base64(JSON ClusterRole manifest)>
Expand All @@ -255,6 +263,7 @@ metadata:
uid: <revision-uid>
controller: true
immutable: true
type: olm.operatorframework.io/object-data
data:
my-crd: <base64(JSON CRD manifest)>
---
Expand All @@ -272,6 +281,7 @@ metadata:
uid: <revision-uid>
controller: true
immutable: true
type: olm.operatorframework.io/object-data
data:
deployment: <base64(JSON Deployment manifest)>
```
Expand Down Expand Up @@ -653,7 +663,7 @@ rollout semantics are unchanged.
| **Crash safety** | 3-step: Secrets → COS → patch ownerRefs; orphan cleanup via revision label | 2-step: COS → Secrets with ownerRefs; simpler but reconciler may see missing Secrets temporarily |
| **Flexibility** | Mixed inline/ref per object within the same phase is possible | All-or-nothing — either all phases inline or all externalized |
| **Storage efficiency** | Per-object compression misses cross-object redundancy; potentially more Secrets created in edge cases | Better compression from cross-phase redundancy; fewer Secrets |
| **Resource type** | Secret only | Secret only (with dedicated type) |
| **Resource type** | Secret with dedicated type `olm.operatorframework.io/object-data` | Secret with dedicated type `olm.operatorframework.io/revision-phase-data` |
| **Phases structure** | Unchanged — phases array preserved as-is; only individual objects gain a new resolution path | Replaced at the top level — phases field swapped for phasesRef |
| **Content addressability** | Content hash as Secret data key — key changes when content changes | Content hash embedded in Secret name — detects changes without fetching contents |

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ require (
pkg.package-operator.run/boxcutter v0.12.0
sigs.k8s.io/controller-runtime v0.23.3
sigs.k8s.io/controller-tools v0.20.1
sigs.k8s.io/crdify v0.5.0
sigs.k8s.io/crdify v0.5.1-0.20260309184313-54162f2e3097
sigs.k8s.io/structured-merge-diff/v6 v6.3.2
sigs.k8s.io/yaml v1.6.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,8 @@ sigs.k8s.io/controller-runtime v0.23.3 h1:VjB/vhoPoA9l1kEKZHBMnQF33tdCLQKJtydy4i
sigs.k8s.io/controller-runtime v0.23.3/go.mod h1:B6COOxKptp+YaUT5q4l6LqUJTRpizbgf9KSRNdQGns0=
sigs.k8s.io/controller-tools v0.20.1 h1:gkfMt9YodI0K85oT8rVi80NTXO/kDmabKR5Ajn5GYxs=
sigs.k8s.io/controller-tools v0.20.1/go.mod h1:b4qPmjGU3iZwqn34alUU5tILhNa9+VXK+J3QV0fT/uU=
sigs.k8s.io/crdify v0.5.0 h1:mrMH9CgXQPTZUpTU6Klqfnlys8bggv/7uvLT2lXSP7A=
sigs.k8s.io/crdify v0.5.0/go.mod h1:ZIFxaYNgKYmFtZCLPysncXQ8oqwnNlHQbRUfxJHZwzU=
sigs.k8s.io/crdify v0.5.1-0.20260309184313-54162f2e3097 h1:gwDRFCc64lhEpxY944IJFW+CrmMFXWH+JjpE0JHp42Y=
sigs.k8s.io/crdify v0.5.1-0.20260309184313-54162f2e3097/go.mod h1:ZIFxaYNgKYmFtZCLPysncXQ8oqwnNlHQbRUfxJHZwzU=
sigs.k8s.io/gateway-api v1.5.0 h1:duoo14Ky/fJXpjpmyMISE2RTBGnfCg8zICfTYLTnBJA=
sigs.k8s.io/gateway-api v1.5.0/go.mod h1:GvCETiaMAlLym5CovLxGjS0NysqFk3+Yuq3/rh6QL2o=
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
Expand Down
1 change: 1 addition & 0 deletions internal/operator-controller/applier/secretpacker.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func (p *SecretPacker) newSecret(data map[string][]byte) corev1.Secret {
},
},
Immutable: ptr.To(true),
Type: labels.SecretTypeObjectData,
Data: data,
}
}
Expand Down
1 change: 1 addition & 0 deletions internal/operator-controller/applier/secretpacker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func TestSecretPacker_Pack(t *testing.T) {
assert.True(t, strings.HasPrefix(result.Secrets[0].Name, "my-ext-3-"), "Secret name should be content-addressable with revision prefix")
assert.Equal(t, "olmv1-system", result.Secrets[0].Namespace)
assert.True(t, *result.Secrets[0].Immutable)
assert.Equal(t, labels.SecretTypeObjectData, result.Secrets[0].Type)
assert.Equal(t, "my-ext-3", result.Secrets[0].Labels[labels.RevisionNameKey])
assert.Equal(t, "my-ext", result.Secrets[0].Labels[labels.OwnerNameKey])

Expand Down
7 changes: 7 additions & 0 deletions internal/operator-controller/labels/labels.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
package labels

import corev1 "k8s.io/api/core/v1"

const (
// SecretTypeObjectData is the custom Secret type used for Secrets that store
// externalized object content referenced by ClusterObjectSet ref entries.
// It distinguishes OLM-managed ref Secrets from user-created Secrets.
SecretTypeObjectData corev1.SecretType = "olm.operatorframework.io/object-data" //nolint:gosec // G101 false positive: this is a Kubernetes Secret type identifier, not a credential

// OwnerKindKey is the label key used to record the kind of the owner
// resource responsible for creating or managing a ClusterObjectSet.
OwnerKindKey = "olm.operatorframework.io/owner-kind"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ func sameVersionErrors(results *runner.Results) []error {
}

errs := []error{}
for version, propertyResults := range results.SameVersionValidation {
for property, comparisonResults := range propertyResults {
for _, result := range comparisonResults {
for _, versionResult := range results.SameVersionValidation {
for _, propertyResult := range versionResult.PropertyComparisons {
for _, result := range propertyResult.ComparisonResults {
for _, err := range result.Errors {
msg := err
if result.Name == "unhandled" {
msg = conciseUnhandledMessage(err)
}
errs = append(errs, fmt.Errorf("%s: %s: %s: %s", version, property, result.Name, msg))
errs = append(errs, fmt.Errorf("%s: %s: %s: %s", versionResult.Version, propertyResult.Property, result.Name, msg))
}
}
}
Expand All @@ -183,15 +183,15 @@ func servedVersionErrors(results *runner.Results) []error {
}

errs := []error{}
for version, propertyResults := range results.ServedVersionValidation {
for property, comparisonResults := range propertyResults {
for _, result := range comparisonResults {
for _, versionResult := range results.ServedVersionValidation {
for _, propertyResult := range versionResult.PropertyComparisons {
for _, result := range propertyResult.ComparisonResults {
for _, err := range result.Errors {
msg := err
if result.Name == "unhandled" {
msg = conciseUnhandledMessage(err)
}
errs = append(errs, fmt.Errorf("%s: %s: %s: %s", version, property, result.Name, msg))
errs = append(errs, fmt.Errorf("%s: %s: %s: %s", versionResult.Version, propertyResult.Property, result.Name, msg))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ func TestInstall(t *testing.T) {
Manifest: getManifestString(t, "crd-description-changed.json"),
},
},
{
name: "optional field addition should not fail",
oldCrdPath: "crd-optional-field-old.json",
release: &release.Release{
Name: "test-release",
Manifest: getManifestString(t, "crd-optional-field-new.json"),
},
},
}

for _, tc := range tests {
Expand Down Expand Up @@ -370,6 +378,35 @@ func TestUpgrade(t *testing.T) {
)
},
},
{
name: "optional field addition should not fail",
oldCrdPath: "crd-optional-field-old.json",
release: &release.Release{
Name: "test-release",
Manifest: getManifestString(t, "crd-optional-field-new.json"),
},
},
{
name: "complex breaking changes should fail",
oldCrdPath: "crd-complex-breaking-changes-old.json",
release: &release.Release{
Name: "test-release",
Manifest: getManifestString(t, "crd-complex-breaking-changes-new.json"),
},
// This test verifies detection of multiple breaking changes in a single CRD upgrade:
// 1. Type changed from "object" to "" - Properly detected by type validator
// 2. Nullable changed from false to true - Properly detected by nullable validator
// 3. OneOf constraint added - Reported as "unhandled" (needs crdify support)
// See: https://github.com/kubernetes-sigs/crdify/issues/25
// The upgrade is correctly blocked, but OneOf changes need better categorization.
requireErr: wantErrorMsgs([]string{
`validating upgrade for CRD "services.networking.example.com"`,
`type: type changed`,
`nullable: nullable added`,
`unhandled: unhandled changes found`,
`OneOf`,
}),
},
}

for _, tc := range tests {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"apiVersion": "apiextensions.k8s.io/v1",
"kind": "CustomResourceDefinition",
"metadata": {
"name": "services.networking.example.com"
},
"spec": {
"group": "networking.example.com",
"versions": [
{
"name": "v1beta1",
"served": true,
"storage": true,
"schema": {
"openAPIV3Schema": {
"type": "object",
"properties": {
"spec": {
"type": "object",
"properties": {
"ingress": {
"type": "object",
"properties": {
"gateway": {
"type": "object",
"properties": {
"servers": {
"type": "array",
"items": {
"type": "object",
"properties": {
"hosts": {
"description": "One or more hosts exposed by this gateway",
"type": "array",
"items": {
"type": "string"
}
},
"port": {
"type": "object",
"properties": {
"name": {
"description": "Label assigned to the port",
"type": "string"
},
"number": {
"description": "Port number",
"type": "integer"
}
}
},
"tls": {
"nullable": true,
"oneOf": [
{
"required": ["mode", "credentialName"]
},
{
"required": ["httpsRedirect"]
}
],
"properties": {
"credentialName": {
"description": "TLS certificate name",
"type": "string"
},
"httpsRedirect": {
"description": "If set to true, the load balancer will send a 301 redirect to HTTPS",
"type": "boolean"
},
"mode": {
"description": "TLS mode",
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
],
"scope": "Namespaced",
"names": {
"plural": "services",
"singular": "service",
"kind": "Service",
"shortNames": [
"svc"
]
}
},
"status": {
"storedVersions": [
"v1beta1"
]
}
}
Loading