Skip to content

Commit 4ca5455

Browse files
committed
feat: creates redacted TypedLocalObjectReference struct
1 parent 9d3e0ae commit 4ca5455

File tree

6 files changed

+55
-30
lines changed

6 files changed

+55
-30
lines changed

api/v1alpha1/addon_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ type AddonValues struct {
133133
// SourceRef is an object reference to Configmap/Secret inside the same namespace
134134
// which contains inline YAML representing the values for the Helm chart.
135135
// +kubebuilder:validation:Optional
136-
SourceRef *corev1.TypedLocalObjectReference `json:"sourceRef,omitempty"`
136+
SourceRef *TypedLocalObjectReference `json:"sourceRef,omitempty"`
137137
}
138138

139139
// NFD tells us to enable or disable the node feature discovery addon.

api/v1alpha1/crds/caren.nutanix.com_awsclusterconfigs.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,23 +109,20 @@ spec:
109109
SourceRef is an object reference to Configmap/Secret inside the same namespace
110110
which contains inline YAML representing the values for the Helm chart.
111111
properties:
112-
apiGroup:
113-
description: |-
114-
APIGroup is the group for the resource being referenced.
115-
If APIGroup is not specified, the specified Kind must be in the core API group.
116-
For any other third-party types, APIGroup is required.
117-
type: string
118112
kind:
119-
description: Kind is the type of resource being referenced
113+
description: Kind is the type of resource being referenced, valid values are ('Secret', 'ConfigMap').
114+
enum:
115+
- Secret
116+
- ConfigMap
120117
type: string
121118
name:
122-
description: Name is the name of resource being referenced
119+
description: Name is the name of resource being referenced.
120+
minLength: 1
123121
type: string
124122
required:
125123
- kind
126124
- name
127125
type: object
128-
x-kubernetes-map-type: atomic
129126
type: object
130127
required:
131128
- provider

api/v1alpha1/crds/caren.nutanix.com_dockerclusterconfigs.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,23 +109,20 @@ spec:
109109
SourceRef is an object reference to Configmap/Secret inside the same namespace
110110
which contains inline YAML representing the values for the Helm chart.
111111
properties:
112-
apiGroup:
113-
description: |-
114-
APIGroup is the group for the resource being referenced.
115-
If APIGroup is not specified, the specified Kind must be in the core API group.
116-
For any other third-party types, APIGroup is required.
117-
type: string
118112
kind:
119-
description: Kind is the type of resource being referenced
113+
description: Kind is the type of resource being referenced, valid values are ('Secret', 'ConfigMap').
114+
enum:
115+
- Secret
116+
- ConfigMap
120117
type: string
121118
name:
122-
description: Name is the name of resource being referenced
119+
description: Name is the name of resource being referenced.
120+
minLength: 1
123121
type: string
124122
required:
125123
- kind
126124
- name
127125
type: object
128-
x-kubernetes-map-type: atomic
129126
type: object
130127
required:
131128
- provider

api/v1alpha1/crds/caren.nutanix.com_nutanixclusterconfigs.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,23 +109,20 @@ spec:
109109
SourceRef is an object reference to Configmap/Secret inside the same namespace
110110
which contains inline YAML representing the values for the Helm chart.
111111
properties:
112-
apiGroup:
113-
description: |-
114-
APIGroup is the group for the resource being referenced.
115-
If APIGroup is not specified, the specified Kind must be in the core API group.
116-
For any other third-party types, APIGroup is required.
117-
type: string
118112
kind:
119-
description: Kind is the type of resource being referenced
113+
description: Kind is the type of resource being referenced, valid values are ('Secret', 'ConfigMap').
114+
enum:
115+
- Secret
116+
- ConfigMap
120117
type: string
121118
name:
122-
description: Name is the name of resource being referenced
119+
description: Name is the name of resource being referenced.
120+
minLength: 1
123121
type: string
124122
required:
125123
- kind
126124
- name
127125
type: object
128-
x-kubernetes-map-type: atomic
129126
type: object
130127
required:
131128
- provider

api/v1alpha1/meta_types.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2024 Nutanix. All rights reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package v1alpha1
5+
6+
// TypedLocalObjectReference contains enough information to let you locate the
7+
// typed referenced object inside the same namespace.
8+
// This is redacted from the upstream https://pkg.go.dev/k8s.io/api/core/v1#TypedLocalObjectReference
9+
type TypedLocalObjectReference struct {
10+
// Kind is the type of resource being referenced, valid values are ('Secret', 'ConfigMap').
11+
// +kubebuilder:validation:Enum=Secret;ConfigMap
12+
// +kubebuilder:validation:Required
13+
Kind string `json:"kind"`
14+
15+
// Name is the name of resource being referenced.
16+
// +kubebuilder:validation:Required
17+
// +kubebuilder:validation:MinLength=1
18+
Name string `json:"name"`
19+
}

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 17 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)