Skip to content

Commit

Permalink
Merge pull request #9 from alexanderConstantinescu/bugfix/miscellaneo…
Browse files Browse the repository at this point in the history
…us-fixes

Miscellaneous fixes
  • Loading branch information
openshift-merge-robot committed Dec 16, 2021
2 parents acfed5f + 23ec7a4 commit c8ca67d
Show file tree
Hide file tree
Showing 1,027 changed files with 58,728 additions and 25,228 deletions.
66 changes: 55 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,22 +1,66 @@
module github.com/openshift/cloud-network-config-controller

go 1.16
go 1.17

require (
github.com/Azure/azure-sdk-for-go v53.1.0+incompatible
github.com/Azure/go-autorest/autorest v0.11.17
github.com/Azure/go-autorest/autorest/adal v0.9.11
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
github.com/Azure/go-autorest/autorest v0.11.18
github.com/Azure/go-autorest/autorest/adal v0.9.13
github.com/aws/aws-sdk-go v1.37.8
github.com/openshift/api v0.0.0-20210423140644-156ca80f8d83
github.com/openshift/client-go v0.0.0-20210503124028-ac0910aac9fa
golang.org/x/sys v0.0.0-20210412220455-f1c623a9e750 // indirect
google.golang.org/api v0.44.0
k8s.io/api v0.21.0-rc.0
k8s.io/apimachinery v0.21.0
k8s.io/client-go v0.21.0-rc.0
k8s.io/klog/v2 v2.8.0
k8s.io/utils v0.0.0-20210305010621-2afb4311ab10
k8s.io/api v0.23.0
k8s.io/apimachinery v0.23.0
k8s.io/client-go v0.23.0
k8s.io/klog/v2 v2.30.0
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b
sigs.k8s.io/controller-runtime v0.8.3
)

require (
cloud.google.com/go v0.81.0 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.5 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/imdario/mergo v0.3.10 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
golang.org/x/net v0.0.0-20210825183410-e898025ed96a // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1 // indirect
google.golang.org/grpc v1.36.1 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)
109 changes: 75 additions & 34 deletions go.sum

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions hack/run_locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ ROOT=$(readlink --canonicalize "$HERE/..")
SECRET_LOCATION=$ROOT/tmp-secret-location/
mkdir -p $SECRET_LOCATION

cloudprovider=$(oc get infrastructures.config.openshift.io cluster -o jsonpath='{.status.platform}')
platformtype=$(oc get infrastructures.config.openshift.io cluster -o jsonpath='{.status.platform}')

# This won't work on platforms != AWS, but we don't care.
# The command won't fail and `cloudregion` is only used on AWS
cloudregion=$(oc get infrastructures.config.openshift.io cluster -o jsonpath='{.status.platformStatus.aws.region}')
platformregion=$(oc get infrastructures.config.openshift.io cluster -o jsonpath='{.status.platformStatus.aws.region}')

json=$(oc get secret cloud-credentials -n openshift-cloud-network-config-controller -o jsonpath='{.data}')
for key in $(echo $json | jq -r 'keys[]'); do
Expand All @@ -36,6 +36,6 @@ oc scale deployment cloud-network-config-controller -n openshift-cloud-network-c

go run $ROOT/cmd/cloud-network-config-controller/main.go \
-kubeconfig $KUBECONFIG \
-cloud-provider $cloudprovider \
-cloud-secret-override $SECRET_LOCATION \
-cloud-region $cloudregion
-platform-type $platformtype \
-platform-region $platformregion \
-secret-override $SECRET_LOCATION
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func (c *CloudPrivateIPConfigController) getCloudPrivateIPConfig(name string) (*
ctx, cancel := context.WithTimeout(c.ctx, controller.ClientTimeout)
defer cancel()
// This object will repeatedly be updated during this sync, hence we need to
// retrieve the object from the API server as supposed to the informer cache
// retrieve the object from the API server as opposed to the informer cache
// for every sync, otherwise we risk acting on an old object
cloudPrivateIPConfig, err := c.cloudNetworkClient.CloudV1().CloudPrivateIPConfigs().Get(ctx, name, metav1.GetOptions{})
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ func NewFakeRacyCloudPrivateIPConfigController(delayCompletion time.Duration) *F
}

func TestDelayedCompletionWithCoalescedUpdatesBeforeFirstCreateOperationFinishes(t *testing.T) {
// The following test executes the scenario below (brackets indicate expect
// time to execute, paranthesis: parallel event):
// The following test executes the scenario below (brackets indicate
// expected time to execute, parenthesis: parallel event):
// time: 0
// +NodeA [100ms]
// (Update to NodeB - 50ms in)
Expand Down Expand Up @@ -157,8 +157,8 @@ func TestDelayedCompletionWithCoalescedUpdatesBeforeFirstCreateOperationFinishes
}

