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

clusterctl list images should include daemonsets #4382

Closed
dkoshkin opened this issue Mar 25, 2021 · 6 comments · Fixed by #4455
Closed

clusterctl list images should include daemonsets #4382

dkoshkin opened this issue Mar 25, 2021 · 6 comments · Fixed by #4455
Assignees
Labels
area/clusterctl Issues or PRs related to clusterctl good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Milestone

Comments

@dkoshkin
Copy link
Contributor

What steps did you take and what happened:
[A clear and concise description on how to REPRODUCE the bug.]

$ clusterctl init --infrastructure azure:v0.4.12 --list-images
gcr.io/kubebuilder/kube-rbac-proxy:v0.4.1
gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
quay.io/jetstack/cert-manager-cainjector:v0.16.1
quay.io/jetstack/cert-manager-controller:v0.16.1
quay.io/jetstack/cert-manager-webhook:v0.16.1
us.gcr.io/k8s-artifacts-prod/cluster-api-azure/cluster-api-azure-controller:v0.4.12
us.gcr.io/k8s-artifacts-prod/cluster-api/cluster-api-controller:v0.3.14
us.gcr.io/k8s-artifacts-prod/cluster-api/kubeadm-bootstrap-controller:v0.3.14
us.gcr.io/k8s-artifacts-prod/cluster-api/kubeadm-control-plane-controller:v0.3.14

What did you expect to happen:
The image mcr.microsoft.com/oss/azure/aad-pod-identity/nmi:v1.6.3 should also be present.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Let me know if https://github.com/kubernetes-sigs/cluster-api-provider-azure is a better place to open this issue.
Im new to the codebase but couldn't find how the list of images is populated.

Environment:

$ clusterctl version
clusterctl version: &version.Info{Major:"0", Minor:"3", GitVersion:"v0.3.14", GitCommit:"5a09f69fa8c4892eb45a61d8d701140eeeaa5ba8", GitTreeState:"clean", BuildDate:"2021-02-06T03:08:57Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"darwin/amd64"}

/kind bug
[One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels]

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 25, 2021
@devigned
Copy link
Contributor

Hmm... nmi is a daemonset. I wonder if that is why it was missed.

@fabriziopandini
Copy link
Member

@devigned you are right

// InspectImages identifies the container images required to install the objects defined in the objs.
// NB. The implemented approach is specific for the provider components YAML & for the cert-manager manifest; it is not
// intended to cover all the possible objects used to deploy containers existing in Kubernetes.
func InspectImages(objs []unstructured.Unstructured) ([]string, error) {
images := []string{}
for i := range objs {
o := objs[i]
if o.GetKind() == deploymentKind {
d := &appsv1.Deployment{}
if err := scheme.Scheme.Convert(&o, d, nil); err != nil {
return nil, err
}
for _, c := range d.Spec.Template.Spec.Containers {
images = append(images, c.Image)
}
for _, c := range d.Spec.Template.Spec.InitContainers {
images = append(images, c.Image)
}
}
}
return images, nil
}

We should probably extend this logic to consider daemonset as well

/milestone v0.4
/priority important-longterm
/help
/good-first-issue

@k8s-ci-robot
Copy link
Contributor

@fabriziopandini:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

@devigned you are right

// InspectImages identifies the container images required to install the objects defined in the objs.
// NB. The implemented approach is specific for the provider components YAML & for the cert-manager manifest; it is not
// intended to cover all the possible objects used to deploy containers existing in Kubernetes.
func InspectImages(objs []unstructured.Unstructured) ([]string, error) {
images := []string{}
for i := range objs {
o := objs[i]
if o.GetKind() == deploymentKind {
d := &appsv1.Deployment{}
if err := scheme.Scheme.Convert(&o, d, nil); err != nil {
return nil, err
}
for _, c := range d.Spec.Template.Spec.Containers {
images = append(images, c.Image)
}
for _, c := range d.Spec.Template.Spec.InitContainers {
images = append(images, c.Image)
}
}
}
return images, nil
}

We should probably extend this logic to consider daemonset as well

/milestone v0.4
/priority important-longterm
/help
/good-first-issue

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added this to the v0.4 milestone Mar 26, 2021
@k8s-ci-robot k8s-ci-robot added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Mar 26, 2021
@ludusrusso
Copy link
Contributor

/assign

@fabriziopandini
Copy link
Member

/lifecycle active

@k8s-ci-robot k8s-ci-robot added the lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. label Mar 26, 2021
@CecileRobertMichon
Copy link
Contributor

/retitle clusterctl list images should include daemonsets
/area clusterctl

@k8s-ci-robot k8s-ci-robot changed the title clusterctl init --infrastructure azure:v0.4.12 --list-images missing aad-pod-identity clusterctl list images should include daemonsets Apr 5, 2021
@k8s-ci-robot k8s-ci-robot added the area/clusterctl Issues or PRs related to clusterctl label Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/clusterctl Issues or PRs related to clusterctl good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants