Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
7b9f6df0
Unverified
Commit
7b9f6df0
authored
Sep 27, 2018
by
k8s-ci-robot
Committed by
GitHub
Sep 27, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #69163 from MrHohn/gce-cloud-beta-ds-mock
Add mock for UpdateBetaBackendService
parents
f31cec41
c9c39eef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
mock.go
pkg/cloudprovider/providers/gce/cloud/mock/mock.go
+19
-0
No files found.
pkg/cloudprovider/providers/gce/cloud/mock/mock.go
View file @
7b9f6df0
...
...
@@ -476,6 +476,25 @@ func UpdateAlphaBackendServiceHook(ctx context.Context, key *meta.Key, obj *alph
return
nil
}
// UpdateBetaBackendServiceHook defines the hook for updating an beta BackendService.
// It replaces the object with the same key in the mock with the updated object.
func
UpdateBetaBackendServiceHook
(
ctx
context
.
Context
,
key
*
meta
.
Key
,
obj
*
beta
.
BackendService
,
m
*
cloud
.
MockBetaBackendServices
)
error
{
_
,
err
:=
m
.
Get
(
ctx
,
key
)
if
err
!=
nil
{
return
&
googleapi
.
Error
{
Code
:
http
.
StatusNotFound
,
Message
:
fmt
.
Sprintf
(
"Key: %s was not found in BackendServices"
,
key
.
String
()),
}
}
obj
.
Name
=
key
.
Name
projectID
:=
m
.
ProjectRouter
.
ProjectID
(
ctx
,
"beta"
,
"backendServices"
)
obj
.
SelfLink
=
cloud
.
SelfLink
(
meta
.
VersionBeta
,
projectID
,
"backendServices"
,
key
)
m
.
Objects
[
*
key
]
=
&
cloud
.
MockBackendServicesObj
{
Obj
:
obj
}
return
nil
}
// UpdateURLMapHook defines the hook for updating a UrlMap.
// It replaces the object with the same key in the mock with the updated object.
func
UpdateURLMapHook
(
ctx
context
.
Context
,
key
*
meta
.
Key
,
obj
*
ga
.
UrlMap
,
m
*
cloud
.
MockUrlMaps
)
error
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment