mirror of
https://github.com/hanzoai/cd.git
synced 2026-10-30 14:56:45 +00:00
repository.proto and 11 sibling hand-written .proto files referenced generated.proto's application/v1alpha1 types under the pre-fork package path (github.com.argoproj.argo_cd.v3...); protoc silently kept compiling because generated.proto still carried that same stale package too. Point both at the real, mechanically-derived path (github.com.hanzoai.cd.pkg.apis.application.v1alpha1, no v3 segment) and regenerate everything protoc/go-to-protobuf own: generated.proto/pb.go, every pkg/apiclient and reposerver/cmpserver/commitserver *.pb.go, assets/swagger.json, and the CRD manifests. That regeneration surfaced a second, unrelated bug: hack/gen-crd-spec stamped app.kubernetes.io/part-of: cd on the CRDs, but util/settings.isSettingsObject (and the ConfigMap informer built on it) only ever recognizes part-of=hanzocd. The same wrong "cd" value was baked into cmd/cd/commands/admin/settings.go's setSettingsMeta and the shared test/testdata.go fixtures ~30 files import — util/settings' own test suite was panicking on an empty slice because its fixture was invisible to the informer it was supposedly seeding. Fixed the label everywhere it's produced or asserted in the settings path; left the ~90 unrelated part-of:"cd" literals in other packages' local test fixtures alone since they never touch this selector. Also dropped 25 "TODO: Remove deprecated <dead upstream issue link>" comments that duplicated the real explanation already sitting one line away (a proper `Deprecated:` godoc, a cobra Deprecated field, or a nolint:staticcheck marker) — kept the explanation, dropped the link, per the standing rule for these citations. And repointed the two Grafana dashboards' job selector from argocd-server-metrics, a Service the manifests never create, to hanzocd-server-metrics, the one they do.
84 lines
2.4 KiB
Protocol Buffer
84 lines
2.4 KiB
Protocol Buffer
syntax = "proto3";
|
|
option go_package = "github.com/hanzoai/cd/pkg/apiclient/cluster";
|
|
|
|
// Cluster Service
|
|
//
|
|
// Cluster Service API performs CRUD actions against cluster resources
|
|
package cluster;
|
|
|
|
import "google/api/annotations.proto";
|
|
import "github.com/hanzoai/cd/pkg/apis/application/v1alpha1/generated.proto";
|
|
|
|
// ClusterID holds a cluster server URL or cluster name
|
|
message ClusterID {
|
|
// type is the type of the specified cluster identifier ( "server" - default, "name" )
|
|
string type = 1;
|
|
// value holds the cluster server URL or cluster name
|
|
string value = 2;
|
|
}
|
|
|
|
// ClusterQuery is a query for cluster resources
|
|
message ClusterQuery {
|
|
string server = 1;
|
|
string name = 2;
|
|
ClusterID id = 3;
|
|
}
|
|
|
|
message ClusterResponse {}
|
|
|
|
message ClusterCreateRequest {
|
|
github.com.hanzoai.cd.pkg.apis.application.v1alpha1.Cluster cluster = 1;
|
|
bool upsert = 2;
|
|
}
|
|
|
|
message ClusterUpdateRequest {
|
|
github.com.hanzoai.cd.pkg.apis.application.v1alpha1.Cluster cluster = 1;
|
|
repeated string updatedFields = 2;
|
|
ClusterID id = 3;
|
|
}
|
|
|
|
// ClusterService
|
|
service ClusterService {
|
|
|
|
// List returns list of clusters
|
|
rpc List(ClusterQuery) returns (github.com.hanzoai.cd.pkg.apis.application.v1alpha1.ClusterList) {
|
|
option (google.api.http).get = "/v1/clusters";
|
|
}
|
|
|
|
// Create creates a cluster
|
|
rpc Create(ClusterCreateRequest) returns (github.com.hanzoai.cd.pkg.apis.application.v1alpha1.Cluster) {
|
|
option (google.api.http) = {
|
|
post: "/v1/clusters"
|
|
body: "cluster"
|
|
};
|
|
}
|
|
|
|
// Get returns a cluster by server address
|
|
rpc Get(ClusterQuery) returns (github.com.hanzoai.cd.pkg.apis.application.v1alpha1.Cluster) {
|
|
option (google.api.http).get = "/v1/clusters/{id.value}";
|
|
}
|
|
|
|
// Update updates a cluster
|
|
rpc Update(ClusterUpdateRequest) returns (github.com.hanzoai.cd.pkg.apis.application.v1alpha1.Cluster) {
|
|
option (google.api.http) = {
|
|
put: "/v1/clusters/{id.value}"
|
|
body: "cluster"
|
|
};
|
|
}
|
|
|
|
// Delete deletes a cluster
|
|
rpc Delete(ClusterQuery) returns (ClusterResponse) {
|
|
option (google.api.http).delete = "/v1/clusters/{id.value}";
|
|
}
|
|
|
|
// RotateAuth rotates the bearer token used for a cluster
|
|
rpc RotateAuth(ClusterQuery) returns (ClusterResponse) {
|
|
option (google.api.http).post = "/v1/clusters/{id.value}/rotate-auth";
|
|
}
|
|
|
|
// InvalidateCache invalidates cluster cache
|
|
rpc InvalidateCache(ClusterQuery) returns (github.com.hanzoai.cd.pkg.apis.application.v1alpha1.Cluster) {
|
|
option (google.api.http).post = "/v1/clusters/{id.value}/invalidate-cache";
|
|
}
|
|
}
|