Skip to content

Commit

Permalink
Update kube-vip
Browse files Browse the repository at this point in the history
  • Loading branch information
Madhur97 committed Aug 19, 2022
1 parent ccbc5d6 commit 161363e
Show file tree
Hide file tree
Showing 38 changed files with 88 additions and 354 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18

- name: build agent
run: make host-agent-binaries
Expand All @@ -52,7 +52,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18

- name: Install ginkgo
run: go get github.com/onsi/ginkgo/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/draft-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18

- name: Build Release Artifacts
run: IMG="projects.registry.vmware.com/cluster_api_provider_bringyourownhost/cluster-api-byoh-controller:${{ github.ref_name }}" make build-release-artifacts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18

- name: Install ginkgo
run: go get github.com/onsi/ginkgo/[email protected]
Expand Down
36 changes: 23 additions & 13 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,26 @@ jobs:
golangci:
runs-on: ubuntu-latest
steps:
- name: Install Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Checkout code
uses: actions/checkout@v2

- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.42.0
skip-go-installation: true
- name: Checkout code
uses: actions/checkout@v2
- name: Install Go 1.18.0
uses: actions/setup-go@v2
with:
cache: false
go-version: 1.18.0
- name: Install golangci-lint
# Install golangci-lint from source instead of using
# golangci-lint-action to ensure the golangci-lint binary is built with
# the same Go version we're targeting.
# Avoids incompatibility issues such as:
# - https://github.com/golangci/golangci-lint/issues/2922
# - https://github.com/golangci/golangci-lint/issues/2673
# - https://github.com/golangci/golangci-lint-action/issues/442
run: go install github.com/golangci/golangci-lint/cmd/[email protected]
- name: Run golangci-lint
run: golangci-lint run --version --verbose --out-format=github-actions
# - name: golangci-lint
# uses: golangci/golangci-lint-action@v2
# with:
# version: v1.48.0
# skip-go-installation: true
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.17.8 as builder
FROM golang:1.18 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ host-agent-binary: $(RELEASE_DIR)
-e GOARCH=$(GOARCH) \
-v "$$(pwd):/workspace$(DOCKER_VOL_OPTS)" \
-w /workspace \
golang:1.17.8 \
golang:1.18 \
go build -a -ldflags "$(GOLDFLAGS)" \
-o ./bin/$(notdir $(RELEASE_BINARY))-$(GOOS)-$(GOARCH) $(HOST_AGENT_DIR)

Expand Down
2 changes: 1 addition & 1 deletion agent/help_flag_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2021 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

// nolint: testpackage
//nolint: testpackage
package main

