mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-22 01:17:16 +00:00
19 lines
719 B
Go
19 lines
719 B
Go
package v1alpha1
|
|
|
|
// objectMeta and corresponding GetMetadata() methods is a hack to allow us to use grpc-gateway
|
|
// side-by-side with k8s protobuf codegen. The grpc-gateway generated .gw.pb.go files expect a
|
|
// GetMetadata() method to be generated because it assumes the .proto files were generated from
|
|
// protoc --go_out=plugins=grpc. Instead, kubernetes uses go-to-protobuf to generate .proto files
|
|
// from go types, and this method is not auto-generated (presumably since ObjectMeta is embedded but
|
|
// is nested in the 'metadata' field in JSON form).
|
|
type objectMeta struct {
|
|
Name *string
|
|
}
|
|
|
|
func (a *Application) GetMetadata() *objectMeta {
|
|
var om objectMeta
|
|
if a != nil {
|
|
om.Name = &a.Name
|
|
}
|
|
return &om
|
|
}
|