diff --git a/pkg/agent/netpol/network_policy_controller.go b/pkg/agent/netpol/network_policy_controller.go index d7a21908c6..f3d54b604f 100644 --- a/pkg/agent/netpol/network_policy_controller.go +++ b/pkg/agent/netpol/network_policy_controller.go @@ -41,7 +41,7 @@ const ( // filter table a rule is added to jump the traffic originating (in case of egress network policy) from the pod // or destined (in case of ingress network policy) to the pod specific iptables chain. Each // pod specific iptables chain has rules to jump to the network polices chains, that pod matches. So packet -// originating/destined from/to pod goes through fitler table's, FORWARD chain, followed by pod specific chain, +// originating/destined from/to pod goes through filter table's, FORWARD chain, followed by pod specific chain, // followed by one or more network policy chains, till there is a match which will accept the packet, or gets // dropped by the rule in the pod chain, if there is no match. @@ -130,7 +130,7 @@ type numericPort2eps map[string]*endPoints type protocol2eps map[string]numericPort2eps type namedPort2eps map[string]protocol2eps -// Run runs forver till we receive notification on stopCh +// Run runs forever till we receive notification on stopCh func (npc *NetworkPolicyController) Run(healthChan chan<- *healthcheck.ControllerHeartbeat, stopCh <-chan struct{}, wg *sync.WaitGroup) { t := time.NewTicker(npc.syncPeriod) defer t.Stop() @@ -500,7 +500,7 @@ func (npc *NetworkPolicyController) Cleanup() { return } - // TODO: need a better way to delte rule with out using number + // TODO: need a better way to delete rule with out using number var realRuleNo int for i, rule := range forwardChainRules { if strings.Contains(rule, kubePodFirewallChainPrefix) { @@ -519,7 +519,7 @@ func (npc *NetworkPolicyController) Cleanup() { return } - // TODO: need a better way to delte rule with out using number + // TODO: need a better way to delete rule with out using number realRuleNo = 0 for i, rule := range forwardChainRules { if strings.Contains(rule, kubePodFirewallChainPrefix) { diff --git a/pkg/agent/netpol/pod.go b/pkg/agent/netpol/pod.go index b4d37ea7cc..42e59fc676 100644 --- a/pkg/agent/netpol/pod.go +++ b/pkg/agent/netpol/pod.go @@ -102,7 +102,7 @@ func (npc *NetworkPolicyController) syncPodFirewallChains(networkPoliciesInfo [] for _, pod := range *ingressNetworkPolicyEnabledPods { // below condition occurs when we get trasient update while removing or adding pod - // subseqent update will do the correct action + // subsequent update will do the correct action if len(pod.ip) == 0 || pod.ip == "" { continue } @@ -223,7 +223,7 @@ func (npc *NetworkPolicyController) syncPodFirewallChains(networkPoliciesInfo [] for _, pod := range *egressNetworkPolicyEnabledPods { // below condition occurs when we get trasient update while removing or adding pod - // subseqent update will do the correct action + // subsequent update will do the correct action if len(pod.ip) == 0 || pod.ip == "" { continue } diff --git a/pkg/agent/netpol/utils/ipset.go b/pkg/agent/netpol/utils/ipset.go index 48812b0896..8e9a39db52 100644 --- a/pkg/agent/netpol/utils/ipset.go +++ b/pkg/agent/netpol/utils/ipset.go @@ -21,7 +21,7 @@ const ( // DefaultMaxElem Default OptionMaxElem value. DefaultMaxElem = "65536" - // DefaultHasSize Defaul OptionHashSize value. + // DefaultHasSize Default OptionHashSize value. DefaultHasSize = "1024" // TypeHashIP The hash:ip set type uses a hash to store IP host addresses (default) or network addresses. Zero valued IP address cannot be stored in a hash:ip type of set. @@ -86,7 +86,7 @@ type IPSet struct { isIpv6 bool } -// Set reprensent a ipset set entry. +// Set represent a ipset set entry. type Set struct { Parent *IPSet Name string @@ -281,7 +281,7 @@ func (entry *Entry) Del() error { return nil } -// Test wether an entry is in a set or not. Exit status number is zero if the +// Test whether an entry is in a set or not. Exit status number is zero if the // tested entry is in the set and nonzero if it is missing from the set. func (set *Set) Test(testOptions ...string) (bool, error) { _, err := set.Parent.run(append([]string{"test", set.name()}, testOptions...)...) @@ -412,7 +412,7 @@ func (ipset *IPSet) Save() error { // stdin. Please note, existing sets and elements are not erased by restore // unless specified so in the restore file. All commands are allowed in restore // mode except list, help, version, interactive mode and restore itself. -// Send formated ipset.sets into stdin of "ipset restore" command. +// Send formatted ipset.sets into stdin of "ipset restore" command. func (ipset *IPSet) Restore() error { stdin := bytes.NewBufferString(buildIPSetRestore(ipset)) _, err := ipset.runWithStdin(stdin, "restore", "-exist")