Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"/^pkg/constants/constants.go$/"
],
"matchStrings": [
"// renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)\n\\s*\\w+\\s*=\\s*\"(?<currentValue>[^\"]+)\""
"// renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)\n.*?(?<currentValue>v?\\d+\\.\\d+\\.\\d+[^\"\\s]*)"
],
"datasourceTemplate": "{{datasource}}",
"versioningTemplate": "semver"
Expand Down
10 changes: 5 additions & 5 deletions api/v1alpha1/blueprint_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,27 +626,27 @@ func (k *Kustomization) ToFluxKustomization(namespace string, defaultSourceName
path = "kustomize/" + strings.ReplaceAll(path, "\\", "/")
}

interval := metav1.Duration{Duration: constants.DEFAULT_FLUX_KUSTOMIZATION_INTERVAL}
interval := metav1.Duration{Duration: constants.DefaultFluxKustomizationInterval}
if k.Interval != nil && k.Interval.Duration != 0 {
interval = *k.Interval
}

retryInterval := metav1.Duration{Duration: constants.DEFAULT_FLUX_KUSTOMIZATION_RETRY_INTERVAL}
retryInterval := metav1.Duration{Duration: constants.DefaultFluxKustomizationRetryInterval}
if k.RetryInterval != nil && k.RetryInterval.Duration != 0 {
retryInterval = *k.RetryInterval
}

timeout := metav1.Duration{Duration: constants.DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT}
timeout := metav1.Duration{Duration: constants.DefaultFluxKustomizationTimeout}
if k.Timeout != nil && k.Timeout.Duration != 0 {
timeout = *k.Timeout
}

wait := constants.DEFAULT_FLUX_KUSTOMIZATION_WAIT
wait := constants.DefaultFluxKustomizationWait
if k.Wait != nil {
wait = *k.Wait
}

