Skip to content

Commit 126c678

Browse files
authored
feat: on-demand validation of the CAS backend (#2462)
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
1 parent 02673e1 commit 126c678

30 files changed

+907
-205
lines changed

app/controlplane/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ migration_apply: check-atlas-tool migration_hash
3737
atlas migrate status --dir ${local_migrations_dir} --url ${local_db}
3838
atlas migrate apply --dir ${local_migrations_dir} --url ${local_db}
3939

40+
.PHONY: migration_apply_non_linear
41+
# see https://atlasgo.io/versioned/apply#non-linear-error
42+
migration_apply_non_linear: check-atlas-tool migration_hash
43+
atlas migrate status --dir ${local_migrations_dir} --url ${local_db}
44+
atlas migrate apply --dir ${local_migrations_dir} --url ${local_db} --exec-order non-linear
45+
4046
.PHONY: migration_sync
4147
# sync migration files with the current ent schema
4248
migration_sync: check-atlas-tool migration_hash

app/controlplane/api/controlplane/v1/cas_backends.pb.go

Lines changed: 203 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/controlplane/v1/cas_backends.proto

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ service CASBackendService {
2929
rpc Create(CASBackendServiceCreateRequest) returns (CASBackendServiceCreateResponse);
3030
rpc Update(CASBackendServiceUpdateRequest) returns (CASBackendServiceUpdateResponse);
3131
rpc Delete(CASBackendServiceDeleteRequest) returns (CASBackendServiceDeleteResponse);
32+
rpc Revalidate(CASBackendServiceRevalidateRequest) returns (CASBackendServiceRevalidateResponse);
3233
}
3334

3435
message CASBackendServiceListRequest {}
@@ -99,6 +100,18 @@ message CASBackendServiceDeleteRequest {
99100

100101
message CASBackendServiceDeleteResponse {}
101102

103+
message CASBackendServiceRevalidateRequest {
104+
string name = 1 [(buf.validate.field) = {
105+
cel: {
106+
message: "must contain only lowercase letters, numbers, and hyphens."
107+
expression: "this.matches('^[a-z0-9]([-a-z0-9]*[a-z0-9])?$')"
108+
id: "name.dns-1123"
109+
}
110+
}];
111+
}
112+
113+
message CASBackendServiceRevalidateResponse {}
114+
102115
enum CASBackendErrorReason {
103116
option (errors.default_code) = 500;
104117
CAS_BACKEND_ERROR_REASON_UNSPECIFIED = 0;

app/controlplane/api/controlplane/v1/cas_backends_grpc.pb.go

Lines changed: 41 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)