Skip to content

Commit

Permalink
Workaround for job name too long
Browse files Browse the repository at this point in the history
Signed-off-by: dm4 <[email protected]>
  • Loading branch information
dm4 committed May 23, 2023
1 parent 4592ae0 commit 82c0c41
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Docker Image CI

on:
push:
branches: [ main ]
branches: [ '*' ]
tags: [ '*' ]
pull_request:
branches: [ main ]
branches: [ '*' ]

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
version: v3.10.0
-
name: Run chart-releaser
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/release'
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
2 changes: 1 addition & 1 deletion charts/kwasm-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
replicaCount: 1

image:
repository: ghcr.io/kwasm/kwasm-operator
repository: ghcr.io/second-state/kwasm-operator
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: kwasm-operator-0.2.1
Expand Down
4 changes: 2 additions & 2 deletions controllers/provisioner_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (r *ProvisionerReconciler) Reconcile(ctx context.Context, req ctrl.Request)

err := r.Delete(ctx, &batchv1.Job{
ObjectMeta: metav1.ObjectMeta{
Name: req.Name + "-provision-kwasm",
Name: req.Name + "-pk",
Namespace: os.Getenv("CONTROLLER_NAMESPACE"),
},
}, client.PropagationPolicy(metav1.DeletePropagationBackground))
Expand Down Expand Up @@ -142,7 +142,7 @@ func (r *ProvisionerReconciler) deployJob(n *corev1.Node, req ctrl.Request) *bat

dep := &batchv1.Job{
ObjectMeta: metav1.ObjectMeta{
Name: req.Name + "-provision-kwasm",
Name: req.Name + "-pk",
Namespace: os.Getenv("CONTROLLER_NAMESPACE"),
Labels: map[string]string{"kwasm.sh/job": "true"},
},
Expand Down
6 changes: 3 additions & 3 deletions controllers/provisioner_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var _ = Describe("ProvisionerController", func() {

// Check that the job was created.
job = &batchv1.Job{}
err = k8sClient.Get(ctx, types.NamespacedName{Name: nodeName + "-provision-kwasm", Namespace: namespaceName}, job)
err = k8sClient.Get(ctx, types.NamespacedName{Name: nodeName + "-pk", Namespace: namespaceName}, job)
Expect(err).NotTo(HaveOccurred())
Expect(job).NotTo(BeNil())

Expand Down Expand Up @@ -109,7 +109,7 @@ var _ = Describe("ProvisionerController", func() {

// Check that the job was created.
job = &batchv1.Job{}
err = k8sClient.Get(ctx, types.NamespacedName{Name: nodeName + "-provision-kwasm", Namespace: namespaceName}, job)
err = k8sClient.Get(ctx, types.NamespacedName{Name: nodeName + "-pk", Namespace: namespaceName}, job)
Expect(err).To(HaveOccurred())

})
Expand All @@ -135,7 +135,7 @@ var _ = Describe("ProvisionerController", func() {
})
// Check that the job was created.
job = &batchv1.Job{}
err = k8sClient.Get(ctx, types.NamespacedName{Name: nodeName + "-provision-kwasm", Namespace: namespaceName}, job)
err = k8sClient.Get(ctx, types.NamespacedName{Name: nodeName + "-pk", Namespace: namespaceName}, job)
Expect(err).NotTo(HaveOccurred())
})
})
Expand Down

0 comments on commit 82c0c41

Please sign in to comment.