-
Notifications
You must be signed in to change notification settings - Fork 0
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
kairen
committed
Oct 26, 2018
0 parents
commit f0932c9
Showing
38 changed files
with
2,568 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
*.out | ||
*.conf | ||
|
||
.DS_Store | ||
vendor/ | ||
out/ | ||
tmp/ | ||
|
||
|
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,13 @@ | ||
|
||
required = ["k8s.io/code-generator/cmd/client-gen"] | ||
|
||
[[constraint]] | ||
name = "k8s.io/apimachinery" | ||
version = "kubernetes-1.11.0" | ||
|
||
[[constraint]] | ||
name = "k8s.io/code-generator" | ||
version = "kubernetes-1.11.0" | ||
|
||
[prune] | ||
go-tests = true |
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,2 @@ | ||
# IPAM APIs and ClientSet | ||
Scheme, typing and client packages for IPAM and Kubernetes-like API objects. |
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 @@ | ||
package inwinstack | ||
|
||
const GroupName = "inwinstack.com" |
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,21 @@ | ||
/* | ||
Copyright © 2018 inwinSTACK.inc | ||
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. | ||
*/ | ||
|
||
// +k8s:deepcopy-gen=package,register | ||
|
||
// Package v1 is the v1 version of the API. | ||
// +groupName=inwinstack.com | ||
package v1 |
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,67 @@ | ||
/* | ||
Copyright © 2018 inwinSTACK.inc | ||
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" | ||
) | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// IPList is a list of IP. | ||
type IPList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata"` | ||
|
||
Items []IP `json:"items"` | ||
} | ||
|
||
// +genclient | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// IP represents a Kubernetes IP Custom Resource. | ||
// The IP will be used as IP. | ||
type IP struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata"` | ||
|
||
Spec IPSpec `json:"spec"` | ||
Status IPStatus `json:"status,omitempty"` | ||
} | ||
|
||
// IPSpec is the spec for a IP resource. | ||
type IPSpec struct { | ||
PoolName string `json:"poolName"` | ||
UpdateNamespace bool `json:"updateNamespace"` | ||
} | ||
|
||
type IPPhase string | ||
|
||
// These are the valid phases of a IP. | ||
const ( | ||
IPActive IPPhase = "Active" | ||
IPFailed IPPhase = "Failed" | ||
IPTerminating IPPhase = "Terminating" | ||
) | ||
|
||
// IPStatus represents the current state of a IP resource. | ||
type IPStatus struct { | ||
Phase IPPhase `json:"phase"` | ||
Reason string `json:"reason,omitempty"` | ||
LastUpdateTime metav1.Time `json:"lastUpdateTime"` | ||
Address string `json:"address,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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
Copyright © 2018 inwinSTACK.inc | ||
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" | ||
) | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// PoolList is a list of Pool. | ||
type PoolList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata"` | ||
|
||
Items []Pool `json:"items"` | ||
} | ||
|
||
// +genclient | ||
// +genclient:nonNamespaced | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// Pool represents a Kubernetes Pool Custom Resource. | ||
// The Pool will be used as IP pools. | ||
type Pool struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata"` | ||
|
||
Spec PoolSpec `json:"spec"` | ||
Status PoolStatus `json:"status,omitempty"` | ||
} | ||
|
||
// PoolSpec is the spec for a pool resource. | ||
type PoolSpec struct { | ||
Address string `json:"address"` | ||
IgnoreNamespaces []string `json:"ignoreNamespaces"` | ||
IgnoreNamespaceAnnotation bool `json:"ignoreNamespaceAnnotation"` | ||
AutoAssignToNamespace bool `json:"autoAssignToNamespace"` | ||
} | ||
|
||
type PoolPhase string | ||
|
||
// These are the valid phases of a pool. | ||
const ( | ||
PoolActive PoolPhase = "Active" | ||
PoolFailed PoolPhase = "Failed" | ||
PoolTerminating PoolPhase = "Terminating" | ||
) | ||
|
||
// PoolStatus represents the current state of a pool resource. | ||
type PoolStatus struct { | ||
Phase PoolPhase `json:"phase"` | ||
Reason string `json:"reason,omitempty"` | ||
LastUpdateTime metav1.Time `json:"lastUpdateTime"` | ||
AllocatedIPs []string `json:"allocatedIPs"` | ||
Capacity int `json:"capacity"` | ||
} |
Oops, something went wrong.