Skip to content

Commit

Permalink
chore: update module name
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
  • Loading branch information
sagikazarmark committed Feb 9, 2023
1 parent 75ff98f commit 729ea0f
Show file tree
Hide file tree
Showing 30 changed files with 85 additions and 79 deletions.
5 changes: 3 additions & 2 deletions cmd/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ import (

"emperror.dev/errors"
"github.com/MakeNowJust/heredoc"
"github.com/banzaicloud/operator-tools/pkg/docgen"
"github.com/banzaicloud/operator-tools/pkg/utils"

"github.com/cisco-open/operator-tools/pkg/docgen"
"github.com/cisco-open/operator-tools/pkg/utils"
)

var logger = utils.Log
Expand Down
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module github.com/cisco-open/operator-tools
go 1.17

require (
emperror.dev/errors v0.8.0
emperror.dev/errors v0.8.1
github.com/MakeNowJust/heredoc v1.0.0
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883
github.com/banzaicloud/k8s-objectmatcher v1.8.0
github.com/briandowns/spinner v1.12.0
github.com/cisco-open/k8s-objectmatcher v1.9.0
github.com/cppforlife/go-patch v0.2.0
github.com/fatih/color v1.13.0
github.com/ghodss/yaml v1.0.0
Expand All @@ -30,8 +30,6 @@ require (
sigs.k8s.io/yaml v1.3.0
)

require k8s.io/cli-runtime v0.24.2 // indirect

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/BurntSushi/toml v1.0.0 // indirect
Expand Down Expand Up @@ -142,6 +140,7 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiserver v0.24.2 // indirect
k8s.io/cli-runtime v0.24.2 // indirect
k8s.io/component-base v0.24.2 // indirect
k8s.io/klog/v2 v2.60.1 // indirect
k8s.io/kube-openapi v0.0.0-20220627174259-011e075b9cb8 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
emperror.dev/errors v0.8.0 h1:4lycVEx0sdJkwDUfQ9pdu6SR0x7rgympt5f4+ok8jDk=
emperror.dev/errors v0.8.0/go.mod h1:YcRvLPh626Ubn2xqtoprejnA5nFha+TJ+2vew48kWuE=
emperror.dev/errors v0.8.1 h1:UavXZ5cSX/4u9iyvH6aDcuGkVjeexUGJ7Ij7G4VfQT0=
emperror.dev/errors v0.8.1/go.mod h1:YcRvLPh626Ubn2xqtoprejnA5nFha+TJ+2vew48kWuE=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg=
github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v56.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
Expand Down Expand Up @@ -153,8 +153,6 @@ github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/aws/aws-sdk-go v1.43.16/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
github.com/banzaicloud/k8s-objectmatcher v1.8.0 h1:Nugn25elKtPMTA2br+JgHNeSQ04sc05MDPmpJnd1N2A=
github.com/banzaicloud/k8s-objectmatcher v1.8.0/go.mod h1:p2LSNAjlECf07fbhDyebTkPUIYnU05G+WfGgkTmgeMg=
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
Expand Down Expand Up @@ -208,6 +206,8 @@ github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX
github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs=
github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs=
github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA=
github.com/cisco-open/k8s-objectmatcher v1.9.0 h1:/sfuO0BD09fpynZjXsqeZrh28Juc4VEwc2P6Ov/Q6fM=
github.com/cisco-open/k8s-objectmatcher v1.9.0/go.mod h1:CH4E6qAK+q+JwKFJn0DaTNqxrbmWCaDQzGthKLK4nZ0=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
Expand Down
2 changes: 1 addition & 1 deletion pkg/crd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"

"github.com/banzaicloud/operator-tools/pkg/crd"
"github.com/cisco-open/operator-tools/pkg/crd"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/docgen/docgen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (

"github.com/MakeNowJust/heredoc"
"github.com/andreyvit/diff"
"github.com/banzaicloud/operator-tools/pkg/docgen"
"github.com/banzaicloud/operator-tools/pkg/utils"
"github.com/cisco-open/operator-tools/pkg/docgen"
"github.com/cisco-open/operator-tools/pkg/utils"
"github.com/go-logr/logr"
)

Expand Down
3 changes: 2 additions & 1 deletion pkg/helm/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"strings"

"emperror.dev/errors"
"github.com/banzaicloud/operator-tools/pkg/resources"
"github.com/ghodss/yaml"
"helm.sh/helm/v3/pkg/chart"
"helm.sh/helm/v3/pkg/releaseutil"
Expand All @@ -31,6 +30,8 @@ import (
"helm.sh/helm/v3/pkg/chartutil"
"helm.sh/helm/v3/pkg/engine"
"k8s.io/apimachinery/pkg/runtime"

"github.com/cisco-open/operator-tools/pkg/resources"
)

const legacyRequirementsFileName = "requirements.yaml"
Expand Down
16 changes: 8 additions & 8 deletions pkg/helm/templatereconciler/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/yaml"

"github.com/banzaicloud/operator-tools/pkg/helm"
"github.com/banzaicloud/operator-tools/pkg/reconciler"
"github.com/banzaicloud/operator-tools/pkg/utils"
"github.com/cisco-open/operator-tools/pkg/helm"
"github.com/cisco-open/operator-tools/pkg/reconciler"
"github.com/cisco-open/operator-tools/pkg/utils"
)

