Skip to content

Commit 8f51614

Browse files
authored
Add Print Conditions (#3011)
Signed-off-by: jose.vazquez <[email protected]>
1 parent 73d74cc commit 8f51614

19 files changed

+246
-306
lines changed

config/openapi2crd.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ spec:
4949
- reference_extensions
5050
- mutual_exclusive_major_versions
5151
- atlas_sdk_version
52+
- print_conditions
5253

5354
openapi:
5455
- name: v20250312

internal/generated/crds/crds.yaml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ spec:
2525
singular: group
2626
scope: Namespaced
2727
versions:
28-
- name: v1
28+
- additionalPrinterColumns:
29+
- jsonPath: .status.conditions[?(@.type=="Ready")].status
30+
name: Ready
31+
type: string
32+
- jsonPath: .status.conditions[?(@.type=="State")].reason
33+
name: State
34+
type: string
35+
name: v1
2936
schema:
3037
openAPIV3Schema:
3138
description: A group, managed by the MongoDB Kubernetes Atlas Operator.
@@ -235,7 +242,14 @@ spec:
235242
singular: cluster
236243
scope: Namespaced
237244
versions:
238-
- name: v1
245+
- additionalPrinterColumns:
246+
- jsonPath: .status.conditions[?(@.type=="Ready")].status
247+
name: Ready
248+
type: string
249+
- jsonPath: .status.conditions[?(@.type=="State")].reason
250+
name: State
251+
type: string
252+
name: v1
239253
schema:
240254
openAPIV3Schema:
241255
description: A cluster, managed by the MongoDB Kubernetes Atlas Operator.
@@ -1555,7 +1569,14 @@ spec:
15551569
singular: flexcluster
15561570
scope: Namespaced
15571571
versions:
1558-
- name: v1
1572+
- additionalPrinterColumns:
1573+
- jsonPath: .status.conditions[?(@.type=="Ready")].status
1574+
name: Ready
1575+
type: string
1576+
- jsonPath: .status.conditions[?(@.type=="State")].reason
1577+
name: State
1578+
type: string
1579+
name: v1
15591580
schema:
15601581
openAPIV3Schema:
15611582
description: A flexcluster, managed by the MongoDB Kubernetes Atlas Operator.
@@ -1880,7 +1901,14 @@ spec:
18801901
singular: databaseuser
18811902
scope: Namespaced
18821903
versions:
1883-
- name: v1
1904+
- additionalPrinterColumns:
1905+
- jsonPath: .status.conditions[?(@.type=="Ready")].status
1906+
name: Ready
1907+
type: string
1908+
- jsonPath: .status.conditions[?(@.type=="State")].reason
1909+
name: State
1910+
type: string
1911+
name: v1
18841912
schema:
18851913
openAPIV3Schema:
18861914
description: A databaseuser, managed by the MongoDB Kubernetes Atlas Operator.

tools/openapi2crd/config.example.yaml

Lines changed: 0 additions & 286 deletions
This file was deleted.

tools/openapi2crd/config.sample.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ spec:
3636
- reference_extensions
3737
- mutual_exclusive_major_versions
3838
- atlas_sdk_version
39+
- print_conditions
3940

4041
openapi:
4142
- name: v20250312

tools/openapi2crd/pkg/generator/generator.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ import (
2121
"log"
2222

2323
"github.com/getkin/kin-openapi/openapi3"
24-
"github.com/mongodb/mongodb-atlas-kubernetes/tools/openapi2crd/pkg/apis/config/v1alpha1"
25-
"github.com/mongodb/mongodb-atlas-kubernetes/tools/openapi2crd/pkg/config"
26-
"github.com/mongodb/mongodb-atlas-kubernetes/tools/openapi2crd/pkg/plugins"
2724
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions"
2825
"k8s.io/apimachinery/pkg/util/sets"
2926
"sigs.k8s.io/yaml"
27+
28+
"github.com/mongodb/mongodb-atlas-kubernetes/tools/openapi2crd/pkg/apis/config/v1alpha1"
29+
"github.com/mongodb/mongodb-atlas-kubernetes/tools/openapi2crd/pkg/config"
30+
"github.com/mongodb/mongodb-atlas-kubernetes/tools/openapi2crd/pkg/plugins"
3031
)
3132

3233
type Generator struct {

0 commit comments

Comments
 (0)