Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Kubernetes namespaces as tags
Browse files Browse the repository at this point in the history
AlexGustafsson committed Jan 12, 2025
1 parent 46a9241 commit 5f352f6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions internal/worker/worker.go
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ import (
"github.com/AlexGustafsson/cupdate/internal/httputil"
"github.com/AlexGustafsson/cupdate/internal/models"
"github.com/AlexGustafsson/cupdate/internal/oci"
"github.com/AlexGustafsson/cupdate/internal/platform/kubernetes"
"github.com/AlexGustafsson/cupdate/internal/semver"
"github.com/AlexGustafsson/cupdate/internal/store"
"github.com/AlexGustafsson/cupdate/internal/workflow/imageworkflow"
@@ -130,6 +131,18 @@ func (w *Worker) ProcessRawImage(ctx context.Context, reference oci.Reference) e
}
}

// Add Kubernetes namespace and Docker stack tags
for _, node := range image.Graph.Nodes {
switch node.Domain {
case "kubernetes":
if node.Type == kubernetes.ResourceKindCoreV1Namespace {
data.InsertTag(node.Name)
}
case "docker":
// Not implemented
}
}

result := models.Image{
Reference: data.ImageReference.String(),
Created: data.Created,

0 comments on commit 5f352f6

Please sign in to comment.