Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
chore: adjustments to recent changes in go-utils (#6706)
Browse files Browse the repository at this point in the history
Signed-off-by: warber <[email protected]>
  • Loading branch information
warber authored Jan 28, 2022
1 parent 0ceb54d commit e1f2fd7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions cli/cmd/get_event_approvalTriggered.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func getApprovalTriggeredEvents(approvalTriggered approvalTriggeredStruct) error
return getAllApprovalEventsInService(approvalTriggered, api.ShipyardControlHandlerV1(), api.EventsV1())
}

func getAllApprovalEventsInService(approvalTriggered approvalTriggeredStruct, scHandler *apiutils.ShipyardControllerHandler, eventHandler *apiutils.EventHandler) error {
func getAllApprovalEventsInService(approvalTriggered approvalTriggeredStruct, scHandler *apiutils.ShipyardControllerHandler, eventHandler apiutils.EventsV1Interface) error {
allEvents, err := scHandler.GetOpenTriggeredEvents(apiutils.EventFilter{
Stage: *approvalTriggered.Stage,
Project: *approvalTriggered.Project,
Expand All @@ -95,7 +95,7 @@ func getAllApprovalEventsInService(approvalTriggered approvalTriggeredStruct, sc
return nil
}

func getAllApprovalEventsInStage(approvalTriggered approvalTriggeredStruct, scHandler *apiutils.ShipyardControllerHandler, eventHandler *apiutils.EventHandler) error {
func getAllApprovalEventsInStage(approvalTriggered approvalTriggeredStruct, scHandler *apiutils.ShipyardControllerHandler, eventHandler apiutils.EventsV1Interface) error {
allEvents, err := scHandler.GetOpenTriggeredEvents(apiutils.EventFilter{
Project: *approvalTriggered.Project,
Stage: *approvalTriggered.Stage,
Expand Down
10 changes: 5 additions & 5 deletions cli/cmd/send_event_approvalFinished.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func sendApprovalFinishedEvent(sendApprovalFinishedOptions sendApprovalFinishedS
return nil
}

func sendEvent(keptnContext, triggeredID, eventType string, approvalFinishedEvent interface{}, apiHandler *apiutils.APIHandler) (*apimodels.EventContext, error) {
func sendEvent(keptnContext, triggeredID, eventType string, approvalFinishedEvent interface{}, apiHandler apiutils.APIV1Interface) (*apimodels.EventContext, error) {
ID := uuid.New().String()
source, _ := url.Parse("https://github.com/keptn/keptn/cli#" + eventType)

Expand Down Expand Up @@ -150,7 +150,7 @@ func sendEvent(keptnContext, triggeredID, eventType string, approvalFinishedEven
return responseEvent, nil
}

func getApprovalFinishedForService(eventHandler *apiutils.EventHandler, scHandler *apiutils.ShipyardControllerHandler,
func getApprovalFinishedForService(eventHandler apiutils.EventsV1Interface, scHandler *apiutils.ShipyardControllerHandler,
approvalFinishedOptions sendApprovalFinishedStruct) (string, string, *keptnv2.ApprovalFinishedEventData, error) {

allEvents, err := scHandler.GetOpenTriggeredEvents(apiutils.EventFilter{
Expand Down Expand Up @@ -263,7 +263,7 @@ func selectApprovalOption(nrOfOptions int) (int, error) {
return selectedOption, nil
}

func printApprovalOptions(approvals []*apimodels.KeptnContextExtendedCE, eventHandler *apiutils.EventHandler, approvalFinishedOptions sendApprovalFinishedStruct) {
func printApprovalOptions(approvals []*apimodels.KeptnContextExtendedCE, eventHandler apiutils.EventsV1Interface, approvalFinishedOptions sendApprovalFinishedStruct) {
// initialize tabwriter
w := new(tabwriter.Writer)

Expand All @@ -286,7 +286,7 @@ func appendOptionToWriter(w *tabwriter.Writer, index int, commitID, score string
fmt.Fprintf(w, "\n (%d)\t%s\t%s\t", index+1, commitID, score)
}

func getScoreForApprovalTriggeredEvent(eventHandler *apiutils.EventHandler, approvalFinishedOptions sendApprovalFinishedStruct, approval *apimodels.KeptnContextExtendedCE) string {
func getScoreForApprovalTriggeredEvent(eventHandler apiutils.EventsV1Interface, approvalFinishedOptions sendApprovalFinishedStruct, approval *apimodels.KeptnContextExtendedCE) string {
score := "n/a"
evaluationDoneEvents, errorObj := eventHandler.GetEvents(&apiutils.EventFilter{
Project: *approvalFinishedOptions.Project,
Expand Down Expand Up @@ -333,7 +333,7 @@ func getApprovalImageEvent(approval *apimodels.KeptnContextExtendedCE) string {
return unknownImage
}

func getApprovalFinishedForID(eventHandler *apiutils.EventHandler, sendApprovalFinishedOptions sendApprovalFinishedStruct) (string,
func getApprovalFinishedForID(eventHandler apiutils.EventsV1Interface, sendApprovalFinishedOptions sendApprovalFinishedStruct) (string,
string, *keptnv2.ApprovalFinishedEventData, error) {
events, errorObj := eventHandler.GetEvents(&apiutils.EventFilter{
Project: *sendApprovalFinishedOptions.Project,
Expand Down
2 changes: 1 addition & 1 deletion cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/docker/docker-credential-helpers v0.6.4
github.com/google/uuid v1.3.0
github.com/hashicorp/go-version v1.4.0
github.com/keptn/go-utils v0.11.1-0.20220121133159-436bd5859179
github.com/keptn/go-utils v0.11.1-0.20220128080832-dbb8942357ec
github.com/keptn/kubernetes-utils v0.10.1-0.20211102080304-e59377afdc8b
github.com/mattn/go-shellwords v1.0.12
github.com/mitchellh/mapstructure v1.4.3
Expand Down
4 changes: 2 additions & 2 deletions cli/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,8 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8
github.com/karrick/godirwalk v1.15.8 h1:7+rWAZPn9zuRxaIqqT8Ohs2Q2Ac0msBqwRdxNCr2VVs=
github.com/karrick/godirwalk v1.15.8/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk=
github.com/keptn/go-utils v0.10.0/go.mod h1:ub4G0WZUckc3TizUoe5jKqfCOOLiH5pnf4M1SDCOT0M=
github.com/keptn/go-utils v0.11.1-0.20220121133159-436bd5859179 h1:uK2eNwHCzZVhAykG6vRdcf3evebnmEcU90hCDXdd3hs=
github.com/keptn/go-utils v0.11.1-0.20220121133159-436bd5859179/go.mod h1:yJM7pnCUj23VHKa2az9eWUTAmLDv94f6DVHON9qV1kU=
github.com/keptn/go-utils v0.11.1-0.20220128080832-dbb8942357ec h1:OXBS2owf6Tw/8IruWlaPScsDLWsLsEqFu0JWsG7XezQ=
github.com/keptn/go-utils v0.11.1-0.20220128080832-dbb8942357ec/go.mod h1:yJM7pnCUj23VHKa2az9eWUTAmLDv94f6DVHON9qV1kU=
github.com/keptn/kubernetes-utils v0.10.1-0.20211102080304-e59377afdc8b h1:L+1m9DuYPfQCEv82/u05jj7EgeeZ/8tDkwf4JoRzMbw=
github.com/keptn/kubernetes-utils v0.10.1-0.20211102080304-e59377afdc8b/go.mod h1:vSj1n58CWHBrh4DzMhODGU1Z6BKYl9wEFzsg4XmuaJ0=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
Expand Down

0 comments on commit e1f2fd7

Please sign in to comment.