Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 1 addition & 91 deletions apis/placement/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1
package v1beta1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -26,48 +26,41 @@ import (
// +kubebuilder:object:root=true
// +kubebuilder:resource:scope="Cluster",categories={fleet,fleet-placement}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:storageversion

// ClusterResourceEnvelope wraps cluster-scoped resources for placement.
type ClusterResourceEnvelope struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// The desired state of ClusterResourceEnvelope.
// +kubebuilder:validation:Required
Spec EnvelopeSpec `json:"spec"`
}

// EnvelopeSpec helps wrap resources for placement.
type EnvelopeSpec struct {
// A map of wrapped manifests.
// The manifests wrapped in this envelope.
//
// Each manifest is uniquely identified by a string key, typically a filename that represents
// the manifest.
// the manifest. The value is the manifest object itself.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinProperties=1
// +kubebuilder:validation:MaxProperties=50
Manifests map[string]Manifest `json:"manifests"`
}

// Manifest is a wrapped resource.
type Manifest struct {
// The resource data.
// +kubebuilder:validation:Required
// +kubebuilder:validation:EmbeddedResource
// +kubebuilder:pruning:PreserveUnknownFields
Data runtime.RawExtension `json:"data"`
Data map[string]runtime.RawExtension `json:"data"`
}

// +genclient
// +genclient:Namespaced
// +kubebuilder:object:root=true
// +kubebuilder:resource:scope="Namespaced",categories={fleet,fleet-placement}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:storageversion

// ResourceEnvelope wraps namespaced resources for placement.
type ResourceEnvelope struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// The desired state of ResourceEnvelope.
// The manifests wrapped in this envelope.
//
// Each manifest is uniquely identified by a string key, typically a filename that represents
// the manifest. The value is the manifest object itself.
// +kubebuilder:validation:Required
Spec EnvelopeSpec `json:"spec"`
// +kubebuilder:validation:MinProperties=1
// +kubebuilder:validation:MaxProperties=50
Data map[string]runtime.RawExtension `json:"data"`
Copy link

Copilot AI May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Ensure that the transition from using a dedicated EnvelopeSpec to a direct 'data' mapping is thoroughly documented in code comments and external documentation for consistency.

Copilot uses AI. Check for mistakes.
}
64 changes: 64 additions & 0 deletions apis/placement/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
singular: clusterresourceenvelope
scope: Cluster
versions:
- name: v1alpha1
- name: v1beta1
schema:
openAPIV3Schema:
description: ClusterResourceEnvelope wraps cluster-scoped resources for placement.
Expand All @@ -29,6 +29,18 @@ spec:
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
data:
additionalProperties:
type: object
x-kubernetes-preserve-unknown-fields: true
description: |-
The manifests wrapped in this envelope.

Each manifest is uniquely identified by a string key, typically a filename that represents
the manifest. The value is the manifest object itself.
maxProperties: 50
minProperties: 1
type: object
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Expand All @@ -39,34 +51,8 @@ spec:
type: string
metadata:
type: object
spec:
description: The desired state of ClusterResourceEnvelope.
properties:
manifests:
additionalProperties:
description: Manifest is a wrapped resource.
properties:
data:
description: The resource data.
type: object
x-kubernetes-embedded-resource: true
x-kubernetes-preserve-unknown-fields: true
required:
- data
type: object
description: |-
A map of wrapped manifests.

Each manifest is uniquely identified by a string key, typically a filename that represents
the manifest.
maxProperties: 50
minProperties: 1
type: object
required:
- manifests
type: object
required:
- spec
- data
type: object
served: true
storage: true
Loading
Loading