Skip to content

Commit 357c057

Browse files
Google APIscopybara-github
authored andcommitted
feat: add Skaffold remote config support for GCB repos
docs: clarified related comments PiperOrigin-RevId: 626346409
1 parent 5363614 commit 357c057

3 files changed

Lines changed: 43 additions & 3 deletions

File tree

google/cloud/deploy/v1/BUILD.bazel

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@
99
# * extra_protoc_file_parameters
1010
# The complete list of preserved parameters can be found in the source code.
1111

12+
# buildifier: disable=load-on-top
13+
1214
# This is an API workspace, having public visibility by default makes perfect sense.
1315
package(default_visibility = ["//visibility:public"])
1416

1517
##############################################################################
1618
# Common
1719
##############################################################################
18-
load("@rules_proto//proto:defs.bzl", "proto_library")
20+
# buildifier: disable=same-origin-load
1921
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
22+
load("@rules_proto//proto:defs.bzl", "proto_library")
2023

2124
proto_library(
2225
name = "deploy_proto",
@@ -60,6 +63,7 @@ proto_library_with_info(
6063
##############################################################################
6164
# Java
6265
##############################################################################
66+
# buildifier: disable=same-origin-load
6367
load(
6468
"@com_google_googleapis_imports//:imports.bzl",
6569
"java_gapic_assembly_gradle_pkg",
@@ -126,6 +130,7 @@ java_gapic_assembly_gradle_pkg(
126130
##############################################################################
127131
# Go
128132
##############################################################################
133+
# buildifier: disable=same-origin-load
129134
load(
130135
"@com_google_googleapis_imports//:imports.bzl",
131136
"go_gapic_assembly_pkg",
@@ -181,6 +186,7 @@ go_gapic_assembly_pkg(
181186
##############################################################################
182187
# Python
183188
##############################################################################
189+
# buildifier: disable=same-origin-load
184190
load(
185191
"@com_google_googleapis_imports//:imports.bzl",
186192
"py_gapic_assembly_pkg",
@@ -221,6 +227,7 @@ py_gapic_assembly_pkg(
221227
##############################################################################
222228
# PHP
223229
##############################################################################
230+
# buildifier: disable=same-origin-load
224231
load(
225232
"@com_google_googleapis_imports//:imports.bzl",
226233
"php_gapic_assembly_pkg",
@@ -258,6 +265,7 @@ php_gapic_assembly_pkg(
258265
##############################################################################
259266
# Node.js
260267
##############################################################################
268+
# buildifier: disable=same-origin-load
261269
load(
262270
"@com_google_googleapis_imports//:imports.bzl",
263271
"nodejs_gapic_assembly_pkg",
@@ -288,6 +296,7 @@ nodejs_gapic_assembly_pkg(
288296
##############################################################################
289297
# Ruby
290298
##############################################################################
299+
# buildifier: disable=same-origin-load
291300
load(
292301
"@com_google_googleapis_imports//:imports.bzl",
293302
"ruby_cloud_gapic_library",
@@ -342,6 +351,7 @@ ruby_gapic_assembly_pkg(
342351
##############################################################################
343352
# C#
344353
##############################################################################
354+
# buildifier: disable=same-origin-load
345355
load(
346356
"@com_google_googleapis_imports//:imports.bzl",
347357
"csharp_gapic_assembly_pkg",
@@ -352,7 +362,6 @@ load(
352362

353363
csharp_proto_library(
354364
name = "deploy_csharp_proto",
355-
extra_opts = [],
356365
deps = [":deploy_proto"],
357366
)
358367

@@ -389,6 +398,7 @@ csharp_gapic_assembly_pkg(
389398
##############################################################################
390399
# C++
391400
##############################################################################
401+
# buildifier: disable=same-origin-load
392402
load(
393403
"@com_google_googleapis_imports//:imports.bzl",
394404
"cc_grpc_library",

google/cloud/deploy/v1/cloud_deploy.proto

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ option (google.api.resource_definition) = {
3535
type: "cloudbuild.googleapis.com/Build"
3636
pattern: "projects/{project}/locations/{location}/builds/{build}"
3737
};
38+
option (google.api.resource_definition) = {
39+
type: "cloudbuild.googleapis.com/Repository"
40+
pattern: "projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}"
41+
};
3842
option (google.api.resource_definition) = {
3943
type: "container.googleapis.com/Cluster"
4044
pattern: "projects/{project}/locations/{location}/clusters/{cluster}"
@@ -1606,7 +1610,7 @@ message SkaffoldModules {
16061610
// Optional. Relative path from the repository root to the Skaffold file.
16071611
string path = 2 [(google.api.field_behavior) = OPTIONAL];
16081612

1609-
// Optional. Git ref the package should be cloned from.
1613+
// Optional. Git branch or tag to use when cloning the repository.
16101614
string ref = 3 [(google.api.field_behavior) = OPTIONAL];
16111615
}
16121616

@@ -1621,6 +1625,26 @@ message SkaffoldModules {
16211625
string path = 2 [(google.api.field_behavior) = OPTIONAL];
16221626
}
16231627

1628+
// Cloud Build V2 Repository containing Skaffold Configs.
1629+
message SkaffoldGCBRepoSource {
1630+
// Required. Name of the Cloud Build V2 Repository.
1631+
// Format is
1632+
// projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}.
1633+
string repository = 1 [
1634+
(google.api.field_behavior) = REQUIRED,
1635+
(google.api.resource_reference) = {
1636+
type: "cloudbuild.googleapis.com/Repository"
1637+
}
1638+
];
1639+
1640+
// Optional. Relative path from the repository root to the Skaffold Config
1641+
// file.
1642+
string path = 2 [(google.api.field_behavior) = OPTIONAL];
1643+
1644+
// Optional. Branch or tag to use when cloning the repository.
1645+
string ref = 3 [(google.api.field_behavior) = OPTIONAL];
1646+
}
1647+
16241648
// Optional. The Skaffold Config modules to use from the specified source.
16251649
repeated string configs = 1 [(google.api.field_behavior) = OPTIONAL];
16261650

@@ -1631,6 +1655,9 @@ message SkaffoldModules {
16311655

16321656
// Cloud Storage bucket containing the Skaffold Config modules.
16331657
SkaffoldGCSSource google_cloud_storage = 3;
1658+
1659+
// Cloud Build V2 repository containing the Skaffold Config modules.
1660+
SkaffoldGCBRepoSource google_cloud_build_repo = 4;
16341661
}
16351662
}
16361663

google/cloud/deploy/v1/clouddeploy_v1.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,15 @@ http:
6262
get: '/v1/{resource=projects/*/locations/*/deliveryPipelines/*}:getIamPolicy'
6363
additional_bindings:
6464
- get: '/v1/{resource=projects/*/locations/*/targets/*}:getIamPolicy'
65+
- get: '/v1/{resource=projects/*/locations/*/customTargetTypes/*}:getIamPolicy'
6566
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
6667
post: '/v1/{resource=projects/*/locations/*/deliveryPipelines/*}:setIamPolicy'
6768
body: '*'
6869
additional_bindings:
6970
- post: '/v1/{resource=projects/*/locations/*/targets/*}:setIamPolicy'
7071
body: '*'
72+
- post: '/v1/{resource=projects/*/locations/*/customTargetTypes/*}:setIamPolicy'
73+
body: '*'
7174
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
7275
post: '/v1/{resource=projects/*/locations/*/deliveryPipelines/*}:testIamPermissions'
7376
body: '*'

0 commit comments

Comments
 (0)