force := constants.DEFAULT_FLUX_KUSTOMIZATION_FORCE
force := constants.DefaultFluxKustomizationForce
if k.Force != nil {
force = *k.Force
}
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/blueprint_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ func TestKustomization_ToFluxKustomization(t *testing.T) {
if result.Spec.Path != "kustomize/test/path" {
t.Errorf("Expected path 'kustomize/test/path', got '%s'", result.Spec.Path)
}
if result.Spec.Interval.Duration != constants.DEFAULT_FLUX_KUSTOMIZATION_INTERVAL {
if result.Spec.Interval.Duration != constants.DefaultFluxKustomizationInterval {
t.Errorf("Expected default interval, got %v", result.Spec.Interval.Duration)
}
if result.Spec.PostBuild == nil {
Expand Down Expand Up @@ -1114,7 +1114,7 @@ func TestKustomization_ToFluxKustomization(t *testing.T) {

result := kustomization.ToFluxKustomization("test-namespace", "default-source", []Source{})

if result.Spec.Interval.Duration != constants.DEFAULT_FLUX_KUSTOMIZATION_INTERVAL {
if result.Spec.Interval.Duration != constants.DefaultFluxKustomizationInterval {
t.Errorf("Expected default interval, got %v", result.Spec.Interval.Duration)
}
})
Expand Down
2 changes: 1 addition & 1 deletion cmd/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var checkNodeHealthCmd = &cobra.Command{

// If timeout is not set via flag, use default
if !cmd.Flags().Changed("timeout") {
nodeHealthTimeout = constants.DEFAULT_NODE_HEALTH_CHECK_TIMEOUT
nodeHealthTimeout = constants.DefaultNodeHealthCheckTimeout
}

// Create output function
Expand Down
48 changes: 24 additions & 24 deletions cmd/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,12 +495,12 @@ func TestInitCmd(t *testing.T) {
// If context is "local" and neither provider nor blueprint is set, set both
if len(args) > 0 && strings.HasPrefix(args[0], "local") && initProvider == "" && initBlueprint == "" {
initProvider = "generic"
initBlueprint = constants.DEFAULT_OCI_BLUEPRINT_URL
initBlueprint = constants.DefaultOCIBlueprintURL
}

// If provider is set and blueprint is not set, set blueprint (covers all providers, including local)
if initProvider != "" && initBlueprint == "" {
initBlueprint = constants.DEFAULT_OCI_BLUEPRINT_URL
initBlueprint = constants.DefaultOCIBlueprintURL
}

// If blueprint is set, use it (overrides all)
Expand All @@ -517,8 +517,8 @@ func TestInitCmd(t *testing.T) {
t.Errorf("Expected blueprint to be set in context for local context")
} else if blueprint, ok := blueprintCtx.(string); !ok {
t.Errorf("Expected blueprint context value to be a string")
} else if blueprint != constants.DEFAULT_OCI_BLUEPRINT_URL {
t.Errorf("Expected blueprint to be %s, got %s", constants.DEFAULT_OCI_BLUEPRINT_URL, blueprint)
} else if blueprint != constants.DefaultOCIBlueprintURL {
t.Errorf("Expected blueprint to be %s, got %s", constants.DefaultOCIBlueprintURL, blueprint)
}
})

Expand All @@ -536,12 +536,12 @@ func TestInitCmd(t *testing.T) {
// If context is "local" and neither provider nor blueprint is set, set both
if len(args) > 0 && strings.HasPrefix(args[0], "local") && initProvider == "" && initBlueprint == "" {
initProvider = "generic"
initBlueprint = constants.DEFAULT_OCI_BLUEPRINT_URL
initBlueprint = constants.DefaultOCIBlueprintURL
}

// If provider is set and blueprint is not set, set blueprint (covers all providers, including local)
if initProvider != "" && initBlueprint == "" {
initBlueprint = constants.DEFAULT_OCI_BLUEPRINT_URL
initBlueprint = constants.DefaultOCIBlueprintURL
}

// If blueprint is set, use it (overrides all)
Expand All @@ -558,8 +558,8 @@ func TestInitCmd(t *testing.T) {
t.Errorf("Expected blueprint to be set in context when explicit provider is specified")
} else if blueprint, ok := blueprintCtx.(string); !ok {
t.Errorf("Expected blueprint context value to be a string")
} else if blueprint != constants.DEFAULT_OCI_BLUEPRINT_URL {
t.Errorf("Expected blueprint to be %s, got %s", constants.DEFAULT_OCI_BLUEPRINT_URL, blueprint)
} else if blueprint != constants.DefaultOCIBlueprintURL {
t.Errorf("Expected blueprint to be %s, got %s", constants.DefaultOCIBlueprintURL, blueprint)
}
})

Expand All @@ -577,12 +577,12 @@ func TestInitCmd(t *testing.T) {
// If context is "local" and neither provider nor blueprint is set, set both
if len(args) > 0 && strings.HasPrefix(args[0], "local") && initProvider == "" && initBlueprint == "" {
initProvider = "generic"
initBlueprint = constants.DEFAULT_OCI_BLUEPRINT_URL
initBlueprint = constants.DefaultOCIBlueprintURL
}

// If provider is set and blueprint is not set, set blueprint (covers all providers, including local)
if initProvider != "" && initBlueprint == "" {
initBlueprint = constants.DEFAULT_OCI_BLUEPRINT_URL
initBlueprint = constants.DefaultOCIBlueprintURL
}

// If blueprint is set, use it (overrides all)
Expand Down Expand Up @@ -614,12 +614,12 @@ func TestInitCmd(t *testing.T) {
// If context is "local" and neither provider nor blueprint is set, set both
if len(args) > 0 && strings.HasPrefix(args[0], "local") && initProvider == "" && initBlueprint == "" {
initProvider = "generic"
initBlueprint = constants.DEFAULT_OCI_BLUEPRINT_URL
initBlueprint = constants.DefaultOCIBlueprintURL
}

// If provider is set and blueprint is not set, set blueprint (covers all providers, including local)
if initProvider != "" && initBlueprint == "" {
initBlueprint = constants.DEFAULT_OCI_BLUEPRINT_URL
initBlueprint = constants.DefaultOCIBlueprintURL
}

// If blueprint is set, use it (overrides all)
Expand Down Expand Up @@ -649,7 +649,7 @@ func TestInitCmd(t *testing.T) {

// If provider is set and blueprint is not set, set blueprint (covers all providers, including local)
if initProvider != "" && initBlueprint == "" {
initBlueprint = constants.DEFAULT_OCI_BLUEPRINT_URL
initBlueprint = constants.DefaultOCIBlueprintURL
}

if initBlueprint != "" {
Expand All @@ -661,8 +661,8 @@ func TestInitCmd(t *testing.T) {
t.Errorf("Expected blueprint to be set in context when provider is specified")
} else if blueprint, ok := blueprintCtx.(string); !ok {
t.Errorf("Expected blueprint context value to be a string")
} else if blueprint != constants.DEFAULT_OCI_BLUEPRINT_URL {
t.Errorf("Expected blueprint to be %s, got %s", constants.DEFAULT_OCI_BLUEPRINT_URL, blueprint)
} else if blueprint != constants.DefaultOCIBlueprintURL {
t.Errorf("Expected blueprint to be %s, got %s", constants.DefaultOCIBlueprintURL, blueprint)
}
})

Expand All @@ -678,7 +678,7 @@ func TestInitCmd(t *testing.T) {

// If provider is set and blueprint is not set, set blueprint (covers all providers, including local)
if initProvider != "" && initBlueprint == "" {
initBlueprint = constants.DEFAULT_OCI_BLUEPRINT_URL
initBlueprint = constants.DefaultOCIBlueprintURL
}

if initBlueprint != "" {
Expand Down Expand Up @@ -708,7 +708,7 @@ func TestInitCmd(t *testing.T) {

// Handle deprecated --platform flag and set blueprint
if initPlatform != "" && initProvider == "" && initBlueprint == "" {
initBlueprint = constants.DEFAULT_OCI_BLUEPRINT_URL
initBlueprint = constants.DefaultOCIBlueprintURL
}

if initBlueprint != "" {
Expand All @@ -720,8 +720,8 @@ func TestInitCmd(t *testing.T) {
t.Errorf("Expected blueprint to be set in context when platform is specified")
} else if blueprint, ok := blueprintCtx.(string); !ok {
t.Errorf("Expected blueprint context value to be a string")
} else if blueprint != constants.DEFAULT_OCI_BLUEPRINT_URL {
t.Errorf("Expected blueprint to be %s, got %s", constants.DEFAULT_OCI_BLUEPRINT_URL, blueprint)
} else if blueprint != constants.DefaultOCIBlueprintURL {
t.Errorf("Expected blueprint to be %s, got %s", constants.DefaultOCIBlueprintURL, blueprint)
}
})

Expand All @@ -740,23 +740,23 @@ func TestInitCmd(t *testing.T) {
provider: "",
blueprint: "",
expectedProvider: "local",
expectedBlueprint: constants.DEFAULT_OCI_BLUEPRINT_URL,
expectedBlueprint: constants.DefaultOCIBlueprintURL,
},
{
name: "local-dev context with no flags",
args: []string{"local-dev"},
provider: "",
blueprint: "",
expectedProvider: "local",
expectedBlueprint: constants.DEFAULT_OCI_BLUEPRINT_URL,
expectedBlueprint: constants.DefaultOCIBlueprintURL,
},
{
name: "local context with explicit provider",
args: []string{"local"},
provider: "aws",
blueprint: "",
expectedProvider: "aws",
expectedBlueprint: constants.DEFAULT_OCI_BLUEPRINT_URL,
expectedBlueprint: constants.DefaultOCIBlueprintURL,
},
{
name: "local context with explicit blueprint",
Expand Down Expand Up @@ -790,12 +790,12 @@ func TestInitCmd(t *testing.T) {
// If context is "local" and neither provider nor blueprint is set, set both
if len(tc.args) > 0 && strings.HasPrefix(tc.args[0], "local") && initProvider == "" && initBlueprint == "" {
initProvider = "local"
initBlueprint = constants.DEFAULT_OCI_BLUEPRINT_URL
initBlueprint = constants.DefaultOCIBlueprintURL
}

// If provider is set and blueprint is not set, set blueprint (covers all providers, including local)
if initProvider != "" && initBlueprint == "" {
initBlueprint = constants.DEFAULT_OCI_BLUEPRINT_URL
initBlueprint = constants.DefaultOCIBlueprintURL
}

// If blueprint is set, use it (overrides all)
Expand Down
Loading
Loading