func TestDelayedCompletionWithCoalescedUpdatesAfterFirstCreateOperationFinishes(t *testing.T) {
// The following test executes the scenario below (brackets indicate expect
// time to execute, paranthesis: parallel event):
// The following test executes the scenario below (brackets indicate
// expected time to execute, parenthesis: parallel event):
// time: 0
// +NodeA [100ms]
// (Update to NodeB - 200ms in)
Expand All @@ -167,7 +167,7 @@ func TestDelayedCompletionWithCoalescedUpdatesAfterFirstCreateOperationFinishes(
// +NodeC 100ms
// Small explainer: the above case is correct because it takes the sync
// 100ms to remove the assignment to NodeA, during which the update to NodeC
// comes in. The update from NodeB -> NodeC thus gets override and we don't
// comes in. The update from NodeB -> NodeC thus gets overridden and we don't
// perform an additional unnecessary operation to NodeB
testObject := &cloudnetworkv1.CloudPrivateIPConfig{
ObjectMeta: v1.ObjectMeta{
Expand Down Expand Up @@ -251,8 +251,8 @@ func TestDelayedCompletionWithCoalescedUpdatesAfterFirstCreateOperationFinishes(
}

func TestDelayedCompletionWithCoalescedUpdatesAfterFirstCreateOperationFinishesAgain(t *testing.T) {
// The following test executes the scenario below (brackets indicate expect
// time to execute, paranthesis: parallel event):
// The following test executes the scenario below (brackets indicate
// expected time to execute, parenthesis: parallel event):
// time: 0
// +NodeA [100ms]
// (Update to NodeB - 200ms in)
Expand All @@ -263,7 +263,7 @@ func TestDelayedCompletionWithCoalescedUpdatesAfterFirstCreateOperationFinishesA
// +NodeC 100ms
// Small explainer: the above case is correct because it takes the sync
// 100ms to remove the assignment to NodeA. Since the update to NodeC comes
// in at 110ms, the assign to NodeB has already started. Once that has
// in at 110ms, the assignment to NodeB has already started. Once that has
// happened it needs to finish assigning it and removing it before updating
// the assignment to NodeC. This case cannot go any other way and there is
// no better solution. perform an additional unnecessary operation to NodeB
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func NewCloudNetworkConfigController(
// workers to finish processing their current work items.
func (c *CloudNetworkConfigController) Run(stopCh <-chan struct{}) error {
defer utilruntime.HandleCrash()
defer c.workqueue.ShutDown()
defer c.workqueue.ShutDownWithDrain()

// Start the informer factories to begin populating the informer caches
klog.Infof("Starting %s controller", c.controllerKey)
Expand Down
13 changes: 0 additions & 13 deletions vendor/github.com/Azure/go-autorest/autorest/adal/go.mod

This file was deleted.

21 changes: 0 additions & 21 deletions vendor/github.com/Azure/go-autorest/autorest/adal/go.sum

This file was deleted.

13 changes: 12 additions & 1 deletion vendor/github.com/Azure/go-autorest/autorest/adal/token.go

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

4 changes: 4 additions & 0 deletions vendor/github.com/Azure/go-autorest/autorest/client.go

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

5 changes: 0 additions & 5 deletions vendor/github.com/Azure/go-autorest/autorest/date/go.mod

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/Azure/go-autorest/autorest/date/go.sum

This file was deleted.

12 changes: 0 additions & 12 deletions vendor/github.com/Azure/go-autorest/autorest/go.mod

This file was deleted.

23 changes: 0 additions & 23 deletions vendor/github.com/Azure/go-autorest/autorest/go.sum

This file was deleted.

5 changes: 0 additions & 5 deletions vendor/github.com/Azure/go-autorest/autorest/to/go.mod

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/Azure/go-autorest/autorest/to/go.sum

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions vendor/github.com/Azure/go-autorest/logger/go.mod

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/Azure/go-autorest/logger/go.sum

This file was deleted.

9 changes: 9 additions & 0 deletions vendor/github.com/Azure/go-autorest/logger/logger.go

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

5 changes: 0 additions & 5 deletions vendor/github.com/Azure/go-autorest/tracing/go.mod

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/Azure/go-autorest/tracing/go.sum

This file was deleted.

0 comments on commit c8ca67d

Please sign in to comment.