Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CSAN
Csan
Commits
d97be712
Commit
d97be712
authored
May 29, 2020
by
He Weiwei
Browse files
refactor(configuration): cleanup unneeded CLAIR_URL configuration in core
Signed-off-by:
He Weiwei
<
hweiwei@vmware.com
>
parent
9f5f8e46
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
10 deletions
+0
-10
make/photon/prepare/templates/core/env.jinja
make/photon/prepare/templates/core/env.jinja
+0
-1
src/common/config/manager_test.go
src/common/config/manager_test.go
+0
-2
src/common/config/metadata/metadatalist.go
src/common/config/metadata/metadatalist.go
+0
-1
src/common/const.go
src/common/const.go
+0
-1
src/core/config/config.go
src/core/config/config.go
+0
-5
No files found.
make/photon/prepare/templates/core/env.jinja
View file @
d97be712
...
...
@@ -35,7 +35,6 @@ CLAIR_DB_SSLMODE={{clair_db_sslmode}}
CORE_URL={{core_url}}
CORE_LOCAL_URL={{core_local_url}}
JOBSERVICE_URL={{jobservice_url}}
CLAIR_URL={{clair_url}}
CLAIR_ADAPTER_URL={{clair_adapter_url}}
TRIVY_ADAPTER_URL={{trivy_adapter_url}}
NOTARY_URL={{notary_url}}
...
...
src/common/config/manager_test.go
View file @
d97be712
...
...
@@ -16,7 +16,6 @@ var TestDBConfig = map[string]interface{}{
"postgresql_username"
:
"postgres"
,
"postgresql_sslmode"
:
"disable"
,
"email_host"
:
"127.0.0.1"
,
"clair_url"
:
"http://clair:6060"
,
"scan_all_policy"
:
`{"parameter":{"daily_time":0},"type":"daily"}`
,
}
...
...
@@ -33,7 +32,6 @@ func TestLoadFromDatabase(t *testing.T) {
configManager
.
UpdateConfig
(
TestDBConfig
)
configManager
.
Load
()
assert
.
Equal
(
t
,
"127.0.0.1"
,
configManager
.
Get
(
"email_host"
)
.
GetString
())
assert
.
Equal
(
t
,
"http://clair:6060"
,
configManager
.
Get
(
"clair_url"
)
.
GetString
())
assert
.
Equal
(
t
,
`{"parameter":{"daily_time":0},"type":"daily"}`
,
configManager
.
Get
(
"scan_all_policy"
)
.
GetString
())
}
...
...
src/common/config/metadata/metadatalist.go
View file @
d97be712
...
...
@@ -71,7 +71,6 @@ var (
{
Name
:
common
.
ClairDBPort
,
Scope
:
SystemScope
,
Group
:
ClairGroup
,
EnvKey
:
"CLAIR_DB_PORT"
,
DefaultValue
:
"5432"
,
ItemType
:
&
PortType
{},
Editable
:
false
},
{
Name
:
common
.
ClairDBSSLMode
,
Scope
:
SystemScope
,
Group
:
ClairGroup
,
EnvKey
:
"CLAIR_DB_SSLMODE"
,
DefaultValue
:
"disable"
,
ItemType
:
&
StringType
{},
Editable
:
false
},
{
Name
:
common
.
ClairDBUsername
,
Scope
:
SystemScope
,
Group
:
ClairGroup
,
EnvKey
:
"CLAIR_DB_USERNAME"
,
DefaultValue
:
"postgres"
,
ItemType
:
&
StringType
{},
Editable
:
false
},
{
Name
:
common
.
ClairURL
,
Scope
:
SystemScope
,
Group
:
ClairGroup
,
EnvKey
:
"CLAIR_URL"
,
DefaultValue
:
"http://clair:6060"
,
ItemType
:
&
StringType
{},
Editable
:
false
},
{
Name
:
common
.
ClairAdapterURL
,
Scope
:
SystemScope
,
Group
:
ClairGroup
,
EnvKey
:
"CLAIR_ADAPTER_URL"
,
DefaultValue
:
"http://clair-adapter:8080"
,
ItemType
:
&
StringType
{},
Editable
:
false
},
{
Name
:
common
.
TrivyAdapterURL
,
Scope
:
SystemScope
,
Group
:
ClairGroup
,
EnvKey
:
"TRIVY_ADAPTER_URL"
,
DefaultValue
:
"http://trivy-adapter:8080"
,
ItemType
:
&
StringType
{},
Editable
:
false
},
...
...
src/common/const.go
View file @
d97be712
...
...
@@ -122,7 +122,6 @@ const (
UserMember
=
"u"
GroupMember
=
"g"
ReadOnly
=
"read_only"
ClairURL
=
"clair_url"
ClairAdapterURL
=
"clair_adapter_url"
TrivyAdapterURL
=
"trivy_adapter_url"
NotaryURL
=
"notary_url"
...
...
src/core/config/config.go
View file @
d97be712
...
...
@@ -330,11 +330,6 @@ func WithClair() bool {
return
cfgMgr
.
Get
(
common
.
WithClair
)
.
GetBool
()
}
// ClairEndpoint returns the end point of clair instance, by default it's the one deployed within Harbor.
func
ClairEndpoint
()
string
{
return
cfgMgr
.
Get
(
common
.
ClairURL
)
.
GetString
()
}
// ClairDB return Clair db info
func
ClairDB
()
(
*
models
.
PostGreSQL
,
error
)
{
clairDB
:=
&
models
.
PostGreSQL
{
...
...
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