Skip to content

Commit

Permalink
chore: fix format errors from eslint upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
phantomjinx committed Oct 5, 2024
1 parent 8f6f916 commit e46bbc2
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 15 deletions.
5 changes: 2 additions & 3 deletions docker/gateway/src/gateway-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function appPost(uri: string, body: Record<string, unknown> | Record<string, unk
describe.each([
{ title: 'proxyJolokiaAgentWithoutRbac', rbac: false },
{ title: 'proxyJolokiaAgentWithRbac', rbac: true },
// eslint-disable-next-line
// eslint-disable-next-line
])('$title', ({ title, rbac }) => {
const testAuth = rbac ? 'RBAC Enabled' : 'RBAC Disabled'

Expand Down Expand Up @@ -423,8 +423,7 @@ describe.each([
return appPost(path, testData.jolokia.bulkRequestWithViewerRole.request)
.expect(expectedStatus)
.then(res => {
if (rbac)
expect(res.text).toStrictEqual(JSON.stringify(testData.jolokia.bulkRequestWithViewerRole.response))
if (rbac) expect(res.text).toStrictEqual(JSON.stringify(testData.jolokia.bulkRequestWithViewerRole.response))
else expect(res.text).toStrictEqual(JSON.stringify(testData.authorization.notAllowedResponse))
})
})
Expand Down
5 changes: 2 additions & 3 deletions docker/gateway/src/jolokia-agent/jolokia-agent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function appPost(uri: string, body: Record<string, unknown> | Record<string, unk
describe.each([
{ title: 'proxyJolokiaAgentWithoutRbac', rbac: false },
{ title: 'proxyJolokiaAgentWithRbac', rbac: true },
// eslint-disable-next-line
// eslint-disable-next-line
])('$title', ({ title, rbac }) => {
const testAuth = rbac ? 'RBAC Enabled' : 'RBAC Disabled'

Expand Down Expand Up @@ -363,8 +363,7 @@ describe.each([
return appPost(path, testData.jolokia.bulkRequestWithViewerRole.request)
.expect(expectedStatus)
.then(res => {
if (rbac)
expect(res.text).toStrictEqual(JSON.stringify(testData.jolokia.bulkRequestWithViewerRole.response))
if (rbac) expect(res.text).toStrictEqual(JSON.stringify(testData.jolokia.bulkRequestWithViewerRole.response))
else expect(res.text).toStrictEqual(JSON.stringify(testData.authorization.notAllowedResponse))
})
})
Expand Down
6 changes: 4 additions & 2 deletions packages/kubernetes-api/src/client/object-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ export class ObjectListImpl<T extends KubeObject> extends EventEmitter implement
this.on(WatchActions.ANY, objects => {
log.debug(this.kind, 'changed:', objects)
})
this.on(WatchActions.INIT, objects => { // eslint-disable-line
this.on(WatchActions.INIT, objects => {

Check failure on line 38 in packages/kubernetes-api/src/client/object-list.ts

View workflow job for this annotation

GitHub Actions / lint

'objects' is defined but never used
// eslint-disable-line
log.debug(this.kind, 'initialized')
})
}
this.on(WatchActions.ANY, objects => { // eslint-disable-line
this.on(WatchActions.ANY, objects => {
// eslint-disable-line
this.initialize()
})
}
Expand Down
9 changes: 6 additions & 3 deletions packages/kubernetes-api/src/client/ws-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ export class WSHandlerImpl<T extends KubeObject> implements WSHandler<T> {
if (this.socket) this.socket.send(data)
}

shouldClose(event: Event): boolean { // eslint-disable-line
shouldClose(event: Event): boolean {

Check failure on line 103 in packages/kubernetes-api/src/client/ws-handler.ts

View workflow job for this annotation

GitHub Actions / lint

'event' is defined but never used
// eslint-disable-line
if (this.destroyed && this.socket && this.socket.readyState === WebSocket.OPEN) {
log.debug(
'Connection destroyed but still receiving messages, closing websocket, kind:',
Expand All @@ -111,7 +112,8 @@ export class WSHandlerImpl<T extends KubeObject> implements WSHandler<T> {
try {
log.debug('Closing websocket for kind:', this.watched.kind)
this.socket.close()
} catch (err) { // eslint-disable-line
} catch (err) {
// eslint-disable-line
// nothing to do, assume it's already closed
}
return true
Expand Down Expand Up @@ -267,7 +269,8 @@ export class WSHandlerImpl<T extends KubeObject> implements WSHandler<T> {
log.debug('Closing websocket for kind:', this.watched.kind, 'namespace:', this.watched.namespace)
this.socket.close()
log.debug('Close called on websocket for kind:', this.watched.kind, 'namespace:', this.watched.namespace)
} catch (err) { // eslint-disable-line
} catch (err) {
// eslint-disable-line
// nothing to do, assume it's already closed
}
}
Expand Down
11 changes: 10 additions & 1 deletion packages/kubernetes-api/src/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import { KubeObject, KubePod, K8S_PREFIX, K8S_API_VERSION, K8S_EXT_PREFIX, K8S_EXT_VERSION, OS_PREFIX, OS_API_VERSION } from './globals'
import {
KubeObject,
KubePod,
K8S_PREFIX,
K8S_API_VERSION,
K8S_EXT_PREFIX,
K8S_EXT_VERSION,
OS_PREFIX,
OS_API_VERSION,
} from './globals'
import { PodStatus } from 'kubernetes-types/core/v1'
import { WatchTypes, NamespacedTypes, ExtensionTypes, KindTypes } from './model'
import { joinPaths } from './utils/urls'
Expand Down
3 changes: 2 additions & 1 deletion packages/oauth/src/form/form-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ export class FormService implements OAuthProtoService {
}

log.debug('Set authorization header to Openshift auth token for AJAX requests')
const beforeSend = (xhr: JQueryXHR, settings: JQueryAjaxSettings) => { // eslint-disable-line
const beforeSend = (xhr: JQueryXHR, settings: JQueryAjaxSettings) => {

Check failure on line 153 in packages/oauth/src/form/form-service.ts

View workflow job for this annotation

GitHub Actions / lint

'settings' is defined but never used
// eslint-disable-line
// Set bearer token is used
xhr.setRequestHeader('Authorization', `Bearer ${this.userProfile.getToken()}`)

Expand Down
3 changes: 2 additions & 1 deletion packages/oauth/src/form/login/form-auth-login-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class FormAuthLoginService {
fetchPath<void>(
joinPaths(masterUri, 'api'),
{
success: async (_: string) => { // eslint-disable-line
success: async (_: string) => {

Check failure on line 45 in packages/oauth/src/form/login/form-auth-login-service.ts

View workflow job for this annotation

GitHub Actions / lint

'_' is defined but never used
// eslint-disable-line
log.debug('Connected to master uri api')
callback.success()
await this.saveTokenAndRedirect(token)
Expand Down
3 changes: 2 additions & 1 deletion packages/online-shell/src/discover/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ type DiscoverContext = {

export const DiscoverContext = createContext<DiscoverContext>({
refreshing: false,
setRefreshing: (refresh: boolean) => { // eslint-disable-line
setRefreshing: (refresh: boolean) => {

Check failure on line 95 in packages/online-shell/src/discover/context.ts

View workflow job for this annotation

GitHub Actions / lint

'refresh' is defined but never used
// eslint-disable-line
// no-op
},
discoverProjects: [],
Expand Down

0 comments on commit e46bbc2

Please sign in to comment.