Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some typos for pkg/proxy #14982

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/proxy/config/api.go
Expand Up @@ -25,7 +25,7 @@ import (
"k8s.io/kubernetes/pkg/fields"
)

// NewSourceAPIserver creates config source that watches for changes to the services and endpoints.
// NewSourceAPI creates config source that watches for changes to the services and endpoints.
func NewSourceAPI(c *client.Client, period time.Duration, servicesChan chan<- ServiceUpdate, endpointsChan chan<- EndpointsUpdate) {
servicesLW := cache.NewListWatchFromClient(c, "services", api.NamespaceAll, fields.Everything())
endpointsLW := cache.NewListWatchFromClient(c, "endpoints", api.NamespaceAll, fields.Everything())
Expand Down
4 changes: 2 additions & 2 deletions pkg/proxy/iptables/proxier.go
Expand Up @@ -66,7 +66,7 @@ const iptablesMasqueradeMark = "0x4d415351"
// ShouldUseIptablesProxier returns true if we should use the iptables Proxier
// instead of the "classic" userspace Proxier. This is determined by checking
// the iptables version and for the existence of kernel features. It may return
// an error if it fails to get the itpables version without error, in which
// an error if it fails to get the iptables version without error, in which
// case it will also return false.
func ShouldUseIptablesProxier() (bool, error) {
exec := utilexec.New()
Expand Down Expand Up @@ -479,7 +479,7 @@ func (proxier *Proxier) syncProxyRules() {
existingChains := make(map[utiliptables.Chain]string)
iptablesSaveRaw, err := proxier.iptables.Save(utiliptables.TableNAT)
if err != nil { // if we failed to get any rules
glog.Errorf("Failed to execute iptable-save, syncing all rules. %s", err.Error())
glog.Errorf("Failed to execute iptables-save, syncing all rules. %s", err.Error())
} else { // otherwise parse the output
existingChains = getChainLines(utiliptables.TableNAT, iptablesSaveRaw)
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/proxy/userspace/proxier.go
Expand Up @@ -97,7 +97,7 @@ type Proxier struct {
// assert Proxier is a ProxyProvider
var _ proxy.ProxyProvider = &Proxier{}

// A key for the portMap. The ip has to be a tring because slices can't be map
// A key for the portMap. The ip has to be a string because slices can't be map
// keys.
type portMapKey struct {
ip string
Expand Down Expand Up @@ -208,7 +208,7 @@ func CleanupLeftovers(ipt iptables.Interface) (encounteredError bool) {
// flush and delete chains.
chains := []iptables.Chain{iptablesContainerPortalChain, iptablesHostPortalChain, iptablesHostNodePortChain, iptablesContainerNodePortChain}
for _, c := range chains {
// flush chain, then if sucessful delete, delete will fail if flush fails.
// flush chain, then if successful delete, delete will fail if flush fails.
if err := ipt.FlushChain(iptables.TableNAT, c); err != nil {
glog.Errorf("Error flushing userspace chain: %v", err)
encounteredError = true
Expand Down Expand Up @@ -338,7 +338,7 @@ func (proxier *Proxier) addServiceOnPort(service proxy.ServicePortName, protocol
// How long we leave idle UDP connections open.
const udpIdleTimeout = 1 * time.Second

// OnUpdate manages the active set of service proxies.
// OnServiceUpdate manages the active set of service proxies.
// Active service proxies are reinitialized if found in the update set or
// shutdown if missing from the update set.
func (proxier *Proxier) OnServiceUpdate(services []api.Service) {
Expand Down Expand Up @@ -913,7 +913,7 @@ func (proxier *Proxier) iptablesHostPortalArgs(destIP net.IP, addDstLocalMatch b
// If the proxy is bound (see Proxier.listenIP) to 0.0.0.0 ("any
// interface") we want to do the same as from-container traffic and use
// REDIRECT. Except that it doesn't work (empirically). REDIRECT on
// localpackets sends the traffic to localhost (special case, but it is
// local packets sends the traffic to localhost (special case, but it is
// documented) but the response comes from the eth0 IP (not sure why,
// truthfully), which makes DNS unhappy.
//
Expand Down
2 changes: 1 addition & 1 deletion pkg/proxy/userspace/roundrobin.go
Expand Up @@ -91,7 +91,7 @@ func (lb *LoadBalancerRR) NewService(svcPort proxy.ServicePortName, affinityType
// This assumes that lb.lock is already held.
func (lb *LoadBalancerRR) newServiceInternal(svcPort proxy.ServicePortName, affinityType api.ServiceAffinity, ttlMinutes int) *balancerState {
if ttlMinutes == 0 {
ttlMinutes = 180 //default to 3 hours if not specified. Should 0 be unlimeted instead????
ttlMinutes = 180 //default to 3 hours if not specified. Should 0 be unlimited instead????
}

if _, exists := lb.services[svcPort]; !exists {
Expand Down
4 changes: 2 additions & 2 deletions pkg/util/iptables/iptables.go
Expand Up @@ -106,7 +106,7 @@ type RestoreCountersFlag bool
const RestoreCounters RestoreCountersFlag = true
const NoRestoreCounters RestoreCountersFlag = false

// Option flag for Restore
// Option flag for Flush
type FlushFlag bool

const FlushTables FlushFlag = true
Expand Down Expand Up @@ -226,7 +226,7 @@ func (runner *runner) DeleteChain(table Table, chain Chain) error {
runner.mu.Lock()
defer runner.mu.Unlock()

// TODO: we could call iptable -S first, ignore the output and check for non-zero return (more like DeleteRule)
// TODO: we could call iptables -S first, ignore the output and check for non-zero return (more like DeleteRule)
out, err := runner.run(opDeleteChain, fullArgs)
if err != nil {
return fmt.Errorf("error deleting chain %q: %v: %s", chain, err, out)
Expand Down