Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nmaas Platform
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nmaas
nmaas Platform
Commits
ec26dde2
Commit
ec26dde2
authored
1 year ago
by
Łukasz Łopatowski
Browse files
Options
Downloads
Patches
Plain Diff
Performing Helm repo update on application startup
parent
d3a619a6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/geant/nmaas/nmservice/deployment/containerorchestrators/kubernetes/HelmRepoUpdateScheduleConfig.java
+12
-1
12 additions, 1 deletion
...rchestrators/kubernetes/HelmRepoUpdateScheduleConfig.java
with
12 additions
and
1 deletion
src/main/java/net/geant/nmaas/nmservice/deployment/containerorchestrators/kubernetes/HelmRepoUpdateScheduleConfig.java
+
12
−
1
View file @
ec26dde2
...
@@ -2,7 +2,9 @@ package net.geant.nmaas.nmservice.deployment.containerorchestrators.kubernetes;
...
@@ -2,7 +2,9 @@ package net.geant.nmaas.nmservice.deployment.containerorchestrators.kubernetes;
import
com.google.common.base.Strings
;
import
com.google.common.base.Strings
;
import
lombok.extern.log4j.Log4j2
;
import
lombok.extern.log4j.Log4j2
;
import
net.geant.nmaas.nmservice.deployment.containerorchestrators.kubernetes.components.helm.HelmKServiceManager
;
import
net.geant.nmaas.scheduling.ScheduleManager
;
import
net.geant.nmaas.scheduling.ScheduleManager
;
import
net.geant.nmaas.utils.ssh.CommandExecutionException
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -20,6 +22,9 @@ public class HelmRepoUpdateScheduleConfig {
...
@@ -20,6 +22,9 @@ public class HelmRepoUpdateScheduleConfig {
public
InitializingBean
insertDefaultHelmRepoUpdateJob
()
{
public
InitializingBean
insertDefaultHelmRepoUpdateJob
()
{
return
new
InitializingBean
()
{
return
new
InitializingBean
()
{
@Autowired
private
HelmKServiceManager
helmKServiceManager
;
@Autowired
@Autowired
private
HelmRepoUpdateJob
helmRepoUpdateJob
;
private
HelmRepoUpdateJob
helmRepoUpdateJob
;
...
@@ -39,7 +44,13 @@ public class HelmRepoUpdateScheduleConfig {
...
@@ -39,7 +44,13 @@ public class HelmRepoUpdateScheduleConfig {
if
(
Strings
.
isNullOrEmpty
(
helmRepoUpdateAsyncCron
))
{
if
(
Strings
.
isNullOrEmpty
(
helmRepoUpdateAsyncCron
))
{
log
.
warn
(
"Asynchronous Helm repo update cron expression not provided."
);
log
.
warn
(
"Asynchronous Helm repo update cron expression not provided."
);
}
else
{
}
else
{
this
.
scheduleManager
.
createJob
(
helmRepoUpdateJob
,
HELM_REPO_UPDATE_JOB_NAME
,
helmRepoUpdateAsyncCron
);
scheduleManager
.
createJob
(
helmRepoUpdateJob
,
HELM_REPO_UPDATE_JOB_NAME
,
helmRepoUpdateAsyncCron
);
// execute helm repo update right away
try
{
helmKServiceManager
.
updateHelmRepo
();
}
catch
(
CommandExecutionException
e
)
{
log
.
warn
(
"Wasn't able to execute Helm repo update on startup"
,
e
);
}
}
}
}
else
{
}
else
{
log
.
warn
(
"Asynchronous Helm repo update is disabled."
);
log
.
warn
(
"Asynchronous Helm repo update is disabled."
);
...
...
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