Skip to content

Commit

Permalink
Fix check if ImagePuller API is installed
Browse files Browse the repository at this point in the history
  • Loading branch information
sleshchenko committed Mar 9, 2021
1 parent bd60ac5 commit 11ef783
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/deploy/kubernetes_image_puller.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,22 +257,24 @@ func SubscriptionsAreEqual(expected *operatorsv1alpha1.Subscription, actual *ope
// foundKubernetesImagePullerAPI - true if the server discovers the che.eclipse.org API
// error - any error returned by the call to discoveryClient.ServerGroups()
func CheckNeededImagePullerApis(ctx *DeployContext) (bool, bool, bool, error) {
groupList, err := ctx.ClusterAPI.DiscoveryClient.ServerGroups()
groupList, resourcesList, err := ctx.ClusterAPI.DiscoveryClient.ServerGroupsAndResources()
if err != nil {
return false, false, false, err
}
groups := groupList.Groups
foundPackagesAPI := false
foundOperatorsAPI := false
foundKubernetesImagePullerAPI := false
for _, group := range groups {
for _, group := range groupList {
if group.Name == packagesv1.SchemeGroupVersion.Group {
foundPackagesAPI = true
}
if group.Name == operatorsv1alpha1.SchemeGroupVersion.Group {
foundOperatorsAPI = true
}
if group.Name == chev1alpha1.SchemeGroupVersion.Group {
}

for _, r := range resourcesList {
if r.Kind == "KubernetesImagePuller" {
foundKubernetesImagePullerAPI = true
}
}
Expand Down

0 comments on commit 11ef783

Please sign in to comment.