Skip to content

Commit

Permalink
Typo fix and code clean (istio#16766)
Browse files Browse the repository at this point in the history
  • Loading branch information
AsCat authored and istio-testing committed Sep 3, 2019
1 parent 0a5ce9b commit 809562f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pilot/pkg/model/envoyfilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func convertToEnvoyFilterWrapper(local *Config) *EnvoyFilterWrapper {

out := &EnvoyFilterWrapper{}
if localEnvoyFilter.WorkloadSelector != nil {
out.workloadSelector = labels.Instance(localEnvoyFilter.WorkloadSelector.Labels)
out.workloadSelector = localEnvoyFilter.WorkloadSelector.Labels
}
out.Patches = make(map[networking.EnvoyFilter_ApplyTo][]*EnvoyFilterConfigPatchWrapper)
for _, cp := range localEnvoyFilter.ConfigPatches {
Expand Down
8 changes: 4 additions & 4 deletions pilot/pkg/model/push_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ type PushContext struct {
// The following data is either a global index or used in the inbound path.
// Namespace specific views do not apply here.

// ServiceByHostnameAndNamespace has all services, indexed by hostname then namesace.
// ServiceByHostnameAndNamespace has all services, indexed by hostname then namespace.
ServiceByHostnameAndNamespace map[host.Name]map[string]*Service `json:"-"`

// AuthzPolicies stores the existing authorization policies in the cluster. Could be nil if there
Expand Down Expand Up @@ -923,13 +923,13 @@ func (ps *PushContext) initSidecarScopes(env *Environment) error {

sidecarConfigWithSelector := make([]Config, 0)
sidecarConfigWithoutSelector := make([]Config, 0)
sidecarsWithoutSelectorByNamesapce := make(map[string]struct{})
sidecarsWithoutSelectorByNamespace := make(map[string]struct{})
for _, sidecarConfig := range sidecarConfigs {
sidecar := sidecarConfig.Spec.(*networking.Sidecar)
if sidecar.WorkloadSelector != nil {
sidecarConfigWithSelector = append(sidecarConfigWithSelector, sidecarConfig)
} else {
sidecarsWithoutSelectorByNamesapce[sidecarConfig.Namespace] = struct{}{}
sidecarsWithoutSelectorByNamespace[sidecarConfig.Namespace] = struct{}{}
sidecarConfigWithoutSelector = append(sidecarConfigWithoutSelector, sidecarConfig)
}
}
Expand Down Expand Up @@ -965,7 +965,7 @@ func (ps *PushContext) initSidecarScopes(env *Environment) error {
// to the default Istio behavior mimicked by the DefaultSidecarScopeForNamespace function.
for _, nsMap := range ps.ServiceByHostnameAndNamespace {
for ns := range nsMap {
if _, exist := sidecarsWithoutSelectorByNamesapce[ns]; !exist {
if _, exist := sidecarsWithoutSelectorByNamespace[ns]; !exist {
ps.sidecarsByNamespace[ns] = append(ps.sidecarsByNamespace[ns], ConvertToSidecarScope(ps, rootNSConfig, ns))
}
}
Expand Down

0 comments on commit 809562f

Please sign in to comment.