Skip to content

Commit 349c93a

Browse files
committed
REMOVE unnecessary code indentation and capitalized error msg
Signed-off-by: acmenezes <[email protected]>
1 parent 63dceab commit 349c93a

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

internal/operator/subscription.go

+24-20
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,30 @@ func (c operatorClient) GetSubscriptionData(catalogSource string, catalogSourceN
3636
SubscriptionList := []SubscriptionData{}
3737

3838
for _, pkgm := range packageManifests.Items {
39-
if pkgm.Status.CatalogSource == catalogSource {
40-
for _, pkgch := range pkgm.Status.Channels {
41-
if pkgch.IsDefaultChannel(pkgm) {
42-
for _, installMode := range pkgch.CurrentCSVDesc.InstallModes {
43-
if installMode.Supported {
44-
s := SubscriptionData{
45-
Name: strings.Join([]string{pkgch.Name, pkgm.Name, "subscription"}, "-"),
46-
Channel: pkgch.Name,
47-
CatalogSource: catalogSource,
48-
CatalogSourceNamespace: catalogSourceNamespace,
49-
Package: pkgm.Name,
50-
InstallModeType: installMode.Type,
51-
InstallPlanApproval: operatorv1alpha1.ApprovalAutomatic,
52-
}
53-
54-
SubscriptionList = append(SubscriptionList, s)
55-
break
56-
}
57-
}
39+
if pkgm.Status.CatalogSource != catalogSource {
40+
continue
41+
}
42+
for _, pkgch := range pkgm.Status.Channels {
43+
if !pkgch.IsDefaultChannel(pkgm) {
44+
continue
45+
}
46+
for _, installMode := range pkgch.CurrentCSVDesc.InstallModes {
47+
if !installMode.Supported {
48+
continue
5849
}
50+
51+
s := SubscriptionData{
52+
Name: strings.Join([]string{pkgch.Name, pkgm.Name, "subscription"}, "-"),
53+
Channel: pkgch.Name,
54+
CatalogSource: catalogSource,
55+
CatalogSourceNamespace: catalogSourceNamespace,
56+
Package: pkgm.Name,
57+
InstallModeType: installMode.Type,
58+
InstallPlanApproval: operatorv1alpha1.ApprovalAutomatic,
59+
}
60+
61+
SubscriptionList = append(SubscriptionList, s)
62+
break
5963
}
6064
}
6165
}
@@ -160,7 +164,7 @@ func checkFilteredResults(pkgs []pkgserverv1.PackageManifest, filter []string) e
160164
}
161165
}
162166
joinedMissingPackages := strings.Join(missingPackages, ", ")
163-
return fmt.Errorf("Could not find the following requested package filters:\n%#v", joinedMissingPackages)
167+
return fmt.Errorf("could not find the following requested package filters:\n%#v", joinedMissingPackages)
164168
}
165169
return nil
166170
}

0 commit comments

Comments
 (0)