diff --git a/.github/workflows/image-build.yaml b/.github/workflows/image-build.yaml index 31b7e4fd..cf8702ca 100644 --- a/.github/workflows/image-build.yaml +++ b/.github/workflows/image-build.yaml @@ -13,7 +13,6 @@ on: - reopened push: branch: - tags: - main workflow_call: inputs: @@ -86,8 +85,9 @@ jobs: with: context: ./ push: ${{ steps.tag.outputs.push }} - tags: ghcr.io/${{ github.repository }}/meta-plugins:${{ steps.tag.outputs.version }}-${{ matrix.go_arch }} + tags: ghcr.io/${{ github.repository }}/meta-plugins:${{ steps.tag.outputs.version }} file: ./images/Dockerfile.${{ matrix.go_arch }} + github-token: ${{ secrets.WELAN_PAT }} platforms: linux/${{ matrix.go_arch }} build-args: | GIT_COMMIT_VERSION=${{ steps.arg.outputs.commitver }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b71990e3..b9b3095d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,6 +12,7 @@ on: - v* branches: - v* + - main workflow_dispatch: inputs: ref: diff --git a/charts/meta-plugins/Chart.yaml b/charts/meta-plugins/Chart.yaml index 03fd3fd7..c08d230e 100644 --- a/charts/meta-plugins/Chart.yaml +++ b/charts/meta-plugins/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: meta-plugins -description: Veth works with macvlan cni to solve some communication problems when macvlan is used as CNI. +description: meta-plugins works with macvlan cni to solve some communication problems when macvlan is used as CNI. # Library charts provide useful utilities or functions for the chart developer. They're included as # a dependency of application charts to inject those utilities and functions into the rendering @@ -10,13 +10,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: v0.1.5 +version: v0.1.6 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v0.1.5" +appVersion: "v0.1.6" maintainers: - name: Spider-Guys diff --git a/charts/meta-plugins/templates/daemonSet.yaml b/charts/meta-plugins/templates/daemonSet.yaml index 64249bb4..075dcd81 100644 --- a/charts/meta-plugins/templates/daemonSet.yaml +++ b/charts/meta-plugins/templates/daemonSet.yaml @@ -35,7 +35,7 @@ spec: effect: NoSchedule containers: - name: kube-{{ .Chart.Name }} - image: {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}-amd64 + image: {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }} imagePullPolicy: {{ .Values.image.pullPolicy | default "IfNotPresent" }} env: - name: KUBERNETES_NODE_NAME diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 3565ec3f..3ef7692e 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -116,13 +116,13 @@ func SysctlRPFilter(netns ns.NetNS, rp *types.RPFilter) error { var err error if rp.Enable != nil && *rp.Enable { if err = setRPFilter(rp.Value); err != nil { - return err + return fmt.Errorf("failed to set rp_filter for host : %v", err) } } // set pod rp_filter err = netns.Do(func(_ ns.NetNS) error { if err := setRPFilter(rp.Value); err != nil { - return err + return fmt.Errorf("failed to set rp_filter for pod : %v", err) } return nil }) @@ -139,7 +139,7 @@ func setRPFilter(v *int32) error { } dirs, err := os.ReadDir(sysctlConfPath) if err != nil { - return fmt.Errorf("[veth]failed to set rp_filter: %v", err) + return err } for _, dir := range dirs { name := fmt.Sprintf("/net/ipv4/conf/%s/rp_filter", dir.Name()) @@ -148,7 +148,7 @@ func setRPFilter(v *int32) error { continue } if value == "1" { - if _, e := sysctl.Sysctl(name, fmt.Sprintf("%d", v)); e != nil { + if _, e := sysctl.Sysctl(name, fmt.Sprintf("%d", *v)); e != nil { return e } } diff --git a/plugins/router/router.go b/plugins/router/router.go index 64024094..22535849 100644 --- a/plugins/router/router.go +++ b/plugins/router/router.go @@ -127,7 +127,7 @@ func cmdAdd(args *skel.CmdArgs) error { // 4. setup sysctl rp_filter if err = utils.SysctlRPFilter(netns, conf.RPFilter); err != nil { - return fmt.Errorf("%s failed to set rp_filter : %v", logPrefix, err) + return fmt.Errorf("%s : %v", logPrefix, err) } fmt.Fprintf(os.Stderr, "%s succeeded to set rp_filter \n", logPrefix)