Skip to content

Commit d1587b4

Browse files
authored
Add CompositionRevision column to composite output (crossplane#6266)
Fixes crossplane#6265 Signed-off-by: Bob Haddleton <[email protected]>
1 parent 316e840 commit d1587b4

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

cmd/crank/beta/validate/validate_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,12 @@ func TestConvertToCRDs(t *testing.T) {
312312
Type: "string",
313313
JSONPath: ".spec.compositionRef.name",
314314
},
315+
{
316+
Name: "COMPOSITIONREVISION",
317+
Type: "string",
318+
JSONPath: ".spec.compositionRevisionRef.name",
319+
Priority: 1,
320+
},
315321
{
316322
Name: "AGE",
317323
Type: "date",
@@ -650,6 +656,12 @@ func TestConvertToCRDs(t *testing.T) {
650656
Type: "string",
651657
JSONPath: ".spec.compositionRef.name",
652658
},
659+
{
660+
Name: "COMPOSITIONREVISION",
661+
Type: "string",
662+
JSONPath: ".spec.compositionRevisionRef.name",
663+
Priority: 1,
664+
},
653665
{
654666
Name: "AGE",
655667
Type: "date",

internal/xcrd/crd_test.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@ func TestForCompositeResource(t *testing.T) {
248248
Type: "string",
249249
JSONPath: ".spec.compositionRef.name",
250250
},
251+
{
252+
Name: "COMPOSITIONREVISION",
253+
Type: "string",
254+
JSONPath: ".spec.compositionRevisionRef.name",
255+
Priority: 1,
256+
},
251257
{
252258
Name: "AGE",
253259
Type: "date",
@@ -559,6 +565,12 @@ func TestForCompositeResource(t *testing.T) {
559565
Type: "string",
560566
JSONPath: ".spec.compositionRef.name",
561567
},
568+
{
569+
Name: "COMPOSITIONREVISION",
570+
Type: "string",
571+
JSONPath: ".spec.compositionRevisionRef.name",
572+
Priority: 1,
573+
},
562574
{
563575
Name: "AGE",
564576
Type: "date",
@@ -848,6 +860,12 @@ func TestForCompositeResource(t *testing.T) {
848860
Type: "string",
849861
JSONPath: ".spec.compositionRef.name",
850862
},
863+
{
864+
Name: "COMPOSITIONREVISION",
865+
Type: "string",
866+
JSONPath: ".spec.compositionRevisionRef.name",
867+
Priority: 1,
868+
},
851869
{
852870
Name: "AGE",
853871
Type: "date",
@@ -1100,6 +1118,12 @@ func TestForCompositeResource(t *testing.T) {
11001118
Type: "string",
11011119
JSONPath: ".spec.compositionRef.name",
11021120
},
1121+
{
1122+
Name: "COMPOSITIONREVISION",
1123+
Type: "string",
1124+
JSONPath: ".spec.compositionRevisionRef.name",
1125+
Priority: 1,
1126+
},
11031127
{
11041128
Name: "AGE",
11051129
Type: "date",
@@ -1388,6 +1412,12 @@ func TestForCompositeResource(t *testing.T) {
13881412
Type: "string",
13891413
JSONPath: ".spec.compositionRef.name",
13901414
},
1415+
{
1416+
Name: "COMPOSITIONREVISION",
1417+
Type: "string",
1418+
JSONPath: ".spec.compositionRevisionRef.name",
1419+
Priority: 1,
1420+
},
13911421
{
13921422
Name: "AGE",
13931423
Type: "date",
@@ -1686,6 +1716,12 @@ func TestForCompositeResource(t *testing.T) {
16861716
Type: "string",
16871717
JSONPath: ".spec.compositionRef.name",
16881718
},
1719+
{
1720+
Name: "COMPOSITIONREVISION",
1721+
Type: "string",
1722+
JSONPath: ".spec.compositionRevisionRef.name",
1723+
Priority: 1,
1724+
},
16891725
{
16901726
Name: "AGE",
16911727
Type: "date",

internal/xcrd/schemas.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,12 @@ func CompositeResourcePrinterColumns() []extv1.CustomResourceColumnDefinition {
373373
Type: "string",
374374
JSONPath: ".spec.compositionRef.name",
375375
},
376+
{
377+
Name: "COMPOSITIONREVISION",
378+
Type: "string",
379+
JSONPath: ".spec.compositionRevisionRef.name",
380+
Priority: 1,
381+
},
376382
{
377383
Name: "AGE",
378384
Type: "date",

0 commit comments

Comments
 (0)