Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
ef3ba65f
Unverified
Commit
ef3ba65f
authored
Jul 31, 2023
by
felipe andrade
Committed by
GitHub
Jul 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ufm): betterer error metric label (#6535)
* fix(ufm): betterer error metric label * remove commented code
parent
e226b326
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
metrics.go
op-ufm/pkg/metrics/metrics.go
+2
-1
main.go
op-ufm/tools/kmstool/main.go
+3
-7
No files found.
op-ufm/pkg/metrics/metrics.go
View file @
ef3ba65f
...
...
@@ -94,7 +94,8 @@ func RecordError(provider string, errorLabel string) {
func
RecordErrorDetails
(
provider
string
,
label
string
,
err
error
)
{
errClean
:=
nonAlphanumericRegex
.
ReplaceAllString
(
err
.
Error
(),
""
)
errClean
=
strings
.
ReplaceAll
(
errClean
,
" "
,
"_"
)
label
=
fmt
.
Sprintf
(
"%s.%s"
,
label
)
errClean
=
strings
.
ReplaceAll
(
errClean
,
"__"
,
"_"
)
label
=
fmt
.
Sprintf
(
"%s.%s"
,
label
,
errClean
)
RecordError
(
provider
,
label
)
}
...
...
op-ufm/tools/kmstool/main.go
View file @
ef3ba65f
...
...
@@ -44,10 +44,11 @@ func resolveAddr(ctx context.Context, client *kms.KeyManagementClient, keyName s
if
err
!=
nil
{
return
common
.
Address
{},
fmt
.
Errorf
(
"google kms public key %q lookup: %w"
,
keyName
,
err
)
}
keyPem
:=
resp
.
Pem
block
,
_
:=
pem
.
Decode
([]
byte
(
resp
.
Pem
))
block
,
_
:=
pem
.
Decode
([]
byte
(
key
Pem
))
if
block
==
nil
{
return
common
.
Address
{},
fmt
.
Errorf
(
"google kms public key %q pem empty: %.130q"
,
keyName
,
resp
.
Pem
)
return
common
.
Address
{},
fmt
.
Errorf
(
"google kms public key %q pem empty: %.130q"
,
keyName
,
key
Pem
)
}
var
info
struct
{
...
...
@@ -59,11 +60,6 @@ func resolveAddr(ctx context.Context, client *kms.KeyManagementClient, keyName s
return
common
.
Address
{},
fmt
.
Errorf
(
"google kms public key %q pem block %q: %v"
,
keyName
,
block
.
Type
,
err
)
}
wantAlg
:=
asn1
.
ObjectIdentifier
{
1
,
2
,
840
,
10045
,
2
,
1
}
if
gotAlg
:=
info
.
AlgID
.
Algorithm
;
!
gotAlg
.
Equal
(
wantAlg
)
{
return
common
.
Address
{},
fmt
.
Errorf
(
"google kms public key %q asn.1 algorithm %s intead of %s"
,
keyName
,
gotAlg
,
wantAlg
)
}
return
pubKeyAddr
(
info
.
Key
.
Bytes
),
nil
}
...
...
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