Skip to content

Updated shepherd.go#12

Merged
jontyms merged 3 commits into
HackUCF:mainfrom
JayF-cs:main
May 19, 2026
Merged

Updated shepherd.go#12
jontyms merged 3 commits into
HackUCF:mainfrom
JayF-cs:main

Conversation

@JayF-cs
Copy link
Copy Markdown
Contributor

@JayF-cs JayF-cs commented May 19, 2026

Made it so it hides all old images instead of just the most recent

Made it so it hides all old images instead of just the most recent
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the image “shepherd” workflow so that after a successful upload it renames/hides all previously-matching (non-hidden) images, rather than only the most recently matched one.

Changes:

  • Collect all matching existing images into a slice for later processing.
  • After upload, iterate over all matched images and call RenameHideByID for each.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/shepherd/shepherd.go

// Find current "latest" image matching either properties or name (non-hidden)
var current *images.Image
var allImages []*images.Image
Comment thread pkg/shepherd/shepherd.go
Comment on lines 113 to +156
@@ -147,12 +151,14 @@ func Run(c *gophercloud.ServiceClient, imagesCfg []image.Image) {
}
} else {
zap.S().Infow("Upload complete", "name", imgCfg.Name)
if current != nil {
zap.S().Infow("Renaming/hiding previous image", "previous_id", current.ID, "previous_name", current.Name)
if err := image.RenameHideByID(c, current.ID); err != nil {
zap.S().Errorw("Failed to rename/hide previous image", "id", current.ID, "error", err)
} else {
zap.S().Infow("Previous image renamed/hidden", "id", current.ID)
if len(allImages) > 0{
for _, old := range allImages{
zap.S().Infow("Renaming/hiding previous image", "previous_id", old.ID, "previous_name", old.Name)
@jontyms jontyms merged commit c81a199 into HackUCF:main May 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants