|
| 1 | +// Copyright 2025 The Kubernetes Authors. |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +/* |
| 16 | +Copyright 2025. |
| 17 | +
|
| 18 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 19 | +you may not use this file except in compliance with the License. |
| 20 | +You may obtain a copy of the License at |
| 21 | +
|
| 22 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 23 | +
|
| 24 | +Unless required by applicable law or agreed to in writing, software |
| 25 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 26 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 27 | +See the License for the specific language governing permissions and |
| 28 | +limitations under the License. |
| 29 | +*/ |
| 30 | + |
| 31 | +package v1alpha1 |
| 32 | + |
| 33 | +import ( |
| 34 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 35 | +) |
| 36 | + |
| 37 | +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. |
| 38 | +// Important: Run "make" to regenerate code after modifying this file |
| 39 | + |
| 40 | +// SandboxTemmplateRef references a SandboxTemplate |
| 41 | +type SandboxTemplateRef struct { |
| 42 | + // name of the SandboxTemplate |
| 43 | + // +kubebuilder:validation:Required |
| 44 | + Name string `json:"name,omitempty" protobuf:"bytes,1,name=name"` |
| 45 | +} |
| 46 | + |
| 47 | +// SandboxClaimSpec defines the desired state of Sandbox |
| 48 | +type SandboxClaimSpec struct { |
| 49 | + // SandboxTemplateRefName - name of the SandboxTemplate to be used for creating a Sandbox |
| 50 | + // +kubebuilder:validation:Required |
| 51 | + TemplateRef SandboxTemplateRef `json:"sandboxTemplateRef,omitempty" protobuf:"bytes,3,name=sandboxTemplateRef"` |
| 52 | +} |
| 53 | + |
| 54 | +// SandboxClaimStatus defines the observed state of Sandbox. |
| 55 | +type SandboxClaimStatus struct { |
| 56 | +} |
| 57 | + |
| 58 | +// +kubebuilder:object:root=true |
| 59 | +// +kubebuilder:subresource:status |
| 60 | +// +kubebuilder:resource:scope=Namespaced,shortName=sandboxclaim |
| 61 | +// SandboxClaim is the Schema for the sandbox Claim API |
| 62 | +type SandboxClaim struct { |
| 63 | + metav1.TypeMeta `json:",inline"` |
| 64 | + |
| 65 | + // metadata is a standard object metadata |
| 66 | + // +optional |
| 67 | + metav1.ObjectMeta `json:"metadata,omitempty,omitzero"` |
| 68 | + |
| 69 | + // spec defines the desired state of Sandbox |
| 70 | + // +required |
| 71 | + Spec SandboxClaimSpec `json:"spec"` |
| 72 | + |
| 73 | + // status defines the observed state of Sandbox |
| 74 | + // +optional |
| 75 | + Status SandboxClaimStatus `json:"status,omitempty,omitzero"` |
| 76 | +} |
| 77 | + |
| 78 | +// +kubebuilder:object:root=true |
| 79 | + |
| 80 | +// SandboxList contains a list of Sandbox |
| 81 | +type SandboxClaimList struct { |
| 82 | + metav1.TypeMeta `json:",inline"` |
| 83 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 84 | + Items []SandboxClaim `json:"items"` |
| 85 | +} |
| 86 | + |
| 87 | +func init() { |
| 88 | + SchemeBuilder.Register(&SandboxClaim{}, &SandboxClaimList{}) |
| 89 | +} |
0 commit comments