@@ -19,7 +19,6 @@ export const getRegistry = async (client: v1.DockerDesktopClient) => {
19
19
const writeRegistryIfNotExists = async ( ) => {
20
20
const registry = await readFileInPromptsVolume ( client , 'registry.yaml' )
21
21
if ( ! registry ) {
22
- console . log ( 'writeRegistryIfNotExists: no registry' )
23
22
await writeFileToPromptsVolume ( client , JSON . stringify ( { files : [ { path : 'registry.yaml' , content : 'registry: {}' } ] } ) )
24
23
}
25
24
}
@@ -44,7 +43,6 @@ export const getStoredConfig = async (client: v1.DockerDesktopClient) => {
44
43
const writeConfigIfNotExists = async ( ) => {
45
44
const config = await readFileInPromptsVolume ( client , 'config.yaml' )
46
45
if ( ! config ) {
47
- console . log ( 'writeConfigIfNotExists: no config' )
48
46
await writeFileToPromptsVolume ( client , JSON . stringify ( { files : [ { path : 'config.yaml' , content : '{}' } ] } ) )
49
47
}
50
48
}
@@ -65,14 +63,11 @@ export const getStoredConfig = async (client: v1.DockerDesktopClient) => {
65
63
// Replace conflicting config values with registry values
66
64
export const syncConfigWithRegistry = async ( client : v1 . DockerDesktopClient , registry : { [ key : string ] : { ref : string , config : any } } , config : { [ key : string ] : { [ key : string ] : ParsedParameters } } ) => {
67
65
if ( Object . keys ( registry ) . length === 0 ) {
68
- console . log ( 'No registry to sync with config.' )
69
66
return ;
70
67
}
71
68
if ( Object . keys ( config ) . length === 0 ) {
72
- console . log ( 'No config to sync with registry.' )
73
69
return ;
74
70
}
75
- console . log ( 'SYNC STARTED. REGISTRY -> CONFIG' , registry , config )
76
71
const oldConfigString = JSON . stringify ( config )
77
72
for ( const [ registryItemName , registryItem ] of Object . entries ( registry ) ) {
78
73
const configInRegistry = registryItem . config
@@ -84,26 +79,19 @@ export const syncConfigWithRegistry = async (client: v1.DockerDesktopClient, reg
84
79
}
85
80
const newConfigString = JSON . stringify ( config )
86
81
if ( oldConfigString !== newConfigString ) {
87
- console . log ( 'Updating config with new registry.' , 'oldConfigString' , oldConfigString , 'newConfigString' , newConfigString )
88
82
await writeFileToPromptsVolume ( client , JSON . stringify ( { files : [ { path : 'config.yaml' , content : stringify ( config ) } ] } ) )
89
83
}
90
- else {
91
- console . log ( 'No registry changes to sync with config.' , 'oldConfigString' , oldConfigString , 'newConfigString' , newConfigString )
92
- }
93
84
return config
94
85
}
95
86
96
87
// Replace conflicting registry values with config values
97
88
export const syncRegistryWithConfig = async ( client : v1 . DockerDesktopClient , registry : { [ key : string ] : { ref : string , config : any } } , config : { [ key : string ] : { [ key : string ] : ParsedParameters } } ) => {
98
89
if ( Object . keys ( config ) . length === 0 ) {
99
- console . log ( 'No config to sync with registry.' )
100
90
return ;
101
91
}
102
92
if ( Object . keys ( registry ) . length === 0 ) {
103
- console . log ( 'No registry to sync with config.' )
104
93
return ;
105
94
}
106
- console . log ( 'SYNC STARTED. CONFIG -> REGISTRY' , config , registry )
107
95
const oldRegString = JSON . stringify ( registry )
108
96
for ( const [ itemName , itemConfig ] of Object . entries ( config ) ) {
109
97
const registryItem = registry [ itemName ]
@@ -117,11 +105,7 @@ export const syncRegistryWithConfig = async (client: v1.DockerDesktopClient, reg
117
105
}
118
106
const newRegString = JSON . stringify ( registry )
119
107
if ( oldRegString !== newRegString ) {
120
- console . log ( 'Updating registry with new config.' , 'oldRegString' , oldRegString , 'newRegString' , newRegString )
121
108
await writeFileToPromptsVolume ( client , JSON . stringify ( { files : [ { path : 'registry.yaml' , content : stringify ( { registry } ) } ] } ) )
122
109
}
123
- else {
124
- console . log ( 'No config changes to sync with registry.' , 'oldRegString' , oldRegString , 'newRegString' , newRegString )
125
- }
126
110
return registry
127
111
}
0 commit comments