generated from cybozu-go/neco-template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add unserved v2 API based on v2alpha1
- Loading branch information
Showing
10 changed files
with
729 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// +kubebuilder:object:generate=true | ||
// +groupName=accurate.cybozu.com | ||
package v2 |
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,18 @@ | ||
// Package v2 contains API Schema definitions for the accurate v2 API group | ||
package v2 | ||
|
||
import ( | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"sigs.k8s.io/controller-runtime/pkg/scheme" | ||
) | ||
|
||
var ( | ||
// SchemeGroupVersion is group version used to register these objects | ||
SchemeGroupVersion = schema.GroupVersion{Group: "accurate.cybozu.com", Version: "v2"} | ||
|
||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme | ||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} | ||
|
||
// AddToScheme adds the types in this group-version to the given scheme. | ||
AddToScheme = SchemeBuilder.AddToScheme | ||
) |
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,68 @@ | ||
package v2 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! | ||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||
|
||
// SubNamespaceStatus defines the observed state of SubNamespace | ||
type SubNamespaceStatus struct { | ||
// The generation observed by the object controller. | ||
// +optional | ||
ObservedGeneration int64 `json:"observedGeneration,omitempty"` | ||
|
||
// Conditions represent the latest available observations of an object's state | ||
// +listType=map | ||
// +listMapKey=type | ||
// +optional | ||
Conditions []metav1.Condition `json:"conditions,omitempty"` | ||
} | ||
|
||
// SubNamespaceSpec defines the desired state of SubNamespace | ||
type SubNamespaceSpec struct { | ||
// Labels are the labels to be propagated to the sub-namespace | ||
// +optional | ||
Labels map[string]string `json:"labels,omitempty"` | ||
|
||
// Annotations are the annotations to be propagated to the sub-namespace. | ||
// +optional | ||
Annotations map[string]string `json:"annotations,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:unservedversion | ||
//+kubebuilder:subresource:status | ||
//+genclient | ||
|
||
// SubNamespace is the Schema for the subnamespaces API | ||
type SubNamespace struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
// Spec is the spec of SubNamespace. | ||
// +optional | ||
Spec SubNamespaceSpec `json:"spec,omitempty"` | ||
|
||
// Status is the status of SubNamespace. | ||
// +optional | ||
Status SubNamespaceStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// SubNamespaceList contains a list of SubNamespace | ||
type SubNamespaceList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []SubNamespace `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&SubNamespace{}, &SubNamespaceList{}) | ||
} | ||
|
||
const ( | ||
SubNamespaceConflict string = "Conflict" | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.