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

Update tools and remove unused code/deps #49

Merged
merged 4 commits into from
Oct 25, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ linters-settings:
line-length: 170
goconst:
ignore-tests: true
revive:
rules:
- name: dot-imports
disabled: true
linters:
enable-all: true
disable:
Expand Down Expand Up @@ -67,3 +71,5 @@ linters:
- varcheck
- deadcode
- ifshort
- inamedparam
- depguard
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ HELM_CHART_VERSION ?= 1.12.0
HELM_CHART_URL ?= https://raw.githubusercontent.com/dapr/helm-charts/master/dapr-$(HELM_CHART_VERSION).tgz

## Tool Versions
CODEGEN_VERSION ?= v0.27.4
KUSTOMIZE_VERSION ?= v5.0.1
CONTROLLER_TOOLS_VERSION ?= v0.12.1
CODEGEN_VERSION ?= v0.28.3
KUSTOMIZE_VERSION ?= v5.2.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
KIND_VERSION ?= v0.20.0
LINTER_VERSION ?= v1.52.2
OPERATOR_SDK_VERSION ?= v1.31.0
OPM_VERSION ?= v1.28.0
LINTER_VERSION ?= v1.55.1
OPERATOR_SDK_VERSION ?= v1.32.0
OPM_VERSION ?= v1.30.1
GOVULNCHECK_VERSION ?= latest

## Tool Binaries
Expand Down
1 change: 0 additions & 1 deletion api/operator/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions cmd/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package run
import (
"fmt"

routev1 "github.com/openshift/api/route/v1"
"github.com/spf13/cobra"
admregv1 "k8s.io/api/admissionregistration/v1"
appsv1 "k8s.io/api/apps/v1"
Expand All @@ -22,7 +21,6 @@ import (

func init() {
utilruntime.Must(daprApi.AddToScheme(controller.Scheme))
utilruntime.Must(routev1.Install(controller.Scheme))
}

func NewRunCmd() *cobra.Command {
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/operator.dapr.io_daprcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.12.1
controller-gen.kubebuilder.io/version: v0.13.0
name: daprcontrolplanes.operator.dapr.io
spec:
group: operator.dapr.io
Expand Down
8 changes: 2 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ module github.com/dapr-sandbox/dapr-kubernetes-operator
go 1.21

require (
github.com/anthhub/forwarder v1.1.1-0.20230315114022-63dcf7b46a1a
github.com/evanphx/json-patch v5.7.0+incompatible
github.com/go-logr/logr v1.2.4
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/onsi/gomega v1.28.1
github.com/openshift/api v0.0.0-20230816181854-a7ca92db022a
github.com/operator-framework/api v0.18.0
github.com/operator-framework/operator-lifecycle-manager v0.22.0
github.com/rs/xid v1.5.0
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.8.4
github.com/wI2L/jsondiff v0.4.0
golang.org/x/time v0.3.0
gopkg.in/yaml.v3 v3.0.1
Expand All @@ -23,7 +19,7 @@ require (
k8s.io/client-go v0.28.3
k8s.io/klog/v2 v2.100.1
sigs.k8s.io/controller-runtime v0.16.3
sigs.k8s.io/structured-merge-diff/v4 v4.3.0
sigs.k8s.io/structured-merge-diff/v4 v4.2.3
)

require (
Expand Down Expand Up @@ -52,6 +48,7 @@ require (
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
github.com/fatih/color v1.13.0 // indirect
Expand Down Expand Up @@ -109,7 +106,6 @@ require (
github.com/opencontainers/image-spec v1.1.0-rc5 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
Expand Down
604 changes: 2 additions & 602 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/client/operator/informers/externalversions/factory.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 0 additions & 114 deletions pkg/patch/patch.go

This file was deleted.

28 changes: 0 additions & 28 deletions pkg/patch/patch_test.go

This file was deleted.

24 changes: 0 additions & 24 deletions test/support/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import (

"github.com/hashicorp/go-cleanhttp"

"github.com/anthhub/forwarder"
"k8s.io/client-go/tools/portforward"

"github.com/rs/xid"
netv1 "k8s.io/api/networking/v1"

Expand Down Expand Up @@ -42,7 +39,6 @@ type Test interface {
NewNamespacedNameDaprControlPlane(types.NamespacedName, *daprAc.DaprControlPlaneSpecApplyConfiguration) *v1alpha1.DaprControlPlane
InstallChart(string, ...helm.InstallOption)
SetUpIngress(string, netv1.HTTPIngressPath) *netv1.Ingress
Forward(string, string, int) (*forwarder.Result, [][]portforward.ForwardedPort, error)

GET(string) func(g gomega.Gomega) (*http.Response, error)
POST(string, string, []byte) func(g gomega.Gomega) (*http.Response, error)
Expand Down Expand Up @@ -259,26 +255,6 @@ func (t *T) SetUpIngress(
return ing
}

func (t *T) Forward(service string, namespace string, remotePort int) (*forwarder.Result, [][]portforward.ForwardedPort, error) {
options := []*forwarder.Option{{
RemotePort: remotePort,
ServiceName: service,
Namespace: namespace,
}}

ret, err := forwarder.WithRestConfig(t.Ctx(), options, t.Client().config)
if err != nil {
return nil, nil, err
}

ports, err := ret.Ready()
if err != nil {
return nil, nil, err
}

return ret, ports, nil
}

func (t *T) GET(url string) func(g gomega.Gomega) (*http.Response, error) {
return func(g gomega.Gomega) (*http.Response, error) {
req, err := http.NewRequestWithContext(t.Ctx(), http.MethodGet, url, nil)
Expand Down