Skip to content

Commit

Permalink
[nat] Added NAT config types for API
Browse files Browse the repository at this point in the history
Signed-off by: Kendall Tauser <[email protected]>
  • Loading branch information
fire833 committed Sep 3, 2022
1 parent 8ed28b6 commit 5b6d577
Show file tree
Hide file tree
Showing 12 changed files with 369 additions and 13 deletions.
46 changes: 46 additions & 0 deletions charts/morfic/crds/net.morfic.io_natconfigurations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: natconfigurations.net.morfic.io
spec:
group: net.morfic.io
names:
kind: NATConfiguration
listKind: NATConfigurationList
plural: natconfigurations
singular: natconfiguration
scope: Namespaced
versions:
- name: net
schema:
openAPIV3Schema:
description: NATConfiguration describes a configuration for NAT masqurading
on a system.
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: Spec is the desired spec of this node's NAT config.
type: object
status:
type: object
required:
- spec
- status
type: object
served: true
storage: true
2 changes: 1 addition & 1 deletion charts/morfic/crds/net.morfic.io_neighbors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
metadata:
type: object
spec:
description: Spec is the desired spec of this nighbor on the host ARP
description: Spec is the desired spec of this neighbor on the host ARP
table.
type: object
status:
Expand Down
27 changes: 27 additions & 0 deletions pkg/apis/net/nat_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,30 @@
*/

package net

import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen=true
// +genclient
// +genclient:nonNamespaced
// NATConfiguration describes a configuration for NAT masqurading on a system.
type NATConfiguration struct {
metav1.TypeMeta `json:",inline" yaml:",inline"`

// Standard object metadata.
// Utilizes the Kubernetes metadata object spec for now.
metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

// Spec is the desired spec of this node's NAT config.
Spec NATConfigurationSpec `json:"spec" yaml:"spec"`

Status NATConfigurationStatus `json:"status" yaml:"status"`
}

type NATConfigurationSpec struct {
}

type NATConfigurationStatus struct {
}
2 changes: 1 addition & 1 deletion pkg/apis/net/neighbor_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type Neighbor struct {
// Utilizes the Kubernetes metadata object spec for now.
metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

// Spec is the desired spec of this nighbor on the host ARP table.
// Spec is the desired spec of this neighbor on the host ARP table.
Spec NeighborSpec `json:"spec" yaml:"spec"`

// Status is the current state of this neighbor on the host.
Expand Down
60 changes: 60 additions & 0 deletions pkg/apis/net/zz_generated.deepcopy.go

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

67 changes: 59 additions & 8 deletions pkg/apis/net/zz_generated.openapi.go

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

7 changes: 7 additions & 0 deletions pkg/client/informers/externalversions/apis/net/interface.go

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

91 changes: 91 additions & 0 deletions pkg/client/informers/externalversions/apis/net/natconfiguration.go

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

4 changes: 4 additions & 0 deletions pkg/client/listers/apis/net/expansion_generated.go

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

Loading

0 comments on commit 5b6d577

Please sign in to comment.