-
Notifications
You must be signed in to change notification settings - Fork 266
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
feat: return images from resources when sync occurs #642
base: master
Are you sure you want to change the base?
feat: return images from resources when sync occurs #642
Conversation
Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>
922aecd
to
3f1734a
Compare
Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a test to when there are no images, please?
Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>
5281e57
to
ae4000b
Compare
Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>
pkg/utils/kube/kube.go
Outdated
for _, container := range containers { | ||
containerMap, ok := container.(map[string]interface{}) | ||
if !ok { | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we continue
instead of returning here? It might be something related to the single container only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to extract as much data as possible. Added continue
on 5b2c46f but maybe @andrii-korotkov-verkada has a different take
@@ -404,6 +404,34 @@ func GetDeploymentReplicas(u *unstructured.Unstructured) *int64 { | |||
return &val | |||
} | |||
|
|||
func GetResourceImages(u *unstructured.Unstructured) []string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For CronJobs it seems that the image is under spec.jobTemplate.spec.template.spec.containers
. Should we also check there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 6b9063a
…for cronjobs Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>
Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>
Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>
Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>
Quality Gate passedIssues Measures |
Implementing the Gitops side of this issue: argoproj/argo-cd#20896
Adds an api to
kube.go
to get the images from a resource. Adds those images toResourceSyncResult