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