feature: pre_lvm_crypt
This commit is contained in:
		
							
								
								
									
										34
									
								
								tools/testconf/main.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								tools/testconf/main.go
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,34 @@ | ||||
| package main | ||||
|  | ||||
| import ( | ||||
| 	"bytes" | ||||
| 	"flag" | ||||
| 	"log" | ||||
| 	"os" | ||||
|  | ||||
| 	"gopkg.in/yaml.v3" | ||||
| 	config "novit.tech/direktil/pkg/bootstrapconfig" | ||||
| ) | ||||
|  | ||||
| func main() { | ||||
| 	flag.Parse() | ||||
|  | ||||
| 	for _, arg := range flag.Args() { | ||||
| 		log.Print("testing ", arg) | ||||
|  | ||||
| 		cfgBytes, err := os.ReadFile(arg) | ||||
| 		if err != nil { | ||||
| 			log.Fatal(err) | ||||
| 		} | ||||
|  | ||||
| 		cfg := config.Config{} | ||||
|  | ||||
| 		dec := yaml.NewDecoder(bytes.NewBuffer(cfgBytes)) | ||||
| 		dec.KnownFields(true) | ||||
|  | ||||
| 		err = dec.Decode(&cfg) | ||||
| 		if err != nil { | ||||
| 			log.Fatal(err) | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
		Reference in New Issue
	
	Block a user