| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
package v1 |
| 20 |
|
| 21 |
import ( |
| 22 |
networkingv1 "k8s.io/api/networking/v1" |
| 23 |
apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 24 |
types "k8s.io/apimachinery/pkg/types" |
| 25 |
managedfields "k8s.io/apimachinery/pkg/util/managedfields" |
| 26 |
internal "k8s.io/client-go/applyconfigurations/internal" |
| 27 |
metav1 "k8s.io/client-go/applyconfigurations/meta/v1" |
| 28 |
) |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
type IngressClassApplyConfiguration struct { |
| 33 |
metav1.TypeMetaApplyConfiguration `json:",inline"` |
| 34 |
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` |
| 35 |
Spec *IngressClassSpecApplyConfiguration `json:"spec,omitempty"` |
| 36 |
} |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
func IngressClass(name string) *IngressClassApplyConfiguration { |
| 41 |
b := &IngressClassApplyConfiguration{} |
| 42 |
b.WithName(name) |
| 43 |
b.WithKind("IngressClass") |
| 44 |
b.WithAPIVersion("networking.k8s.io/v1") |
| 45 |
return b |
| 46 |
} |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
func ExtractIngressClass(ingressClass *networkingv1.IngressClass, fieldManager string) (*IngressClassApplyConfiguration, error) { |
| 60 |
return extractIngressClass(ingressClass, fieldManager, "") |
| 61 |
} |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
func ExtractIngressClassStatus(ingressClass *networkingv1.IngressClass, fieldManager string) (*IngressClassApplyConfiguration, error) { |
| 67 |
return extractIngressClass(ingressClass, fieldManager, "status") |
| 68 |
} |
| 69 |
|
| 70 |
func extractIngressClass(ingressClass *networkingv1.IngressClass, fieldManager string, subresource string) (*IngressClassApplyConfiguration, error) { |
| 71 |
b := &IngressClassApplyConfiguration{} |
| 72 |
err := managedfields.ExtractInto(ingressClass, internal.Parser().Type("io.k8s.api.networking.v1.IngressClass"), fieldManager, b, subresource) |
| 73 |
if err != nil { |
| 74 |
return nil, err |
| 75 |
} |
| 76 |
b.WithName(ingressClass.Name) |
| 77 |
|
| 78 |
b.WithKind("IngressClass") |
| 79 |
b.WithAPIVersion("networking.k8s.io/v1") |
| 80 |
return b, nil |
| 81 |
} |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
func (b *IngressClassApplyConfiguration) WithKind(value string) *IngressClassApplyConfiguration { |
| 87 |
b.TypeMetaApplyConfiguration.Kind = &value |
| 88 |
return b |
| 89 |
} |
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
func (b *IngressClassApplyConfiguration) WithAPIVersion(value string) *IngressClassApplyConfiguration { |
| 95 |
b.TypeMetaApplyConfiguration.APIVersion = &value |
| 96 |
return b |
| 97 |
} |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
func (b *IngressClassApplyConfiguration) WithName(value string) *IngressClassApplyConfiguration { |
| 103 |
b.ensureObjectMetaApplyConfigurationExists() |
| 104 |
b.ObjectMetaApplyConfiguration.Name = &value |
| 105 |
return b |
| 106 |
} |
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
func (b *IngressClassApplyConfiguration) WithGenerateName(value string) *IngressClassApplyConfiguration { |
| 112 |
b.ensureObjectMetaApplyConfigurationExists() |
| 113 |
b.ObjectMetaApplyConfiguration.GenerateName = &value |
| 114 |
return b |
| 115 |
} |
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
func (b *IngressClassApplyConfiguration) WithNamespace(value string) *IngressClassApplyConfiguration { |
| 121 |
b.ensureObjectMetaApplyConfigurationExists() |
| 122 |
b.ObjectMetaApplyConfiguration.Namespace = &value |
| 123 |
return b |
| 124 |
} |
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
func (b *IngressClassApplyConfiguration) WithUID(value types.UID) *IngressClassApplyConfiguration { |
| 130 |
b.ensureObjectMetaApplyConfigurationExists() |
| 131 |
b.ObjectMetaApplyConfiguration.UID = &value |
| 132 |
return b |
| 133 |
} |
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
func (b *IngressClassApplyConfiguration) WithResourceVersion(value string) *IngressClassApplyConfiguration { |
| 139 |
b.ensureObjectMetaApplyConfigurationExists() |
| 140 |
b.ObjectMetaApplyConfiguration.ResourceVersion = &value |
| 141 |
return b |
| 142 |
} |
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
func (b *IngressClassApplyConfiguration) WithGeneration(value int64) *IngressClassApplyConfiguration { |
| 148 |
b.ensureObjectMetaApplyConfigurationExists() |
| 149 |
b.ObjectMetaApplyConfiguration.Generation = &value |
| 150 |
return b |
| 151 |
} |
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
func (b *IngressClassApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *IngressClassApplyConfiguration { |
| 157 |
b.ensureObjectMetaApplyConfigurationExists() |
| 158 |
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value |
| 159 |
return b |
| 160 |
} |
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
func (b *IngressClassApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *IngressClassApplyConfiguration { |
| 166 |
b.ensureObjectMetaApplyConfigurationExists() |
| 167 |
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value |
| 168 |
return b |
| 169 |
} |
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
func (b *IngressClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *IngressClassApplyConfiguration { |
| 175 |
b.ensureObjectMetaApplyConfigurationExists() |
| 176 |
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value |
| 177 |
return b |
| 178 |
} |
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
func (b *IngressClassApplyConfiguration) WithLabels(entries map[string]string) *IngressClassApplyConfiguration { |
| 185 |
b.ensureObjectMetaApplyConfigurationExists() |
| 186 |
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { |
| 187 |
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) |
| 188 |
} |
| 189 |
for k, v := range entries { |
| 190 |
b.ObjectMetaApplyConfiguration.Labels[k] = v |
| 191 |
} |
| 192 |
return b |
| 193 |
} |
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
func (b *IngressClassApplyConfiguration) WithAnnotations(entries map[string]string) *IngressClassApplyConfiguration { |
| 200 |
b.ensureObjectMetaApplyConfigurationExists() |
| 201 |
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { |
| 202 |
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) |
| 203 |
} |
| 204 |
for k, v := range entries { |
| 205 |
b.ObjectMetaApplyConfiguration.Annotations[k] = v |
| 206 |
} |
| 207 |
return b |
| 208 |
} |
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
func (b *IngressClassApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *IngressClassApplyConfiguration { |
| 214 |
b.ensureObjectMetaApplyConfigurationExists() |
| 215 |
for i := range values { |
| 216 |
if values[i] == nil { |
| 217 |
panic("nil value passed to WithOwnerReferences") |
| 218 |
} |
| 219 |
b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) |
| 220 |
} |
| 221 |
return b |
| 222 |
} |
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
func (b *IngressClassApplyConfiguration) WithFinalizers(values ...string) *IngressClassApplyConfiguration { |
| 228 |
b.ensureObjectMetaApplyConfigurationExists() |
| 229 |
for i := range values { |
| 230 |
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) |
| 231 |
} |
| 232 |
return b |
| 233 |
} |
| 234 |
|
| 235 |
func (b *IngressClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { |
| 236 |
if b.ObjectMetaApplyConfiguration == nil { |
| 237 |
b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} |
| 238 |
} |
| 239 |
} |
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
func (b *IngressClassApplyConfiguration) WithSpec(value *IngressClassSpecApplyConfiguration) *IngressClassApplyConfiguration { |
| 245 |
b.Spec = value |
| 246 |
return b |
| 247 |
} |
| 248 |
|
| 249 |
|
| 250 |
func (b *IngressClassApplyConfiguration) GetName() *string { |
| 251 |
b.ensureObjectMetaApplyConfigurationExists() |
| 252 |
return b.ObjectMetaApplyConfiguration.Name |
| 253 |
} |