Cherry pick PRs from 6.4.4 and 6.4.3 (#7309)

* Add support for using release branch targetted PRs (#7291)

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix namespaces not respecting accessible namespace config (#7279)

* Fix namespaces not respecting accessible namespace config

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix warning hover text formatting

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Log state after refresh accessibility

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix NamespaceStore.allowedNamespaces

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Remove unnecessary '?'

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Add deprecation messages

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Move selected_namespaces storage to injectable

- And its initialization

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Implement contextNamespaces logic in forNamespacedResources

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Update snapshot

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix formatting

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix formatting

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix test

- This was a side effect of the previous bug fixes where
  the clusterContext.hasAllSelected was previously erroneously 'false'

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Change log level

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix another test suite

Signed-off-by: Sebastian Malton <sebastian@malton.name>

---------

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix not showing some non-core kinds (#7303)

* Fix not showing some non-core kinds

- Specifically if a Kind is not present within the preferredVersion of
  a group then we don't know that resource exists

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Add technical tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>

---------

Signed-off-by: Sebastian Malton <sebastian@malton.name>

---------

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton authored and GitHub committed 2023-03-07 09:46:00 -08:00
1 parent f69dd6fc8f
commit 0fe4daf8d3
22 files changed
+311 -77

No files matched your search

@@ -67,6 +67,7 @@ import fsInjectable from "../../../common/fs/fs.injectable";
import joinPathsInjectable from "../../../common/path/join-paths.injectable";
import homeDirectoryPathInjectable from "../../../common/os/home-directory-path.injectable";
import { testUsingFakeTime } from "../../../common/test-utils/use-fake-time";
import selectedNamespacesStorageInjectable from "../../../features/namespace-filtering/renderer/storage.injectable";
import { registerFeature } from "@k8slens/feature-core";
import {
applicationFeatureForElectronMain,
@@ -388,7 +389,12 @@ export const getApplicationBuilder = () => {
namespaces.add(namespace);
namespaceItems.replace(createNamespacesFor(namespaces));
}),
select: action((namespace) => selectedNamespaces.add(namespace)),
select: action((namespace) => {
const selectedNamespacesStorage = builder.applicationWindow.only.di.inject(selectedNamespacesStorageInjectable);
selectedNamespaces.add(namespace);
selectedNamespacesStorage.set([...selectedNamespaces]);
}),
},
applicationMenu: {
get items() {
@@ -523,6 +529,7 @@ export const getApplicationBuilder = () => {
const clusterStub = {
id: "some-cluster-id",
accessibleNamespaces: observable.array(),
allowedNamespaces: observable.array(),
shouldShowResource: (kind) => allowedResourcesState.has(formatKubeApiResource(kind)),
} as Partial<Cluster> as Cluster;