try sonarqube
Signed-off-by: Frank Villaro-Dixon <frank.villarodixon@merkle.com>
This commit is contained in:
parent
11c8053422
commit
9070fadde1
3 changed files with 29 additions and 5 deletions
17
.gitlab-ci.yml
Normal file
17
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,17 @@
|
|||
sonarqube-check:
|
||||
image:
|
||||
name: sonarsource/sonar-scanner-cli:latest
|
||||
entrypoint: [""]
|
||||
variables:
|
||||
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
|
||||
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
|
||||
cache:
|
||||
key: "${CI_JOB_NAME}"
|
||||
paths:
|
||||
- .sonar/cache
|
||||
script:
|
||||
- sonar-scanner
|
||||
allow_failure: true
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == 'main'
|
||||
|
|
@ -54,6 +54,7 @@ var (
|
|||
wolImage = "registry.k3s.fr/k8s/docker-wakeonlan-image/main:latest"
|
||||
shutdownImage = "registry.k3s.fr/k8s/docker-ubuntu-systemd/main:latest"
|
||||
namespace = "default"
|
||||
podShutdownCmd = "systemctl poweroff"
|
||||
)
|
||||
|
||||
func (r *AnesthesiaNodeReconciler) getV1Node(an *anesthesiav1alpha1.AnesthesiaNode) (*corev1.Node, error) {
|
||||
|
@ -160,7 +161,7 @@ func shutdownPod(shutdownNode *anesthesiav1alpha1.AnesthesiaNode) *corev1.Pod {
|
|||
{
|
||||
Image: shutdownImage,
|
||||
Name: "shutdown",
|
||||
Command: []string{"sh", "-c", "systemctl poweroff"},
|
||||
Command: []string{"sh", "-c", podShutdownCmd},
|
||||
Env: []corev1.EnvVar{
|
||||
{
|
||||
Name: "SYSTEMD_IGNORE_CHROOT",
|
||||
|
@ -421,13 +422,14 @@ func (r *AnesthesiaNodeReconciler) Reconcile(ctx context.Context, req ctrl.Reque
|
|||
nodeAlive := isNodeAlive(renewTime)
|
||||
|
||||
var newActualState string
|
||||
requeue := 0 * time.Second
|
||||
requeue := 1 * time.Minute // Periodically watch the nodes/their state v.s. what we want
|
||||
|
||||
if node.Spec.State == "on" && nodeAlive { // FIXME
|
||||
newActualState = "running"
|
||||
err = r.removeOldJobs(&node)
|
||||
if err != nil {
|
||||
log.Error(err, "Couldn't remove old jobs")
|
||||
return ctrl.Result{}, err
|
||||
return ctrl.Result{RequeueAfter: requeue}, err
|
||||
}
|
||||
|
||||
} else if node.Spec.State == "on" && !nodeAlive { // FIXME
|
||||
|
@ -436,11 +438,13 @@ func (r *AnesthesiaNodeReconciler) Reconcile(ctx context.Context, req ctrl.Reque
|
|||
runningJobs, err := r.areRunningWakeupJobs(&node)
|
||||
if err != nil {
|
||||
log.Error(err, "Could not get running wakeup jobs")
|
||||
return ctrl.Result{}, err
|
||||
return ctrl.Result{RequeueAfter: requeue}, err
|
||||
}
|
||||
if runningJobs {
|
||||
log.Info("Wakeup job still running")
|
||||
return ctrl.Result{RequeueAfter: time.Minute}, nil
|
||||
// XXX we should make sure that the wakeupJob is recent,
|
||||
// if not, we should recreate it (i.e. continue on)
|
||||
return ctrl.Result{RequeueAfter: time.Minute}, nil // give it time to boot
|
||||
}
|
||||
|
||||
l2Nodes, err := r.findNodesOnSameL2(v1node)
|
||||
|
|
3
sonar-project.properties
Normal file
3
sonar-project.properties
Normal file
|
@ -0,0 +1,3 @@
|
|||
sonar.projectKey=kube-anesthesia
|
||||
sonar.qualitygate.wait=true
|
||||
|
Loading…
Reference in a new issue