Skip to content

Commit c749948

Browse files
committed
fix comments and nit picks
Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com>
1 parent 515ab33 commit c749948

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

cmd/main.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ func main() {
224224

225225
// Setup Scheme for OpenShift Config if available
226226
// Disables default Argo CD instance if the cluster doesn't contain OpenShift config API
227-
228227
if util.IsConfigAPIFound() {
229228
registerComponentOrExit(mgr, configv1.AddToScheme)
230229
}
@@ -267,7 +266,6 @@ func main() {
267266
}
268267
} else {
269268
setupLog.Info("skipping GitopsService controller setup", "reason", "OpenShift Config API not available")
270-
271269
}
272270

273271
if util.IsRouteAPIFound() {

controllers/util/util.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ func InspectCluster() error {
116116
return stderrors.Join(errs...)
117117
}
118118

119-
// used as a shortcut to check if the Config.Openshift.io API is found
119+
// IsConfigAPIFound return true if the CRD config.openshift.io is available in the cluster and false otherwise.
120120
func IsConfigAPIFound() bool {
121121
return configAPIFound
122122
}
123123

124-
// used as a shortcut to check if the cluster is an OpenShift cluster
124+
// IsOpenShiftCluster uses IsConfigAPIFound to check if the cluster is an OpenShift cluster.
125125
func IsOpenShiftCluster() bool {
126126
return IsConfigAPIFound()
127127
}
@@ -136,6 +136,7 @@ func verifyConfigAPI() error {
136136
return nil
137137
}
138138

139+
// IsConsoleAPIFound return true if the CRD console.openshift.io is available in the cluster.
139140
func IsConsoleAPIFound() bool {
140141
return consoleAPIFound
141142
}
@@ -149,6 +150,7 @@ func verifyConsoleAPI() error {
149150
return nil
150151
}
151152

153+
// IsRouteAPIFound return true if the CRD route.openshift.io is available in the cluster.
152154
func IsRouteAPIFound() bool {
153155
return routeAPIFound
154156
}
@@ -174,10 +176,12 @@ func verifyMonitoringAPI() error {
174176
return nil
175177
}
176178

179+
// IsMonitoringAPIFound return true if the CRD monitoring.coreos.com is available in the cluster.
177180
func IsMonitoringAPIFound() bool {
178181
return monitoringAPIFound
179182
}
180183

184+
// IsTemplateAPIFound return true if the CRD template.openshift.io is available in the cluster.
181185
func IsTemplateAPIFound() bool {
182186
return templateAPIFound
183187
}
@@ -191,6 +195,7 @@ func verifyTemplateAPI() error {
191195
return nil
192196
}
193197

198+
// IsAppsAPIFound return true if the CRD apps.openshift.io is available in the cluster.
194199
func IsAppsAPIFound() bool {
195200
return appsAPIFound
196201
}
@@ -204,6 +209,7 @@ func verifyAppsAPI() error {
204209
return nil
205210
}
206211

212+
// IsOAuthAPIFound return true if the CRD oauth.openshift.io is available in the cluster.
207213
func IsOAuthAPIFound() bool {
208214
return oauthAPIFound
209215
}
@@ -217,6 +223,7 @@ func verifyOAuthAPI() error {
217223
return nil
218224
}
219225

226+
// IsOLMAPIFound return true if the CRD operators.coreos.com is available in the cluster.
220227
func IsOLMAPIFound() bool {
221228
return olmAPIFound
222229
}

0 commit comments

Comments
 (0)