Skip to content

Commit

Permalink
Merge pull request kubeedge#5895 from cuishuang/master
Browse files Browse the repository at this point in the history
fix: fix slice init issue
  • Loading branch information
kubeedge-bot authored Sep 29, 2024
2 parents 841368a + 1e0c2ea commit 8554c10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cloud/pkg/cloudstream/iptables/iptables.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (im *Manager) reconcile() {
for _, ipports := range addedIPPort {
ipport := strings.Split(ipports, ":")
ip, port := ipport[0], ipport[1]
args := append([]string{"-p", "tcp", "-j", "DNAT", "--dport", port, "--to", ip + ":" + strconv.Itoa(im.streamPort)})
args := []string{"-p", "tcp", "-j", "DNAT", "--dport", port, "--to", ip + ":" + strconv.Itoa(im.streamPort)}
if _, err := im.iptables.EnsureRule(utiliptables.Append, utiliptables.TableNAT, tunnelPortChain, args...); err != nil {
klog.ErrorS(err, "Failed to ensure rules", "table", utiliptables.TableNAT, "chain", tunnelPortChain)
return
Expand All @@ -150,7 +150,7 @@ func (im *Manager) reconcile() {
for _, ipports := range deletedIPPort {
ipport := strings.Split(ipports, ":")
ip, port := ipport[0], ipport[1]
args := append([]string{"-p", "tcp", "-j", "DNAT", "--dport", port, "--to", ip + ":" + strconv.Itoa(im.streamPort)})
args := []string{"-p", "tcp", "-j", "DNAT", "--dport", port, "--to", ip + ":" + strconv.Itoa(im.streamPort)}
if err := im.iptables.DeleteRule(utiliptables.TableNAT, tunnelPortChain, args...); err != nil {
klog.ErrorS(err, "Failed to delete rules", "table", utiliptables.TableNAT, "chain", tunnelPortChain)
return
Expand Down
2 changes: 1 addition & 1 deletion keadm/cmd/keadm/app/cmd/helm/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ func (cu *KubeCloudHelmInstTool) checkProfile(baseHelmRoot string) error {
validProfiles[IptablesMgrProfileKey] = true
validProfiles[ControllerManagerProfileKey] = true
if ok := validProfiles[cu.ProfileKey]; !ok {
validKeys := make([]string, len(validProfiles))
validKeys := make([]string, 0, len(validProfiles))
for k := range validProfiles {
validKeys = append(validKeys, k)
}
Expand Down

0 comments on commit 8554c10

Please sign in to comment.