import (
Expand Down
2 changes: 1 addition & 1 deletion agent/host_agent_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2021 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

// nolint: testpackage
//nolint: testpackage
package main

import (
Expand Down
2 changes: 1 addition & 1 deletion agent/host_agent_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2021 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

// nolint: testpackage
//nolint: testpackage
package main

import (
Expand Down
2 changes: 1 addition & 1 deletion agent/label_flag_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2021 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

// nolint: testpackage
//nolint: testpackage
package main

import (
Expand Down
2 changes: 1 addition & 1 deletion agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (l *labelFlags) String() string {
}

// Set implements flag.Value interface
// nolint: gomnd
//nolint: gomnd
func (l *labelFlags) Set(value string) error {
// account for comma-separated key-value pairs in a single invocation
if len(strings.Split(value, ",")) > 1 {
Expand Down
2 changes: 1 addition & 1 deletion agent/reconciler/host_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ func (r *HostReconciler) deleteEndpointIP(ctx context.Context, byoHost *infrastr
logger := ctrl.LoggerFrom(ctx)
logger.Info("Removing network endpoints")
if IP, ok := byoHost.Annotations[infrastructurev1beta1.EndPointIPAnnotation]; ok {
network, err := vip.NewConfig(IP, registration.LocalHostRegistrar.ByoHostInfo.DefaultNetworkInterfaceName, false)
network, err := vip.NewConfig(IP, registration.LocalHostRegistrar.ByoHostInfo.DefaultNetworkInterfaceName, "", false, 0)
if err == nil {
err := network.DeleteIP()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions apis/infrastructure/v1beta1/byohost_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type ByoHostValidator struct {
// To allow byoh manager service account to patch ByoHost CR
const managerServiceAccount = "system:serviceaccount:byoh-system:byoh-controller-manager"

// nolint: gocritic
//nolint: gocritic
// Handle handles all the requests for ByoHost resource
func (v *ByoHostValidator) Handle(ctx context.Context, req admission.Request) admission.Response {
var response admission.Response
Expand Down Expand Up @@ -53,7 +53,7 @@ func (v *ByoHostValidator) handleCreateUpdate(req *admission.Request) admission.
return admission.Allowed("")
}
substrs := strings.Split(userName, ":")
if len(substrs) < 2 { // nolint: gomnd
if len(substrs) < 2 { //nolint: gomnd
return admission.Denied(fmt.Sprintf("%s is not a valid agent username", userName))
}
if !strings.Contains(byoHost.Name, substrs[2]) {
Expand Down
2 changes: 1 addition & 1 deletion common/bootstraptoken/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
// GetTokenIDSecretFromBootstrapToken splits the token string and returns the tokenID and tokenSecret parts
func GetTokenIDSecretFromBootstrapToken(tokenStr string) (tokenID, tokenSecret string, err error) {
substrs := bootstraputil.BootstrapTokenRegexp.FindStringSubmatch(tokenStr)
if len(substrs) != 3 { // nolint: gomnd
if len(substrs) != 3 { //nolint: gomnd
return "", "", fmt.Errorf("the bootstrap token %q was not of the form %q", tokenStr, bootstrapapi.BootstrapTokenPattern)
}

Expand Down
2 changes: 1 addition & 1 deletion controllers/infrastructure/byomachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ type ByoMachineReconciler struct {
// - https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/reconcile

// Reconcile handles ByoMachine events
// nolint: gocyclo, funlen
//nolint: gocyclo, funlen
func (r *ByoMachineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error) {
logger := log.FromContext(ctx)
logger.Info("Reconcile request received")
Expand Down
2 changes: 1 addition & 1 deletion docs/cluster_class.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ spec:
value: "10"
- name: vip_retryperiod
value: "2"
image: ghcr.io/kube-vip/kube-vip:v0.4.1
image: ghcr.io/kube-vip/kube-vip:v0.5.0
imagePullPolicy: IfNotPresent
name: kube-vip
resources: {}
Expand Down
15 changes: 9 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
module github.com/vmware-tanzu/cluster-api-provider-bringyourownhost

go 1.17
go 1.18

replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.1.3

replace github.com/insomniacslk/dhcp => github.com/harvester/dhcp v0.0.0-20220421024905-28b38eafefe3

require (
github.com/cppforlife/go-cli-ui v0.0.0-20200716203538-1e47f820817f
github.com/docker/cli v20.10.17+incompatible
github.com/docker/docker v20.10.17+incompatible
github.com/go-logr/logr v1.2.2
github.com/jackpal/gateway v1.0.7
github.com/k14s/imgpkg v0.21.0
github.com/kube-vip/kube-vip v0.4.1
github.com/kube-vip/kube-vip v0.5.0
github.com/maxbrunsfeld/counterfeiter/v6 v6.5.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.20.0
Expand Down Expand Up @@ -104,7 +106,7 @@ require (
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/insomniacslk/dhcp v0.0.0-20220504074936-1ca156eafb9f // indirect
github.com/insomniacslk/dhcp v0.0.0-20220119180841-3c283ff8b7dd // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
Expand All @@ -116,8 +118,9 @@ require (
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mdlayher/arp v0.0.0-20191213142603-f72070a231fc // indirect
github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7 // indirect
github.com/mdlayher/ndp v0.0.0-20210831201139-f982b8766fb5 // indirect
github.com/mdlayher/ndp v0.10.0 // indirect
github.com/mdlayher/raw v0.0.0-20211126142749-4eae47f3d54b // indirect
github.com/miekg/pkcs11 v1.1.1 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
Expand Down Expand Up @@ -146,7 +149,7 @@ require (
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/cobra v1.4.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/viper v1.10.0 // indirect
github.com/spf13/viper v1.10.1 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/theupdateframework/notary v0.7.0 // indirect
Expand All @@ -161,7 +164,7 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.1 // indirect
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
Expand Down
Loading

0 comments on commit 161363e

Please sign in to comment.