-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,368 additions
and
90 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
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,86 @@ | ||
// Copyright 2020 Yunion | ||
// | ||
// 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 v1 | ||
|
||
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. | ||
|
||
// EndpointSpec defines the desired state of Endpoint | ||
type EndpointSpec struct { | ||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
|
||
// Url of this Endpoint | ||
URL URL `json:"url"` | ||
RegionId string `json:"regionId"` | ||
// +optional | ||
Name string `json:"name,omitempty"` | ||
// +optional | ||
Disabled *bool `json:"disabled,omitempty"` | ||
// Service certificate id or name | ||
// +optional | ||
ServiceCertificate string `json:"serviceCertificate,omitempty"` | ||
ResourceSpecBase `json:",inline"` | ||
} | ||
|
||
// URL is used to construct url string 'Protocol://Host:Port/Prefix' | ||
type URL struct { | ||
// +optional | ||
Protocol string `json:"protocol,omitempty"` | ||
Host StringStore `json:"host,omitempty"` | ||
// +optional | ||
Port *int32 `json:"port,omitempty"` | ||
// +optional | ||
Prefix string `json:"prefix,omitempty"` | ||
} | ||
|
||
// EndpointStatus defines the observed state of Endpoint | ||
type EndpointStatus struct { | ||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
|
||
ResourceStatusBase `json:",inline"` | ||
// +optional | ||
ExternalInfo ExternalInfoBase `json:"externalInfo,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// Endpoint is the Schema for the endpoints API | ||
// +kubebuilder:subresource:status | ||
type Endpoint struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec EndpointSpec `json:"spec,omitempty"` | ||
Status EndpointStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// EndpointList contains a list of Endpoint | ||
type EndpointList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []Endpoint `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&Endpoint{}, &EndpointList{}) | ||
} |
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,133 @@ | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.2.5 | ||
creationTimestamp: null | ||
name: endpoints.onecloud.yunion.io | ||
spec: | ||
group: onecloud.yunion.io | ||
names: | ||
kind: Endpoint | ||
listKind: EndpointList | ||
plural: endpoints | ||
singular: endpoint | ||
scope: Namespaced | ||
subresources: | ||
status: {} | ||
validation: | ||
openAPIV3Schema: | ||
description: Endpoint is the Schema for the endpoints API | ||
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: EndpointSpec defines the desired state of Endpoint | ||
properties: | ||
disabled: | ||
type: boolean | ||
maxRetryTimes: | ||
description: Nil or Non-positive number means unlimited. | ||
format: int32 | ||
type: integer | ||
name: | ||
type: string | ||
regionId: | ||
type: string | ||
serviceCertificate: | ||
description: Service certificate id or name | ||
type: string | ||
url: | ||
description: Url of this Endpoint | ||
properties: | ||
host: | ||
properties: | ||
reference: | ||
properties: | ||
fieldPath: | ||
type: string | ||
group: | ||
type: string | ||
kind: | ||
type: string | ||
name: | ||
type: string | ||
namespace: | ||
type: string | ||
version: | ||
type: string | ||
required: | ||
- fieldPath | ||
- kind | ||
- name | ||
- namespace | ||
type: object | ||
value: | ||
type: string | ||
type: object | ||
port: | ||
format: int32 | ||
type: integer | ||
prefix: | ||
type: string | ||
protocol: | ||
type: string | ||
type: object | ||
required: | ||
- regionId | ||
- url | ||
type: object | ||
status: | ||
description: EndpointStatus defines the observed state of Endpoint | ||
properties: | ||
externalInfo: | ||
description: ExternalInfoBase describe the corresponding resource's | ||
info in external system | ||
properties: | ||
action: | ||
description: Action indicate the latest action for external vm. | ||
type: string | ||
id: | ||
type: string | ||
status: | ||
type: string | ||
type: object | ||
phase: | ||
description: ResourcePhase is a label for the condition of a resource | ||
at the current time | ||
type: string | ||
reason: | ||
description: A human readable message indicating details about why resource | ||
is in this phase. | ||
type: string | ||
tryTimes: | ||
description: TryTimes record the continuous try times. | ||
format: int32 | ||
type: integer | ||
required: | ||
- tryTimes | ||
type: object | ||
type: object | ||
version: v1 | ||
versions: | ||
- name: v1 | ||
served: true | ||
storage: true | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
Oops, something went wrong.