File tree Expand file tree Collapse file tree 4 files changed +19
-7
lines changed Expand file tree Collapse file tree 4 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -636,7 +636,7 @@ const initCmd = new Command({
636636 installationEvent : installationProgress . events . CLUSTER_INTEGRATION_ADDED ,
637637 condition : async ( ) => {
638638 if ( isInCluster ( ) ) {
639- console . log ( 'Cluster integration was not added , please add it via codefresh create clusters [name] ' ) ;
639+ console . log ( 'Cluster integration was not added , please add it via codefresh " create clusters [name]" ' ) ;
640640 return false ;
641641 }
642642 const clusters = await sdk . clusters . list ( ) || [ ] ;
@@ -778,7 +778,18 @@ const initCmd = new Command({
778778 } ,
779779 successMessage : 'Successfully installed cluster monitoring' ,
780780 installationEvent : installationProgress . events . MONITOR_INSTALLED ,
781- condition : installMonitor ,
781+ condition : async ( ) => {
782+ if ( ! installMonitor ) {
783+ return false ;
784+ }
785+
786+ if ( isInCluster ( ) ) {
787+ console . log ( 'Monitor component cannot be installed without cluster integration, you can install it seperately using: "codefresh install monitor"' ) ;
788+ return false ;
789+ }
790+
791+ return true ;
792+ } ,
782793 } ) ;
783794
784795 // Post Installation
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ const installRoot = require('../root/install.cmd');
44const { DefaultLogFormatter } = require ( './../hybrid/helper' ) ;
55const { downloadVeonona } = require ( '../hybrid/helper' ) ;
66const { Runner, components } = require ( '../../../../binary' ) ;
7+ const sdk = require ( '../../../../logic/sdk' ) ;
78const _ = require ( 'lodash' ) ;
89
910const installMonitorCmd = new Command ( {
@@ -77,9 +78,11 @@ const installMonitorCmd = new Command({
7778 commands . push ( clusterId ) ;
7879 }
7980
81+ commands . push ( '--codefreshToken' ) ;
8082 if ( token ) {
81- commands . push ( '--codefreshToken' ) ;
8283 commands . push ( token ) ;
84+ } else {
85+ commands . push ( _ . get ( sdk , 'config.context.token' ) ) ;
8386 }
8487
8588 if ( kubeConfigPath ) {
Original file line number Diff line number Diff line change @@ -17,9 +17,7 @@ const _getKubeConfig = (kubeconfigPath) => {
1717 return kc ;
1818} ;
1919
20- const isInCluster = ( ) => {
21- return fs . existsSync ( '/var/run/secrets/kubernetes.io/serviceaccount' ) ;
22- } ;
20+ const isInCluster = ( ) => fs . existsSync ( '/var/run/secrets/kubernetes.io/serviceaccount' ) ;
2321
2422const getKubeContext = ( kubeconfigPath ) => {
2523 const kubeconfig = _getKubeConfig ( kubeconfigPath ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " codefresh" ,
3- "version" : " 0.74.5 " ,
3+ "version" : " 0.74.6 " ,
44 "description" : " Codefresh command line utility" ,
55 "main" : " index.js" ,
66 "preferGlobal" : true ,
You can’t perform that action at this time.
0 commit comments