Skip to content

Commit

Permalink
integrate cfnetworking lib into cli and drop recursive non-compatible…
Browse files Browse the repository at this point in the history
… dependencies
  • Loading branch information
jcvrabo committed Dec 30, 2024
1 parent 54bc4b7 commit 65e6e41
Show file tree
Hide file tree
Showing 64 changed files with 3,840 additions and 49 deletions.

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

2 changes: 1 addition & 1 deletion actor/cfnetworkingaction/networking_client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cfnetworkingaction

import "code.cloudfoundry.org/cfnetworking-cli-api/cfnetworking/cfnetv1"
import "code.cloudfoundry.org/cli/v8/api/cfnetworking/cfnetv1"

//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 . NetworkingClient

Expand Down
2 changes: 1 addition & 1 deletion actor/cfnetworkingaction/policy.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cfnetworkingaction

import (
"code.cloudfoundry.org/cfnetworking-cli-api/cfnetworking/cfnetv1"
"code.cloudfoundry.org/cli/v8/actor/actionerror"
"code.cloudfoundry.org/cli/v8/api/cfnetworking/cfnetv1"
"code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3"
"code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/constant"
"code.cloudfoundry.org/cli/v8/resources"
Expand Down
4 changes: 2 additions & 2 deletions actor/v7pushaction/handle_cnb_credentials_override.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package v7pushaction

import (
"code.cloudfoundry.org/cli/command/translatableerror"
"code.cloudfoundry.org/cli/util/manifestparser"
"code.cloudfoundry.org/cli/v8/command/translatableerror"
"code.cloudfoundry.org/cli/v8/util/manifestparser"
)

func HandleCNBCredentialsOverride(manifest manifestparser.Manifest, overrides FlagOverrides) (manifestparser.Manifest, error) {
Expand Down
4 changes: 2 additions & 2 deletions actor/v7pushaction/handle_cnb_credentials_override_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package v7pushaction_test

import (
. "code.cloudfoundry.org/cli/actor/v7pushaction"
"code.cloudfoundry.org/cli/util/manifestparser"
. "code.cloudfoundry.org/cli/v8/actor/v7pushaction"
"code.cloudfoundry.org/cli/v8/util/manifestparser"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down
4 changes: 2 additions & 2 deletions actor/v7pushaction/handle_lifecycle_override.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package v7pushaction

import (
"code.cloudfoundry.org/cli/command/translatableerror"
"code.cloudfoundry.org/cli/util/manifestparser"
"code.cloudfoundry.org/cli/v8/command/translatableerror"
"code.cloudfoundry.org/cli/v8/util/manifestparser"
)

func HandleLifecycleOverride(manifest manifestparser.Manifest, overrides FlagOverrides) (manifestparser.Manifest, error) {
Expand Down
55 changes: 55 additions & 0 deletions api/cfnetworking/cfnetv1/cfnetv1_suite_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package cfnetv1_test

import (
"bytes"
"log"
"testing"

. "code.cloudfoundry.org/cli/v8/api/cfnetworking/cfnetv1"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/ghttp"
)

func TestCFNetV1(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "CF Networking V1 Client Suite")
}

var server *Server

var _ = SynchronizedBeforeSuite(func() []byte {
return []byte{}
}, func(data []byte) {
server = NewTLSServer()

// Suppresses ginkgo server logs
server.HTTPTestServer.Config.ErrorLog = log.New(&bytes.Buffer{}, "", 0)
})

var _ = SynchronizedAfterSuite(func() {
server.Close()
}, func() {})

var _ = BeforeEach(func() {
server.Reset()
})

func NewTestClient(passed ...Config) *Client {
var config Config
if len(passed) > 0 {
config = passed[0]
} else {
config = Config{}
}
config.AppName = "CF Networking V1 Test"
config.AppVersion = "Unknown"
config.SkipSSLValidation = true

if config.URL == "" {
config.URL = server.URL()
}

return NewClient(config)
}
162 changes: 162 additions & 0 deletions api/cfnetworking/cfnetv1/cfnetv1fakes/fake_connection_wrapper.go

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

Loading

0 comments on commit 65e6e41

Please sign in to comment.