@@ -22,60 +22,67 @@ import (
2222 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2323)
2424
25- // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
26- // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
27-
28- // FirewallRuleSpec defines the desired state of FirewallRule
25+ // FirewallRuleSpec defines the desired state of FirewallRule.
2926type FirewallRuleSpec struct {
30- // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
31- // Important: Run "make" to regenerate code after modifying this file
32- Action string `json:"action"`
33- Label string `json:"label"`
27+ // action is the action to take when the rule matches.
28+ Action string `json:"action"`
29+ // label is the label of the rule.
30+ Label string `json:"label"`
31+ // description is the description of the rule.
3432 Description string `json:"description,omitempty"`
35- Ports string `json:"ports,omitempty"`
33+ // ports is the ports to apply the rule to.
34+ Ports string `json:"ports,omitempty"`
35+ // protocol is the protocol to apply the rule to.
3636 // +kubebuilder:validation:Enum=TCP;UDP;ICMP;IPENCAP
37- Protocol linodego.NetworkProtocol `json:"protocol"`
38- Addresses * NetworkAddresses `json:"addresses,omitempty"`
39- // AddressSetRefs is a list of references to AddressSets as an alternative to
40- // using Addresses but can be used in conjunction with it
37+ Protocol linodego.NetworkProtocol `json:"protocol"`
38+ // addresses is a list of addresses to apply the rule to.
39+ Addresses * NetworkAddresses `json:"addresses,omitempty"`
40+ // addressSetRefs is a list of references to AddressSets as an alternative to
41+ // using Addresses but can be used in conjunction with it.
4142 AddressSetRefs []* corev1.ObjectReference `json:"addressSetRefs,omitempty"`
4243}
4344
44- // NetworkAddresses holds a list of IPv4 and IPv6 addresses
45+ // NetworkAddresses holds a list of IPv4 and IPv6 addresses.
4546// We don't use linodego here since kubebuilder can't generate DeepCopyInto
4647// for linodego.NetworkAddresses
4748type NetworkAddresses struct {
49+ // ipv4 defines a list of IPv4 address strings.
4850 IPv4 * []string `json:"ipv4,omitempty"`
51+ // ipv6 defines a list of IPv6 address strings.
4952 IPv6 * []string `json:"ipv6,omitempty"`
5053}
5154
52- // FirewallRuleStatus defines the observed state of FirewallRule
55+ // FirewallRuleStatus defines the observed state of FirewallRule.
5356type FirewallRuleStatus struct {
5457 // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
5558 // Important: Run "make" to regenerate code after modifying this file
5659}
5760
58- //+kubebuilder:object:root=true
59- //+kubebuilder:resource:path=firewallrules,scope=Namespaced,categories=cluster-api,shortName=fwr
60- //+kubebuilder:subresource:status
61+ // +kubebuilder:object:root=true
62+ // +kubebuilder:resource:path=firewallrules,scope=Namespaced,categories=cluster-api,shortName=fwr
63+ // +kubebuilder:subresource:status
6164// +kubebuilder:metadata:labels="clusterctl.cluster.x-k8s.io/move-hierarchy=true"
6265
6366// FirewallRule is the Schema for the firewallrules API
6467type FirewallRule struct {
65- metav1.TypeMeta `json:",inline"`
68+ metav1.TypeMeta `json:",inline"`
69+ // metadata is the standard object's metadata.
6670 metav1.ObjectMeta `json:"metadata,omitempty"`
67-
68- Spec FirewallRuleSpec `json:"spec,omitempty"`
71+ // spec is the desired state of the FirewallRule.
72+ Spec FirewallRuleSpec `json:"spec,omitempty"`
73+ // status is the observed state of the FirewallRule.
6974 Status FirewallRuleStatus `json:"status,omitempty"`
7075}
7176
72- //+kubebuilder:object:root=true
77+ // +kubebuilder:object:root=true
7378
7479// FirewallRuleList contains a list of FirewallRule
7580type FirewallRuleList struct {
7681 metav1.TypeMeta `json:",inline"`
82+ // metadata is the standard object's metadata.
7783 metav1.ListMeta `json:"metadata,omitempty"`
78- Items []FirewallRule `json:"items"`
84+ // items is a list of FirewallRule.
85+ Items []FirewallRule `json:"items"`
7986}
8087
8188func init () {
0 commit comments