@@ -160,7 +160,106 @@ export const useFunc = (model) => {
160160 let initialDbMetadata = { }
161161 let namespaceList = [ ]
162162 let backupConfigurationsFromStore = { }
163- let valuesFromWizard = { }
163+ let valuesFromWizard = {
164+ apiVersion : 'core.kubestash.com/v1alpha1' ,
165+ kind : 'BackupConfiguration' ,
166+ metadata : {
167+ name : 'clickhouse' ,
168+ namespace : 'demo' ,
169+ } ,
170+ spec : {
171+ backends : [
172+ {
173+ name : 'clickhouse-backend' ,
174+ retentionPolicy : {
175+ name : 'clickhouse-retention-policy' ,
176+ namespace : 'demo' ,
177+ } ,
178+ storageRef : {
179+ name : 'clickhouse-storage' ,
180+ namespace : 'demo' ,
181+ } ,
182+ } ,
183+ ] ,
184+ sessions : [
185+ {
186+ addon : {
187+ jobTemplate : {
188+ spec : {
189+ containerSecurityContext : {
190+ allowPrivilegeEscalation : false ,
191+ capabilities : {
192+ drop : [ 'ALL' ] ,
193+ } ,
194+ runAsGroup : 0 ,
195+ runAsNonRoot : true ,
196+ runAsUser : 999 ,
197+ seccompProfile : {
198+ type : 'RuntimeDefault' ,
199+ } ,
200+ } ,
201+ nodeSelector : {
202+ 'kubernetes.io/os' : 'linux' ,
203+ } ,
204+ } ,
205+ } ,
206+ name : 'clickhouse-addon' ,
207+ tasks : [
208+ {
209+ name : 'logical-backup' ,
210+ } ,
211+ ] ,
212+ } ,
213+ name : 'clickhouse-frequent-backup' ,
214+ repositories : [
215+ {
216+ backend : 'clickhouse-backend' ,
217+ directory : '/clickhouse-repo' ,
218+ encryptionSecret : {
219+ name : 'clickhouse-encryption-secret' ,
220+ namespace : 'demo' ,
221+ } ,
222+ name : 'clickhouse-repo' ,
223+ } ,
224+ ] ,
225+ scheduler : {
226+ failedJobsHistoryLimit : 4 ,
227+ jobTemplate : {
228+ backoffLimit : 2 ,
229+ template : {
230+ spec : {
231+ containerSecurityContext : {
232+ allowPrivilegeEscalation : false ,
233+ capabilities : {
234+ drop : [ 'ALL' ] ,
235+ } ,
236+ runAsGroup : 0 ,
237+ runAsNonRoot : true ,
238+ runAsUser : 999 ,
239+ seccompProfile : {
240+ type : 'RuntimeDefault' ,
241+ } ,
242+ } ,
243+ nodeSelector : {
244+ 'kubernetes.io/os' : 'linux' ,
245+ } ,
246+ } ,
247+ } ,
248+ } ,
249+ schedule : '0 */2 * * *' ,
250+ successfulJobsHistoryLimit : 2 ,
251+ } ,
252+ sessionHistoryLimit : 3 ,
253+ } ,
254+ ] ,
255+ target : {
256+ apiGroup : 'kubedb.com' ,
257+ kind : 'ClickHouse' ,
258+ name : 'clickhouse' ,
259+ namespace : 'demo' ,
260+ } ,
261+ } ,
262+ }
164263 let initialArchiver = { }
165264 let isArchiverAvailable = false
166265 let archiverObjectToCommit = { }
@@ -181,27 +280,6 @@ export const useFunc = (model) => {
181280 initialArchiver = dbResource . spec ?. archiver ? objectCopy ( dbResource . spec ?. archiver ) : undefined
182281
183282 // get values.yaml to populate data when backup-config is being created
184- try {
185- const actionArray = storeGet ( '/resource/actions/result' )
186- const editorDetails = actionArray [ 0 ] ?. items [ 0 ] ?. editor
187- const chartName = editorDetails ?. name
188- const sourceApiGroup = editorDetails ?. sourceRef ?. apiGroup
189- const sourceKind = editorDetails ?. sourceRef ?. kind
190- const sourceNamespace = editorDetails ?. sourceRef ?. namespace
191- const sourceName = editorDetails ?. sourceRef ?. name
192- const chartVersion = editorDetails ?. version
193-
194- let url = `/clusters/${ user } /${ cluster } /helm/packageview/values?name=${ chartName } &sourceApiGroup=${ sourceApiGroup } &sourceKind=${ sourceKind } &sourceNamespace=${ sourceNamespace } &sourceName=${ sourceName } &version=${ chartVersion } &format=json`
195-
196- if ( spoke )
197- url = `/clusters/${ user } /${ spoke } /helm/packageview/values?name=${ chartName } &sourceApiGroup=${ sourceApiGroup } &sourceKind=${ sourceKind } &sourceNamespace=${ sourceNamespace } &sourceName=${ sourceName } &version=${ chartVersion } &format=json`
198-
199- const resp = await axios . get ( url )
200-
201- valuesFromWizard = objectCopy ( resp . data ?. resources ?. coreKubestashComBackupConfiguration ) || { }
202- } catch ( e ) {
203- console . log ( e )
204- }
205283
206284 // check storageclass archiver annotation
207285 if ( initialArchiver ) {
0 commit comments