Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.0.2 #141

Merged
merged 3 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (llm): Using an external action (bots-house/[email protected]) for deleting images introduces a dependency on third-party code. Ensure that this action is from a trusted source and consider its maintenance and security posture.

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)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (llm): Introducing a requeue with a fixed delay upon failure is a good resilience pattern. However, consider if a backoff strategy might be more appropriate to avoid potential rapid retry loops under certain failure conditions.

}

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
Loading