Skip to content

Commit a6576ed

Browse files
committed
some lint and rebase errors
1 parent 12f299a commit a6576ed

File tree

9 files changed

+19
-18
lines changed

9 files changed

+19
-18
lines changed

core/server/objects.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ func (cs *coreServer) ListObjects(ctx context.Context, msg *pb.ListObjectsReques
9595
if gvk.Kind == v2beta1.HelmReleaseKind {
9696
inventory, err = getUnstructuredHelmReleaseInventory(ctx, object, clustersClient, n)
9797
if err != nil {
98-
9998
respErrors = append(respErrors, &pb.ListError{ClusterName: n, Message: err.Error()})
10099
inventory = nil // We can still display most things without inventory
101100

core/server/objects_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ func TestListObject_HelmReleaseCantGetSecret(t *testing.T) {
576576
g := NewGomegaWithT(t)
577577

578578
scheme, err := kube.CreateScheme()
579+
g.Expect(err).NotTo(HaveOccurred())
579580
ctx := context.Background()
580581

581582
ns := &corev1.Namespace{

ui/components/AlertsTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import qs from "query-string";
33
import * as React from "react";
44
import styled from "styled-components";
55
import { useFeatureFlags } from "../hooks/featureflags";
6-
import { Alert, CrossNamespaceObjectRef, Kind } from "../lib/objects";
6+
import { Kind } from "../lib/api/core/types.pb";
7+
import { Alert, CrossNamespaceObjectRef } from "../lib/objects";
78
import { V2Routes } from "../lib/types";
89
import { statusSortHelper } from "../lib/utils";
910
import DataTable, {
@@ -20,7 +21,6 @@ type Props = {
2021
className?: string;
2122
rows?: Alert[];
2223
};
23-
2424
export const makeEventSourceLink = (obj: CrossNamespaceObjectRef) => {
2525
const url =
2626
obj.kind === Kind.Kustomization || obj.kind === Kind.HelmRelease

ui/components/__tests__/AlertsTable.test.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Kind } from "../../lib/api/core/types.pb";
12
import { makeEventSourceLink } from "../AlertsTable";
23

34
describe("AlertsTable", () => {
@@ -7,7 +8,7 @@ describe("AlertsTable", () => {
78
apiVersion: "v1",
89
name: "*",
910
namespace: "space",
10-
kind: "GitRepository",
11+
kind: Kind.GitRepository,
1112
matchLabels: [],
1213
};
1314
const sourceLink = makeEventSourceLink(allNames);
@@ -20,7 +21,7 @@ describe("AlertsTable", () => {
2021
apiVersion: "v1",
2122
name: "goose",
2223
namespace: "*",
23-
kind: "HelmRelease",
24+
kind: Kind.HelmRelease,
2425
matchLabels: [],
2526
};
2627
const automationLink = makeEventSourceLink(allNamespaces);

ui/components/__tests__/CheckboxActions.test.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import "jest-styled-components";
2+
import { Kind } from "../../lib/api/core/types.pb";
23
import { makeObjects } from "../CheckboxActions";
34

45
describe("CheckboxActions", () => {
@@ -7,14 +8,14 @@ describe("CheckboxActions", () => {
78
const rows = [
89
{
910
name: "name",
10-
kind: "kind",
11+
kind: Kind.GitRepository,
1112
namespace: "namespace",
1213
clusterName: "clusterName",
1314
uid: "123",
1415
},
1516
{
1617
name: "name",
17-
kind: "kind",
18+
kind: Kind.HelmRelease,
1819
namespace: "namespace",
1920
clusterName: "clusterName",
2021
uid: "321",
@@ -23,7 +24,7 @@ describe("CheckboxActions", () => {
2324
expect(makeObjects(checked, rows)).toEqual([
2425
{
2526
name: "name",
26-
kind: "kind",
27+
kind: Kind.GitRepository,
2728
namespace: "namespace",
2829
clusterName: "clusterName",
2930
},

ui/contexts/__tests__/CoreClientContext.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { QueryClient, QueryClientProvider } from "react-query";
21
import * as React from "react";
2+
import { QueryClient, QueryClientProvider } from "react-query";
33
import renderer from "react-test-renderer";
44
import { Core } from "../../lib/api/core/core.pb";
55
import CoreClientContextProvider, {
@@ -10,7 +10,7 @@ describe("CoreContextProvider", () => {
1010
it("returns a non-empty api", () => {
1111
function TestComponent() {
1212
const { api } = React.useContext(CoreClientContext);
13-
expect(api.ListKustomizations).toBeTruthy();
13+
expect(api.ListObjects).toBeTruthy();
1414
return <div />;
1515
}
1616

ui/hooks/flux.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@ import {
1212
Kind,
1313
UnstructuredObject,
1414
} from "../lib/api/core/types.pb";
15-
import { getChildren } from "../lib/graph";
15+
import { getChildren, UnstructuredObjectWithChildren } from "../lib/graph";
1616
import {
1717
DefaultCluster,
1818
NoNamespace,
1919
ReactQueryOptions,
2020
RequestError,
2121
} from "../lib/types";
2222
import { notifyError, notifySuccess } from "../lib/utils";
23-
2423
export function useListFluxRuntimeObjects(
2524
clusterName = DefaultCluster,
2625
namespace = NoNamespace,

ui/lib/__tests__/objects.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ describe("objects lib", () => {
131131

132132
it("extracts source ref", () => {
133133
expect(obj.sourceRef).toEqual({
134-
kind: "KindHelmRepository",
134+
kind: Kind.HelmRepository,
135135
name: "helmrepository",
136136
namespace: "metadata",
137137
});
@@ -328,7 +328,7 @@ describe("objects lib", () => {
328328
expect(obj.helmChart.name).toEqual("flux-system-ww-gitops");
329329
expect(obj.helmChart.namespace).toEqual("flux-system");
330330
expect(obj.helmChart.sourceRef).toEqual({
331-
kind: "KindHelmRepository",
331+
kind: Kind.HelmRepository,
332332
name: "ww-gitops",
333333
namespace: "flux-system",
334334
});
@@ -339,7 +339,7 @@ describe("objects lib", () => {
339339
});
340340
it("finds the source ref for the helm repository", () => {
341341
expect(obj.sourceRef).toEqual({
342-
kind: "KindHelmRepository",
342+
kind: Kind.HelmRepository,
343343
name: "ww-gitops",
344344
namespace: "flux-system",
345345
});
@@ -397,7 +397,7 @@ describe("objects lib", () => {
397397
});
398398
it("extracts sourceRef", () => {
399399
expect(obj.sourceRef).toEqual({
400-
kind: "KindGitRepository",
400+
kind: Kind.GitRepository,
401401
name: "webapp",
402402
namespace: "default",
403403
});

ui/lib/__tests__/utils.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ describe("utils lib", () => {
306306

307307
const kustomization = new Kustomization(response);
308308

309-
expect(getSourceRefForAutomation(kustomization)).toBe(
309+
expect(getSourceRefForAutomation(kustomization)).toEqual(
310310
kustomization.sourceRef
311311
);
312312
});
@@ -321,7 +321,7 @@ describe("utils lib", () => {
321321

322322
const helmRelease = new HelmRelease(object);
323323

324-
expect(getSourceRefForAutomation(helmRelease)).toBe(
324+
expect(getSourceRefForAutomation(helmRelease)).toEqual(
325325
helmRelease.helmChart.sourceRef
326326
);
327327
});

0 commit comments

Comments
 (0)