func orderedChartObjectsWithState(releaseData *ReleaseData, scheme *runtime.Scheme, caps chartutil.Capabilities) ([]runtime.Object, reconciler.DesiredState, error) {
Expand All @@ -48,11 +48,11 @@ func chartObjects(releaseData *ReleaseData, scheme *runtime.Scheme, caps chartut
}

objects, err := helm.Render(releaseData.Chart, helm.MergeMaps(chartDefaultValuesYaml, releaseData.Values), helm.ReleaseOptions{
Name: releaseData.ReleaseName,
IsInstall: true,
IsUpgrade: false,
Namespace: releaseData.Namespace,
Scheme: scheme,
Name: releaseData.ReleaseName,
IsInstall: true,
IsUpgrade: false,
Namespace: releaseData.Namespace,
Scheme: scheme,
Capabilities: caps,
}, releaseData.ChartName)
if err != nil {
Expand Down
10 changes: 5 additions & 5 deletions pkg/helm/templatereconciler/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

"github.com/banzaicloud/operator-tools/pkg/inventory"
"github.com/banzaicloud/operator-tools/pkg/logger"
"github.com/banzaicloud/operator-tools/pkg/reconciler"
"github.com/banzaicloud/operator-tools/pkg/resources"
"github.com/banzaicloud/operator-tools/pkg/types"
"github.com/cisco-open/operator-tools/pkg/inventory"
"github.com/cisco-open/operator-tools/pkg/logger"
"github.com/cisco-open/operator-tools/pkg/reconciler"
"github.com/cisco-open/operator-tools/pkg/resources"
"github.com/cisco-open/operator-tools/pkg/types"
)

type ReleaseData struct {
Expand Down
4 changes: 2 additions & 2 deletions pkg/inventory/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (
"k8s.io/client-go/discovery"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/banzaicloud/operator-tools/pkg/reconciler"
"github.com/banzaicloud/operator-tools/pkg/utils"
"github.com/cisco-open/operator-tools/pkg/reconciler"
"github.com/cisco-open/operator-tools/pkg/utils"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/inventory/inventory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/utils/diff"

"github.com/banzaicloud/operator-tools/pkg/utils"
"github.com/cisco-open/operator-tools/pkg/utils"
)

func TestCreateObjectsInventory(t *testing.T) {
Expand Down
13 changes: 7 additions & 6 deletions pkg/merge/merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ package merge
import (
"testing"

"github.com/banzaicloud/operator-tools/pkg/typeoverride"
"github.com/banzaicloud/operator-tools/pkg/utils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
v1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
v12 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"

"github.com/cisco-open/operator-tools/pkg/typeoverride"
"github.com/cisco-open/operator-tools/pkg/utils"
)

func TestMerge(t *testing.T) {
Expand Down Expand Up @@ -114,8 +115,8 @@ func TestMerge(t *testing.T) {

// container c is not modified (note that it's index will change)
assert.Equal(t, corev1.Container{
Name: "container-c",
Image: "image-c",
Name: "container-c",
Image: "image-c",
Command: []string{"fake"},
}, base.Spec.Template.Spec.Containers[3])
}
Expand Down Expand Up @@ -166,7 +167,7 @@ func TestVolume(t *testing.T) {
err := Merge(base, overrides)
require.NoError(t, err)

require.Equal(t, &v1.DaemonSet{
require.Equal(t, &v1.DaemonSet{
Spec: v1.DaemonSetSpec{
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
Expand Down Expand Up @@ -420,7 +421,7 @@ func TestMergeService(t *testing.T) {
TargetPort: intstr.FromInt(8082),
},
},
Selector:map[string]string{
Selector: map[string]string{
"b": "3",
"c": "4",
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/reconciler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

It creates the object if it doesn't exist or removes it in case its desired state is absent.

It uses the [ObjectMatcher](https://github.com/banzaicloud/k8s-objectmatcher) library to be able to tell if an already
It uses the [ObjectMatcher](https://github.com/cisco-open/k8s-objectmatcher) library to be able to tell if an already
existing object needs to be updated or not.

It depends on [logr](github.com/go-logr/logr) logger and the [controller-runtime](sigs.k8s.io/controller-runtime) client
Expand All @@ -18,7 +18,7 @@ package main
import (
corev1 "k8s.io/api/core/v1"
github.com/go-logr/logr
"github.com/banzaicloud/operator-tools/pkg/reconciler"
"github.com/cisco-open/operator-tools/pkg/reconciler"
runtimeClient "sigs.k8s.io/controller-runtime/pkg/client"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/banzaicloud/operator-tools/pkg/wait"
"github.com/cisco-open/operator-tools/pkg/wait"
)

func IstioSidecarInjectorExistsCheck(c client.Client, namespace string) wait.CustomResourceConditionCheck {
Expand Down
7 changes: 4 additions & 3 deletions pkg/reconciler/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ import (
"context"

"emperror.dev/errors"
"github.com/banzaicloud/operator-tools/pkg/resources"
"github.com/banzaicloud/operator-tools/pkg/types"
"github.com/banzaicloud/operator-tools/pkg/utils"
"github.com/go-logr/logr"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/builder"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

"github.com/cisco-open/operator-tools/pkg/resources"
"github.com/cisco-open/operator-tools/pkg/types"
"github.com/cisco-open/operator-tools/pkg/utils"
)

type ComponentReconciler interface {
Expand Down
6 changes: 3 additions & 3 deletions pkg/reconciler/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/banzaicloud/operator-tools/pkg/wait"
"github.com/cisco-open/operator-tools/pkg/wait"
)

var DefaultBackoff = wait.Backoff{
Expand Down Expand Up @@ -51,14 +51,14 @@ type ResourceCondition struct {
type ConditionChecker struct {
client client.Client
scheme *runtime.Scheme
log logr.Logger
log logr.Logger
}

func NewConditionChecker(client client.Client, scheme *runtime.Scheme, log logr.Logger) *ConditionChecker {
return &ConditionChecker{
client: client,
scheme: scheme,
log: log,
log: log,
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

ottypes "github.com/banzaicloud/operator-tools/pkg/types"
ottypes "github.com/cisco-open/operator-tools/pkg/types"
)

func EnqueueByOwnerAnnotationMapper() handler.MapFunc {
Expand Down
8 changes: 4 additions & 4 deletions pkg/reconciler/native.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ import (
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

"github.com/banzaicloud/operator-tools/pkg/resources"
"github.com/banzaicloud/operator-tools/pkg/types"
"github.com/banzaicloud/operator-tools/pkg/utils"
"github.com/banzaicloud/operator-tools/pkg/wait"
"github.com/cisco-open/operator-tools/pkg/resources"
"github.com/cisco-open/operator-tools/pkg/types"
"github.com/cisco-open/operator-tools/pkg/utils"
"github.com/cisco-open/operator-tools/pkg/wait"
)

type ResourceOwner interface {
Expand Down
6 changes: 3 additions & 3 deletions pkg/reconciler/native_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ import (
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"sigs.k8s.io/controller-runtime/pkg/builder"

"github.com/banzaicloud/operator-tools/pkg/reconciler"
ottypes "github.com/banzaicloud/operator-tools/pkg/types"
"github.com/banzaicloud/operator-tools/pkg/utils"
"github.com/cisco-open/operator-tools/pkg/reconciler"
ottypes "github.com/cisco-open/operator-tools/pkg/types"
"github.com/cisco-open/operator-tools/pkg/utils"
)

// FakeResourceOwner object implements the ResourceOwner interface by piggybacking a ConfigMap (oink-oink)
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"emperror.dev/errors"

"github.com/banzaicloud/k8s-objectmatcher/patch"
"github.com/cisco-open/k8s-objectmatcher/patch"
)

func IgnoreManagedFields() patch.CalculateOption {
Expand Down
4 changes: 2 additions & 2 deletions pkg/reconciler/predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/event"
"sigs.k8s.io/controller-runtime/pkg/predicate"

"github.com/banzaicloud/k8s-objectmatcher/patch"
"github.com/banzaicloud/operator-tools/pkg/types"
"github.com/cisco-open/k8s-objectmatcher/patch"
"github.com/cisco-open/operator-tools/pkg/types"
)

type SkipCreatePredicate struct {
Expand Down
6 changes: 3 additions & 3 deletions pkg/reconciler/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"time"

"emperror.dev/errors"
"github.com/cisco-open/k8s-objectmatcher/patch"
"github.com/go-logr/logr"
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
Expand All @@ -37,9 +38,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client/apiutil"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

"github.com/banzaicloud/k8s-objectmatcher/patch"
"github.com/banzaicloud/operator-tools/pkg/types"
"github.com/banzaicloud/operator-tools/pkg/utils"
"github.com/cisco-open/operator-tools/pkg/types"
"github.com/cisco-open/operator-tools/pkg/utils"
)

const (
Expand Down
5 changes: 3 additions & 2 deletions pkg/reconciler/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
"context"
"testing"

"github.com/banzaicloud/operator-tools/pkg/reconciler"
"github.com/banzaicloud/operator-tools/pkg/utils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
appsv1 "k8s.io/api/apps/v1"
Expand All @@ -29,6 +27,9 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

"github.com/cisco-open/operator-tools/pkg/reconciler"
"github.com/cisco-open/operator-tools/pkg/utils"
)

func TestNewReconcilerWith(t *testing.T) {
Expand Down
Loading

0 comments on commit 729ea0f

Please sign in to comment.