correct paths

This commit is contained in:
Bartal Læarsson
2025-03-02 00:18:15 +00:00
parent 9334dbb2e0
commit d456d0b378
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ import (
var cleanupCmd = &cobra.Command{ var cleanupCmd = &cobra.Command{
Use: "cleanup", Use: "cleanup",
Short: "Clean up provisioned resources", Short: "Clean up provisioned resources",
Long: `Clean up provisioned infrastructure components like Kubernetes clusters, PostgreSQL, etc.`, Long: `Clean up provisioned infrastructure components like Kubernetes clusters etc.`,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
cleanupInteractive() cleanupInteractive()
}, },
+4 -4
View File
@@ -30,7 +30,7 @@ type Config struct {
// LoadDefaultConfig loads the default Kubernetes configuration from the defaults file // LoadDefaultConfig loads the default Kubernetes configuration from the defaults file
func LoadDefaultConfig() (*Config, error) { func LoadDefaultConfig() (*Config, error) {
defaultsPath := "ansible/defaults/kubernetes.yml" defaultsPath := "../../../ansible/defaults/kubernetes.yml"
data, err := os.ReadFile(defaultsPath) data, err := os.ReadFile(defaultsPath)
if err != nil { if err != nil {
@@ -209,8 +209,8 @@ func ProvisionInteractive() error {
// runProvisionScript runs the actual Kubernetes provisioning // runProvisionScript runs the actual Kubernetes provisioning
func runProvisionScript(configPath string) error { func runProvisionScript(configPath string) error {
// Run the ansible playbook with custom variables // Run the ansible playbook with custom variables
inventory := "ansible/inventories/kubernetes.yml" inventory := "../../../ansible/inventories/kubernetes.yml"
playbook := "ansible/playbooks/kubernetes.yml" playbook := "../../../ansible/playbooks/kubernetes.yml"
// Check if files exist // Check if files exist
if _, err := os.Stat(inventory); os.IsNotExist(err) { if _, err := os.Stat(inventory); os.IsNotExist(err) {
@@ -226,7 +226,7 @@ func runProvisionScript(configPath string) error {
// Cleanup handles Kubernetes cluster cleanup // Cleanup handles Kubernetes cluster cleanup
func Cleanup() error { func Cleanup() error {
scriptPath := "scripts/cleanup-kubernetes.sh" scriptPath := "../../../scripts/cleanup-kubernetes.sh"
// Check if script exists // Check if script exists
if _, err := os.Stat(scriptPath); os.IsNotExist(err) { if _, err := os.Stat(scriptPath); os.IsNotExist(err) {