Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
postgres-operator
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
zalando
postgres-operator
Commits
4bf9cb9f
Commit
4bf9cb9f
authored
7 years ago
by
Oleksii Kliukin
Browse files
Options
Downloads
Patches
Plain Diff
Fix extra quotes in unmarshaling of the NamespacedName object
parent
144c0869
Branches
experiment/crd_configuration
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/spec/types.go
+9
-5
9 additions, 5 deletions
pkg/spec/types.go
with
9 additions
and
5 deletions
pkg/spec/types.go
+
9
−
5
View file @
4bf9cb9f
...
@@ -2,6 +2,7 @@ package spec
...
@@ -2,6 +2,7 @@ package spec
import
(
import
(
"database/sql"
"database/sql"
"encoding/json"
"fmt"
"fmt"
"io/ioutil"
"io/ioutil"
"log"
"log"
...
@@ -15,7 +16,6 @@ import (
...
@@ -15,7 +16,6 @@ import (
"k8s.io/client-go/pkg/apis/apps/v1beta1"
"k8s.io/client-go/pkg/apis/apps/v1beta1"
policyv1beta1
"k8s.io/client-go/pkg/apis/policy/v1beta1"
policyv1beta1
"k8s.io/client-go/pkg/apis/policy/v1beta1"
"k8s.io/client-go/rest"
"k8s.io/client-go/rest"
"encoding/json"
)
)
// EventType contains type of the events for the TPRs and Pods received from Kubernetes
// EventType contains type of the events for the TPRs and Pods received from Kubernetes
...
@@ -190,7 +190,11 @@ func (n *NamespacedName) Decode(value string) error {
...
@@ -190,7 +190,11 @@ func (n *NamespacedName) Decode(value string) error {
func
(
n
*
NamespacedName
)
UnmarshalJSON
(
data
[]
byte
)
error
{
func
(
n
*
NamespacedName
)
UnmarshalJSON
(
data
[]
byte
)
error
{
result
:=
NamespacedName
{}
result
:=
NamespacedName
{}
if
err
:=
result
.
Decode
(
string
(
data
));
err
!=
nil
{
var
tmp
string
if
err
:=
json
.
Unmarshal
(
data
,
&
tmp
);
err
!=
nil
{
return
err
}
if
err
:=
result
.
Decode
(
tmp
);
err
!=
nil
{
return
err
return
err
}
}
*
n
=
result
*
n
=
result
...
@@ -260,7 +264,7 @@ func (d *Duration) UnmarshalJSON(b []byte) error {
...
@@ -260,7 +264,7 @@ func (d *Duration) UnmarshalJSON(b []byte) error {
}
}
switch
val
:=
v
.
(
type
)
{
switch
val
:=
v
.
(
type
)
{
case
string
:
case
string
:
t
,
err
:=
time
.
ParseDuration
(
val
)
;
t
,
err
:=
time
.
ParseDuration
(
val
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment