Skip to content

Commit

Permalink
fix: conditions list type, revert omit empty things
Browse files Browse the repository at this point in the history
  • Loading branch information
carlmontanari committed Jun 15, 2024
1 parent 8d93f66 commit f7aa55c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
7 changes: 4 additions & 3 deletions apis/v1alpha1/topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type TopologySpec struct {
// ImagePull holds configurations relevant to how clabernetes launcher pods handle pulling
// images.
// +optional
ImagePull ImagePull `json:"imagePull,omitempty"`
ImagePull ImagePull `json:"imagePull"`
// Naming tells the clabernetes controller how it should name resources it creates -- that is
// whether it should include the containerlab topology name as a prefix on resources spawned
// from this Topology or not; this includes the actual (containerlab) node Deployment(s), as
Expand All @@ -60,14 +60,14 @@ type TopologySpec struct {
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="naming field is immutable, to change this value delete and re-create the Topology"
// +kubebuilder:validation:Enum=prefixed;non-prefixed;global
// +kubebuilder:default=global
Naming string `json:"naming,omitempty"`
Naming string `json:"naming"`
// Connectivity defines the type of connectivity to use between nodes in the topology. The
// default behavior is to use vxlan tunnels, alternatively you can enable a more experimental
// "slurpeeth" connectivity flavor that stuffs traffic into tcp tunnels to avoid any vxlan mtu
// and/or fragmentation challenges.
// +kubebuilder:validation:Enum=vxlan;slurpeeth
// +kubebuilder:default=vxlan
Connectivity string `json:"connectivity,omitempty"`
Connectivity string `json:"connectivity"`
}

// TopologyStatus is the status for a Topology resource.
Expand Down Expand Up @@ -97,6 +97,7 @@ type TopologyStatus struct {
// from the conditions so we can easily snag it for print columns!
TopologyReady bool `json:"topologyReady"`
// Conditions is a list of conditions for the topology custom resource.
// +listType=atomic
Conditions []metav1.Condition `json:"conditions"`
}

Expand Down
6 changes: 3 additions & 3 deletions apis/v1alpha1/topologyspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type Expose struct {
// DisableExpose indicates if exposing nodes via LoadBalancer service should be disabled, by
// default any mapped ports in a containerlab topology will be exposed.
// +optional
DisableExpose bool `json:"disableExpose,omitempty"`
DisableExpose bool `json:"disableExpose"`
// DisableAutoExpose disables the automagic exposing of ports for a given topology. When this
// setting is disabled clabernetes will not auto add ports so if you want to expose (via a
// load balancer service) you will need to have ports outlined in your containerlab config
Expand Down Expand Up @@ -132,7 +132,7 @@ type Deployment struct {
// the configmap is mounted in its entirety (like normal k8s things), so you *probably* want
// to specify the sub path unless you are sure what you're doing!
// +optional
FilesFromConfigMap map[string][]FileFromConfigMap `json:"filesFromConfigMap,omitempty"`
FilesFromConfigMap map[string][]FileFromConfigMap `json:"filesFromConfigMap"`
// FilesFromURL is a mapping of FileFromURL that define a URL at which to fetch a file, and path
// on a launcher node that the file should be downloaded to. This is useful for configs that are
// larger than the ConfigMap (etcd) 1Mb size limit.
Expand Down Expand Up @@ -273,7 +273,7 @@ type ImagePull struct {
// InsecureRegistries is a slice of strings of insecure registries to configure in the launcher
// pods.
// +optional
InsecureRegistries InsecureRegistries `json:"insecureRegistries,omitempty"`
InsecureRegistries InsecureRegistries `json:"insecureRegistries"`
// PullThroughOverride allows for overriding the image pull through mode for this
// particular topology.
// +kubebuilder:validation:Enum=auto;always;never
Expand Down
1 change: 1 addition & 0 deletions assets/crd/clabernetes.containerlab.dev_topologies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ spec:
- type
type: object
type: array
x-kubernetes-list-type: atomic
configs:
additionalProperties:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ spec:
- type
type: object
type: array
x-kubernetes-list-type: atomic
configs:
additionalProperties:
type: string
Expand Down
2 changes: 2 additions & 0 deletions clabverter/test-fixtures/golden/simple/topo01.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
name: topo01
namespace: notclabernetes
spec:
connectivity: ""
definition:
containerlab: |-
name: topo01
Expand Down Expand Up @@ -86,6 +87,7 @@ spec:
tolerations: null
expose:
disableAutoExpose: false
disableExpose: false
imagePull:
insecureRegistries:
- 1.2.3.4
Expand Down
5 changes: 5 additions & 0 deletions generated/openapi/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f7aa55c

Please sign in to comment.