Repository: crossplane/crossplane
Pull request #6281 (2025-02-07 17:18:26)

[Backport release-1.19] Add COMPOSITIONREVISION to the composite object output for "-o wide"
# Description
Backport of #6266 to `release-1.19`.


Patch:
diff --git a/internal/xcrd/schemas.go b/internal/xcrd/schemas.go
index 2c4c7e4e1..e39d19083 100644
--- a/internal/xcrd/schemas.go
+++ b/internal/xcrd/schemas.go
@@ -373,6 +373,12 @@ func CompositeResourcePrinterColumns() []extv1.CustomResourceColumnDefinition {
 			Type:     "string",
 			JSONPath: ".spec.compositionRef.name",
 		},
+		{
+			Name:     "COMPOSITIONREVISION",
+			Type:     "string",
+			JSONPath: ".spec.compositionRevisionRef.name",
+			Priority: 1,
+		},
 		{
 			Name:     "AGE",
 			Type:     "date",


Test patch:
diff --git a/cmd/crank/beta/validate/validate_test.go b/cmd/crank/beta/validate/validate_test.go
index befddda10..5524bbe68 100644
--- a/cmd/crank/beta/validate/validate_test.go
+++ b/cmd/crank/beta/validate/validate_test.go
@@ -312,6 +312,12 @@ func TestConvertToCRDs(t *testing.T) {
 											Type:     "string",
 											JSONPath: ".spec.compositionRef.name",
 										},
+										{
+											Name:     "COMPOSITIONREVISION",
+											Type:     "string",
+											JSONPath: ".spec.compositionRevisionRef.name",
+											Priority: 1,
+										},
 										{
 											Name:     "AGE",
 											Type:     "date",
@@ -650,6 +656,12 @@ func TestConvertToCRDs(t *testing.T) {
 											Type:     "string",
 											JSONPath: ".spec.compositionRef.name",
 										},
+										{
+											Name:     "COMPOSITIONREVISION",
+											Type:     "string",
+											JSONPath: ".spec.compositionRevisionRef.name",
+											Priority: 1,
+										},
 										{
 											Name:     "AGE",
 											Type:     "date",
diff --git a/internal/xcrd/crd_test.go b/internal/xcrd/crd_test.go
index 246cc33eb..2669057ea 100644
--- a/internal/xcrd/crd_test.go
+++ b/internal/xcrd/crd_test.go
@@ -248,6 +248,12 @@ func TestForCompositeResource(t *testing.T) {
 									Type:     "string",
 									JSONPath: ".spec.compositionRef.name",
 								},
+								{
+									Name:     "COMPOSITIONREVISION",
+									Type:     "string",
+									JSONPath: ".spec.compositionRevisionRef.name",
+									Priority: 1,
+								},
 								{
 									Name:     "AGE",
 									Type:     "date",
@@ -559,6 +565,12 @@ func TestForCompositeResource(t *testing.T) {
 									Type:     "string",
 									JSONPath: ".spec.compositionRef.name",
 								},
+								{
+									Name:     "COMPOSITIONREVISION",
+									Type:     "string",
+									JSONPath: ".spec.compositionRevisionRef.name",
+									Priority: 1,
+								},
 								{
 									Name:     "AGE",
 									Type:     "date",
@@ -848,6 +860,12 @@ func TestForCompositeResource(t *testing.T) {
 									Type:     "string",
 									JSONPath: ".spec.compositionRef.name",
 								},
+								{
+									Name:     "COMPOSITIONREVISION",
+									Type:     "string",
+									JSONPath: ".spec.compositionRevisionRef.name",
+									Priority: 1,
+								},
 								{
 									Name:     "AGE",
 									Type:     "date",
@@ -1100,6 +1118,12 @@ func TestForCompositeResource(t *testing.T) {
 									Type:     "string",
 									JSONPath: ".spec.compositionRef.name",
 								},
+								{
+									Name:     "COMPOSITIONREVISION",
+									Type:     "string",
+									JSONPath: ".spec.compositionRevisionRef.name",
+									Priority: 1,
+								},
 								{
 									Name:     "AGE",
 									Type:     "date",
@@ -1388,6 +1412,12 @@ func TestForCompositeResource(t *testing.T) {
 									Type:     "string",
 									JSONPath: ".spec.compositionRef.name",
 								},
+								{
+									Name:     "COMPOSITIONREVISION",
+									Type:     "string",
+									JSONPath: ".spec.compositionRevisionRef.name",
+									Priority: 1,
+								},
 								{
 									Name:     "AGE",
 									Type:     "date",
@@ -1686,6 +1716,12 @@ func TestForCompositeResource(t *testing.T) {
 									Type:     "string",
 									JSONPath: ".spec.compositionRef.name",
 								},
+								{
+									Name:     "COMPOSITIONREVISION",
+									Type:     "string",
+									JSONPath: ".spec.compositionRevisionRef.name",
+									Priority: 1,
+								},
 								{
 									Name:     "AGE",
 									Type:     "date",