-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from srl-labs/refactor/api-overhaul
Refactor/api overhaul
- Loading branch information
Showing
100 changed files
with
2,732 additions
and
4,837 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 |
---|---|---|
@@ -1 +1,18 @@ | ||
package apis | ||
|
||
const ( | ||
// Group is the main (only!) group for clabernetes CRDs. | ||
Group = "clabernetes.containerlab.dev" | ||
|
||
// Topology is the Kind of the Topology custom resource. | ||
Topology = "topology" | ||
|
||
// TopologyKindContainerlab is the "containerlab" kind of topology. | ||
TopologyKindContainerlab = "containerlab" | ||
|
||
// TopologyKindKne is the "kne" kind of topology. | ||
TopologyKindKne = "kne" | ||
|
||
// TopologyKindUnknown is the kind of topology for unknown topologies. | ||
TopologyKindUnknown = "unknown" | ||
) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// +k8s:openapi-gen=true | ||
// +k8s:deepcopy-gen=package,register | ||
// +groupName=topology.clabernetes | ||
package v1alpha1 // import "github.com/srl-labs/clabernetes/apis/topology/v1alpha1" | ||
// +groupName=clabernetes.containerlab.dev | ||
package v1alpha1 // import "github.com/srl-labs/clabernetes/apis/v1alpha1" |
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,68 @@ | ||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// +genclient | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// Topology is an object that holds information about a clabernetes Topology -- that is, a valid | ||
// topology file (ex: containerlab topology), and any associated configurations. | ||
// +k8s:openapi-gen=true | ||
// +kubebuilder:resource:path="topologies" | ||
// +kubebuilder:printcolumn:JSONPath=".status.kind",name=Kind,type=string | ||
type Topology struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec TopologySpec `json:"spec,omitempty"` | ||
Status TopologyStatus `json:"status,omitempty"` | ||
} | ||
|
||
// TopologySpec is the spec for a Topology resource. | ||
type TopologySpec struct { | ||
// Definition defines the actual set of nodes (network ones, not k8s ones!) that this Topology | ||
// CR represents. Historically, and probably most often, this means Topology holds a "normal" | ||
// containerlab topology file that will be "clabernetsified", however this could also be a "kne" | ||
// config, or perhaps others in the future. | ||
Definition Definition `json:"definition"` | ||
// Expose holds configurations relevant to how clabernetes exposes a topology. | ||
// +optional | ||
Expose Expose `json:"expose"` | ||
// Deployment holds configurations relevant to how clabernetes configures deployments that make | ||
// up a given topology. | ||
// +optional | ||
Deployment Deployment `json:"deployment"` | ||
// ImagePull holds configurations relevant to how clabernetes launcher pods handle pulling | ||
// images. | ||
// +optional | ||
ImagePull ImagePull `json:"imagePull"` | ||
} | ||
|
||
// TopologyStatus is the status for a Containerlab topology resource. | ||
type TopologyStatus struct { | ||
// Kind is the topology kind this CR represents -- for example "containerlab". | ||
// +kubebuilder:validation:Enum=containerlab;kne | ||
Kind string `json:"kind"` | ||
// ReconcileHashes holds the hashes form the last reconciliation run. | ||
ReconcileHashes ReconcileHashes `json:"reconcileHashes"` | ||
// Configs is a map of node name -> containerlab config -- in other words, this is the original | ||
// Topology.Spec.Definition converted to containerlab "sub-topologies" The actual | ||
// "sub-topologies"/"sub-configs" are stored as a string -- this is the actual containerlab | ||
// topology that gets mounted in the launcher pod. | ||
Configs map[string]string `json:"configs"` | ||
// ExposedPorts holds a map of (containerlab not k8s!) nodes and their exposed ports | ||
// (via load balancer). | ||
ExposedPorts map[string]*ExposedPorts `json:"exposedPorts"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// TopologyList is a list of Topology objects. | ||
type TopologyList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
|
||
Items []Topology `json:"items"` | ||
} |
Oops, something went wrong.