-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'v1.16.4' into sync-upstream-release-1.16
Release v1.16.4
- Loading branch information
Showing
31 changed files
with
1,614 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
Copyright 2024 The Crossplane Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1beta1 | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// MatchType is the method used to match the image. | ||
type MatchType string | ||
|
||
const ( | ||
// Prefix is used to match the prefix of the image. | ||
Prefix MatchType = "Prefix" | ||
) | ||
|
||
// +kubebuilder:object:root=true | ||
// +genclient | ||
// +genclient:nonNamespaced | ||
|
||
// The ImageConfig resource is used to configure settings for package images. | ||
// | ||
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" | ||
// +kubebuilder:resource:scope=Cluster,categories={crossplane} | ||
type ImageConfig struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec ImageConfigSpec `json:"spec,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// ImageConfigList contains a list of ImageConfig. | ||
type ImageConfigList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []ImageConfig `json:"items"` | ||
} | ||
|
||
// ImageMatch defines a rule for matching image. | ||
type ImageMatch struct { | ||
// Type is the type of match. | ||
// +optional | ||
// +kubebuilder:validation:Enum=Prefix | ||
// +kubebuilder:default=Prefix | ||
Type MatchType `json:"type,omitempty"` | ||
// Prefix is the prefix that should be matched. | ||
Prefix string `json:"prefix"` | ||
} | ||
|
||
// RegistryAuthentication contains the authentication information for a registry. | ||
type RegistryAuthentication struct { | ||
// PullSecretRef is a reference to a secret that contains the credentials for | ||
// the registry. | ||
PullSecretRef corev1.LocalObjectReference `json:"pullSecretRef"` | ||
} | ||
|
||
// RegistryConfig contains the configuration for the registry. | ||
type RegistryConfig struct { | ||
// Authentication is the authentication information for the registry. | ||
// +optional | ||
Authentication *RegistryAuthentication `json:"authentication,omitempty"` | ||
} | ||
|
||
// ImageConfigSpec contains the configuration for matching images. | ||
type ImageConfigSpec struct { | ||
// MatchImages is a list of image matching rules that should be satisfied. | ||
// +kubebuilder:validation:XValidation:rule="size(self) > 0",message="matchImages should have at least one element." | ||
MatchImages []ImageMatch `json:"matchImages"` | ||
// Registry is the configuration for the registry. | ||
// +optional | ||
Registry *RegistryConfig `json:"registry,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.14.0 | ||
name: imageconfigs.pkg.crossplane.io | ||
spec: | ||
group: pkg.crossplane.io | ||
names: | ||
categories: | ||
- crossplane | ||
kind: ImageConfig | ||
listKind: ImageConfigList | ||
plural: imageconfigs | ||
singular: imageconfig | ||
scope: Cluster | ||
versions: | ||
- additionalPrinterColumns: | ||
- jsonPath: .metadata.creationTimestamp | ||
name: AGE | ||
type: date | ||
name: v1beta1 | ||
schema: | ||
openAPIV3Schema: | ||
description: The ImageConfig resource is used to configure settings for package | ||
images. | ||
properties: | ||
apiVersion: | ||
description: |- | ||
APIVersion defines the versioned schema of this representation of an object. | ||
Servers should convert recognized schemas to the latest internal value, and | ||
may reject unrecognized values. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | ||
type: string | ||
kind: | ||
description: |- | ||
Kind is a string value representing the REST resource this object represents. | ||
Servers may infer this from the endpoint the client submits requests to. | ||
Cannot be updated. | ||
In CamelCase. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: ImageConfigSpec contains the configuration for matching images. | ||
properties: | ||
matchImages: | ||
description: MatchImages is a list of image matching rules that should | ||
be satisfied. | ||
items: | ||
description: ImageMatch defines a rule for matching image. | ||
properties: | ||
prefix: | ||
description: Prefix is the prefix that should be matched. | ||
type: string | ||
type: | ||
default: Prefix | ||
description: Type is the type of match. | ||
enum: | ||
- Prefix | ||
type: string | ||
required: | ||
- prefix | ||
type: object | ||
type: array | ||
x-kubernetes-validations: | ||
- message: matchImages should have at least one element. | ||
rule: size(self) > 0 | ||
registry: | ||
description: Registry is the configuration for the registry. | ||
properties: | ||
authentication: | ||
description: Authentication is the authentication information | ||
for the registry. | ||
properties: | ||
pullSecretRef: | ||
description: |- | ||
PullSecretRef is a reference to a secret that contains the credentials for | ||
the registry. | ||
properties: | ||
name: | ||
description: |- | ||
Name of the referent. | ||
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | ||
TODO: Add other useful fields. apiVersion, kind, uid? | ||
type: string | ||
type: object | ||
x-kubernetes-map-type: atomic | ||
required: | ||
- pullSecretRef | ||
type: object | ||
type: object | ||
required: | ||
- matchImages | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.