diff --git a/docs/docs/30-installation/02-options.md b/docs/docs/30-installation/02-options.md index 932036f13..c5901fe0d 100644 --- a/docs/docs/30-installation/02-options.md +++ b/docs/docs/30-installation/02-options.md @@ -140,5 +140,5 @@ acorn install --propagate-project-annotation "" When you are installing Acorn, you can specify a profile to use. A profile is a set of installation flag defaults that are pre-defined. You can see the list of available profiles by running `acorn install --help`. The default profile is `default`, and it is used if no profile is specified. :::note -Once a profile is set, this will set new default values based on the profile. Any default values previously used will be switched to the new profile defaults. However, any install flags that were specified, or have specified, will still be respected. +Once a profile is set, this will set new default values based on the profile. Any default values previously used will be switched to the new profile defaults. However, any install flags that were or are specified will still be respected. ::: \ No newline at end of file diff --git a/pkg/autoupgrade/daemon.go b/pkg/autoupgrade/daemon.go index be6dd80fc..e15dce83b 100644 --- a/pkg/autoupgrade/daemon.go +++ b/pkg/autoupgrade/daemon.go @@ -88,7 +88,7 @@ func StartSync(ctx context.Context, client kclient.Client) { func (d *daemon) sync(ctx context.Context, now time.Time) (time.Duration, error) { logrus.Debugf("Performing auto-upgrade sync") - defaultNextCheckInterval, _ := time.ParseDuration(profiles.DefaultImageCheckIntervalDefault) + defaultNextCheckInterval, _ := time.ParseDuration(profiles.AutoUpgradeIntervalDefault) cfg, err := d.client.getConfig(ctx) if err != nil { return defaultNextCheckInterval, err @@ -96,7 +96,7 @@ func (d *daemon) sync(ctx context.Context, now time.Time) (time.Duration, error) // cfg.AutoUpgradeInterval will never be nil here because config.Get will set a default. if cfgNextCheckInterval, err := time.ParseDuration(*cfg.AutoUpgradeInterval); err != nil { - logrus.Warnf("Error parsing auto-upgrade interval in config %s is invalid, using default of %s: %v", *cfg.AutoUpgradeInterval, profiles.DefaultImageCheckIntervalDefault, err) + logrus.Warnf("Error parsing auto-upgrade interval in config %s is invalid, using default of %s: %v", *cfg.AutoUpgradeInterval, profiles.AutoUpgradeIntervalDefault, err) } else { defaultNextCheckInterval = cfgNextCheckInterval } diff --git a/pkg/profiles/default.go b/pkg/profiles/default.go index 59eb631f6..7fda3bf25 100644 --- a/pkg/profiles/default.go +++ b/pkg/profiles/default.go @@ -13,11 +13,11 @@ var ( // LetsEncryptOptionDefault is the default state for the Let's Encrypt integration LetsEncryptOptionDefault = "disabled" - // DefaultImageCheckIntervalDefault is the default value for the DefaultImageCheckInterval field - DefaultImageCheckIntervalDefault = "5m" + // AutoUpgradeIntervalDefault is the default value for the DefaultImageCheckInterval field + AutoUpgradeIntervalDefault = "5m" - // Default HttpEndpointPattern set to enable Let's Encrypt - DefaultHttpEndpointPattern = "{{hashConcat 8 .Container .App .Namespace | truncate}}.{{.ClusterDomain}}" + // HttpEndpointPatternDefault is a pattern that works with Let's Encrypt + HttpEndpointPatternDefault = "{{hashConcat 8 .Container .App .Namespace | truncate}}.{{.ClusterDomain}}" // Features FeatureImageAllowRules = "image-allow-rules" @@ -30,13 +30,13 @@ func defaultProfile() apiv1.Config { return apiv1.Config{ AcornDNS: ptr(AcornDNSStateDefault), AcornDNSEndpoint: ptr(AcornDNSEndpointDefault), - AutoUpgradeInterval: ptr(DefaultImageCheckIntervalDefault), + AutoUpgradeInterval: ptr(AutoUpgradeIntervalDefault), AWSIdentityProviderARN: new(string), BuilderPerProject: new(bool), CertManagerIssuer: new(string), EventTTL: new(string), Features: FeatureDefaults, - HttpEndpointPattern: ptr(DefaultHttpEndpointPattern), + HttpEndpointPattern: ptr(HttpEndpointPatternDefault), IgnoreUserLabelsAndAnnotations: new(bool), IngressClassName: new(string), IngressControllerNamespace: new(string), diff --git a/pkg/publish/ingress.go b/pkg/publish/ingress.go index de7eb61b4..68292407b 100644 --- a/pkg/publish/ingress.go +++ b/pkg/publish/ingress.go @@ -71,7 +71,7 @@ func toHTTPEndpointHostname(pattern, domain, container, appName, appNamespace st // This should not happen since the pattern in the config (passed to this through pattern) should // always be set to the default if the pattern is "". However,if it is not somehow, set it here. if pattern == "" { - pattern = profiles.DefaultHttpEndpointPattern + pattern = profiles.HttpEndpointPatternDefault } endpointOpts := struct { diff --git a/pkg/publish/ingress_test.go b/pkg/publish/ingress_test.go index 9510990ae..41e81b2bd 100644 --- a/pkg/publish/ingress_test.go +++ b/pkg/publish/ingress_test.go @@ -197,7 +197,7 @@ func TestToEndpoint(t *testing.T) { args: args{ domain: "custom-domain.io", serviceName: "app-name-that-is-very-long-and-should-cause-issues", - pattern: profiles.DefaultHttpEndpointPattern, + pattern: profiles.HttpEndpointPatternDefault, appInstance: &v1.AppInstance{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{Name: "green-star", Namespace: "namespace"}, diff --git a/pkg/system/resources.go b/pkg/system/resources.go index 40308f856..92daff812 100644 --- a/pkg/system/resources.go +++ b/pkg/system/resources.go @@ -23,10 +23,7 @@ func ValidateResources(resources ...string) error { req, limit, both := strings.Cut(rs, ":") if !both { _, err := resource.ParseQuantity(rs) - if err != nil { - return err - } - return nil + return err } parsedReq, err := resource.ParseQuantity(req)