Skip to content

Commit

Permalink
Fix CRD apiextensions.k8s.io/v1 generation refs #117, #101
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ruoss committed Aug 31, 2022
1 parent aa0278c commit 42daf09
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Fixed

- CRD manifest generation for `apiextensions.k8s.io/v1` ([#143](https://github.com/coryodaniel/bonny/pull/143), [#117](https://github.com/coryodaniel/bonny/issues/117), [#101](https://github.com/coryodaniel/bonny/pull/101))

## [0.5.1] - 2022-05-25

### Fixed
Expand Down
12 changes: 8 additions & 4 deletions lib/bonny/crd.ex
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,15 @@ defmodule Bonny.CRD do
|> Map.put(:versions, [
%{
name: version,
scheme: %{
openAPIV3Scheme: %{
additionalPrinterColumns: additional_printer_columns_v1
served: true,
storage: true,
schema: %{
openAPIV3Schema: %{
type: "object",
"x-kubernetes-preserve-unknown-fields": true
}
}
},
additionalPrinterColumns: additional_printer_columns_v1
}
])
end
Expand Down
30 changes: 17 additions & 13 deletions test/bonny/crd_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,24 @@ defmodule Bonny.CRDTest do
versions: [
%{
name: "v1",
scheme: %{
openAPIV3Scheme: %{
additionalPrinterColumns: [
%{jsonPath: ".spec.test", description: "test", name: "test", type: "string"},
%{
jsonPath: ".metadata.creationTimestamp",
description:
"CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\n Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata",
name: "Age",
type: "date"
}
]
served: true,
storage: true,
schema: %{
openAPIV3Schema: %{
type: "object",
"x-kubernetes-preserve-unknown-fields": true
}
}
},
additionalPrinterColumns: [
%{jsonPath: ".spec.test", description: "test", name: "test", type: "string"},
%{
jsonPath: ".metadata.creationTimestamp",
description:
"CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\n Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata",
name: "Age",
type: "date"
}
]
}
]
}
Expand Down

0 comments on commit 42daf09

Please sign in to comment.