Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Jandow <[email protected]>
  • Loading branch information
Mtze and robertjndw authored Aug 14, 2024
1 parent 9bbaead commit fcec8ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions HadesScheduler/k8s/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ func (k8sJob K8sJob) execute(ctx context.Context) error {
configMap := k8sJob.configMapSpec()
slog.Debug("ConfigMap spec", "config_map", configMap)

slog.Debug("Apply buildscirpt ConfigMap to Kubernetes")
slog.Debug("Apply buildscript ConfigMap to Kubernetes")
cm, err := k8sJob.k8sClient.CoreV1().ConfigMaps(k8sJob.namespace).Create(ctx, configMap, metav1.CreateOptions{})
if err != nil {
slog.With("error", err).Error("Failed to create ConfigMap")
return err
}
slog.Info("Successfully created buildscirpt ConfigMap", "name", cm.Name)
slog.Debug("Successfully created buildscript ConfigMap", "name", cm.Name)

slog.Debug("Assembling PodSpec")
jobPodSpec := corev1.Pod{
Expand Down
4 changes: 2 additions & 2 deletions HadesScheduler/k8s/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func createNamespace(ctx context.Context, clientset *kubernetes.Clientset, namespace string) (*corev1.Namespace, error) {
// Create a namespace in the Kubernetes cluster
slog.Info("Creating namespace", "namespace", namespace)
slog.Debug("Creating namespace", "namespace", namespace)

ns, err := clientset.CoreV1().Namespaces().Create(
ctx,
Expand All @@ -33,7 +33,7 @@ func createNamespace(ctx context.Context, clientset *kubernetes.Clientset, names

func deleteNamespace(ctx context.Context, clientset *kubernetes.Clientset, namespace string) error {
// Delete a namespace in the Kubernetes cluster
slog.Info("Deleting namespace", "namespace", namespace)
slog.Debug("Deleting namespace", "namespace", namespace)

err := clientset.CoreV1().Namespaces().Delete(ctx, namespace, v1.DeleteOptions{})
if err != nil {
Expand Down

0 comments on commit fcec8ac

Please sign in to comment.