@@ -708,7 +708,9 @@ export class OpenShiftExplorer implements TreeDataProvider<ExplorerItem>, Dispos
708
708
*/
709
709
loadKubernetesCore ( namespace : string | null , value : string ) {
710
710
const outputFormat = getOutputFormat ( ) ;
711
- const uri = kubefsUri ( namespace , value , outputFormat ) ;
711
+ // Names are to be only lowercase,
712
+ // see: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names
713
+ const uri = kubefsUri ( namespace , value . toLocaleLowerCase ( ) , outputFormat , undefined , true ) ;
712
714
this . loadKubernetesDocument ( uri ) ;
713
715
}
714
716
@@ -718,7 +720,7 @@ export class OpenShiftExplorer implements TreeDataProvider<ExplorerItem>, Dispos
718
720
* @param revision Installed Helm Chart revision
719
721
*/
720
722
loadKubernetesHelmChart ( releaseName : string , revision : number | undefined ) {
721
- const uri = helmfsUri ( releaseName , revision ) ;
723
+ const uri = helmfsUri ( releaseName , revision , true ) ;
722
724
this . loadKubernetesDocument ( uri ) ;
723
725
}
724
726
@@ -727,19 +729,7 @@ export class OpenShiftExplorer implements TreeDataProvider<ExplorerItem>, Dispos
727
729
* @param uri A Kubernetes document Uri
728
730
*/
729
731
loadKubernetesDocument ( uri : Uri ) {
730
- const query = this . getComparableQuery ( uri ) ;
731
- const openUri = workspace . textDocuments . map ( ( doc ) => doc . uri )
732
- . find ( ( docUri ) => {
733
- return ( docUri . scheme === uri . scheme &&
734
- docUri . authority === uri . authority &&
735
- docUri . fragment === uri . fragment &&
736
- docUri . path === uri . path &&
737
- this . getComparableQuery ( docUri ) === query ) ;
738
- } ) ;
739
-
740
- // If open document is found for the URI provided, we use its URI to bring its editor to the front
741
- // instead of openning a new editor
742
- workspace . openTextDocument ( openUri ? openUri : uri ) . then (
732
+ workspace . openTextDocument ( uri ) . then (
743
733
( doc ) => {
744
734
if ( doc ) {
745
735
void window . showTextDocument ( doc ) ;
@@ -748,19 +738,6 @@ export class OpenShiftExplorer implements TreeDataProvider<ExplorerItem>, Dispos
748
738
( err ) => window . showErrorMessage ( `Error loading document: ${ err } ` ) ) ;
749
739
}
750
740
751
- /*
752
- * Returns the query string of the specified Uri without "nonce" param,
753
- * so the query strings can be compared.
754
- * The "nonce" param is generated as current time value for every KubefsUri created,
755
- * f.i., "_=1709642987392", and are always added to the end of the query string (so
756
- * they always have the preceeding query parameters sepacator character ("&") added),
757
- * so the query strings, if they aren't cleared from "nonce" param, can be compared for
758
- * Uri objects even when they point to the same document.
759
- */
760
- getComparableQuery ( uri : Uri ) : string {
761
- return uri . query . replace ( / & _ = [ 0 - 9 ] + / g, '' ) ;
762
- }
763
-
764
741
@vsCommand ( 'openshift.resource.delete' )
765
742
public static async deleteResource ( component : KubernetesObject ) {
766
743
await Progress . execFunctionWithProgress ( `Deleting '${ component . kind } /${ component . metadata . name } '` , async ( _ ) => {
0 commit comments