Skip to content

Commit

Permalink
Merge pull request #141 from kloudlite/release-v1.0.2
Browse files Browse the repository at this point in the history
Release v1.0.2
  • Loading branch information
nxtcoder17 authored Feb 14, 2024
2 parents 7e4eb4e + fd3ddb5 commit eec6356
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 8 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/delete-images-from-ghcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Delete Container Images from github container registry

on:
workflow_dispatch:
inputs:
image_tag_to_delete:
type: string
description: "image tag to delete"
required: true
default: "v0.0.0"

permissions:
contents: read
packages: write

jobs:
docker-builds:
strategy:
matrix:
app:
- platform
- agent
- wireguard
- helm-charts

name: Delete image from ghcr.io
runs-on: ubuntu-latest
steps:
- name: Delete image
uses: bots-house/[email protected]
with:
owner: ${{ github.repository_owner }}
name: ${{ github.event.repository.name }}/${{ matrix.app }}

token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.inputs.image_tag_to_delete }}
6 changes: 4 additions & 2 deletions operators/msvc-n-mres/internal/cluster-msvc/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cluster_msvc
import (
"context"
"fmt"
"time"

crdsv1 "github.com/kloudlite/operator/apis/crds/v1"
"github.com/kloudlite/operator/operators/msvc-n-mres/internal/env"
Expand Down Expand Up @@ -195,7 +196,7 @@ func (r *Reconciler) ensureMsvcCreatedNReady(req *rApi.Request[*crdsv1.ClusterMa

return nil
}); err != nil {
return failed(err)
return failed(err).RequeueAfter(1 * time.Second)
}

req.AddToOwnedResources(rApi.ParseResourceRef(msvc))
Expand All @@ -216,8 +217,9 @@ func (r *Reconciler) ensureMsvcCreatedNReady(req *rApi.Request[*crdsv1.ClusterMa
return failed(err)
}
if err := r.Update(ctx, obj); err != nil {
return failed(err)
return failed(err).RequeueAfter(1 * time.Second)
}
return req.Done()
}

if !msvc.Status.IsReady {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"strings"
"time"

crdsv1 "github.com/kloudlite/operator/apis/crds/v1"
"github.com/kloudlite/operator/operators/msvc-n-mres/internal/env"
Expand Down Expand Up @@ -195,14 +196,11 @@ func (r *Reconciler) ensureMsvcCreatedNReady(req *rApi.Request[*crdsv1.ProjectMa
for k, v := range m {
fn.MapSet(&msvc.Annotations, k, v)
}
labels := obj.GetLabels()
fn.MapSet(&labels, constants.ProjectManagedServiceRefKey, fmt.Sprintf("%s_%s", obj.Namespace, obj.Name))

msvc.SetLabels(labels)
fn.MapSet(&msvc.Labels, constants.ProjectManagedServiceRefKey, fmt.Sprintf("%s_%s", obj.Namespace, obj.Name))
msvc.Spec = obj.Spec.MSVCSpec
return nil
}); err != nil {
return failed(err)
return failed(err).RequeueAfter(1 * time.Second)
}

req.AddToOwnedResources(rApi.ParseResourceRef(msvc))
Expand All @@ -223,8 +221,9 @@ func (r *Reconciler) ensureMsvcCreatedNReady(req *rApi.Request[*crdsv1.ProjectMa
return failed(err)
}
if err := r.Update(ctx, obj); err != nil {
return failed(err)
return failed(err).RequeueAfter(1 * time.Second)
}
return req.Done()
}

if !msvc.Status.IsReady {
Expand Down

0 comments on commit eec6356

Please sign in to comment.