Skip to content

Commit

Permalink
Reverting the change to use as user arg: dev-mode instead of staticPa…
Browse files Browse the repository at this point in the history
…ssword which is only used internally

Signed-off-by: cmoulliard <[email protected]>
  • Loading branch information
cmoulliard committed Dec 12, 2024
1 parent dbf56c2 commit d029f62
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
14 changes: 7 additions & 7 deletions api/v1alpha1/localbuild_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ type PackageConfigsSpec struct {

// BuildCustomizationSpec fields cannot change once a cluster is created
type BuildCustomizationSpec struct {
Protocol string `json:"protocol,omitempty"`
Host string `json:"host,omitempty"`
IngressHost string `json:"ingressHost,omitempty"`
Port string `json:"port,omitempty"`
UsePathRouting bool `json:"usePathRouting,omitempty"`
SelfSignedCert string `json:"selfSignedCert,omitempty"`
StaticPasswords bool `json:"staticPasswords,omitempty"`
Protocol string `json:"protocol,omitempty"`
Host string `json:"host,omitempty"`
IngressHost string `json:"ingressHost,omitempty"`
Port string `json:"port,omitempty"`
UsePathRouting bool `json:"usePathRouting,omitempty"`
SelfSignedCert string `json:"selfSignedCert,omitempty"`
StaticPassword bool `json:"staticPasswords,omitempty"`
}

type LocalbuildSpec struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,5 +280,5 @@ func isBuildCustomizationSpecEqual(s1, s2 v1alpha1.BuildCustomizationSpec) bool
s1.Port == s2.Port &&
s1.UsePathRouting == s2.UsePathRouting &&
s1.SelfSignedCert == s2.SelfSignedCert &&
s1.StaticPasswords == s2.StaticPasswords
s1.StaticPassword == s2.StaticPassword
}
18 changes: 9 additions & 9 deletions pkg/cmd/create/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
const (
recreateClusterUsage = "Delete cluster first if it already exists."
buildNameUsage = "Name for build (Prefix for kind cluster name, pod names, etc)."
staticPasswordsUsage = "Set a static password: developer to the applications: argocd and gitea."
devModeUsage = "Set the password \"developer\" for the admin user of the applications: argocd & gitea."
kubeVersionUsage = "Version of the kind kubernetes cluster to create."
extraPortsMappingUsage = "List of extra ports to expose on the docker container and kubernetes cluster as nodePort " +
"(e.g. \"22:32222,9090:39090,etc\")."
Expand All @@ -41,7 +41,7 @@ var (
// Flags
recreateCluster bool
buildName string
staticPasswords bool
devMode bool
kubeVersion string
extraPortsMapping string
kindConfigPath string
Expand Down Expand Up @@ -69,7 +69,7 @@ func init() {
CreateCmd.PersistentFlags().StringVar(&buildName, "build-name", "localdev", buildNameUsage)
CreateCmd.PersistentFlags().MarkDeprecated("build-name", "use --name instead.")
CreateCmd.PersistentFlags().StringVar(&buildName, "name", "localdev", buildNameUsage)
CreateCmd.PersistentFlags().BoolVar(&staticPasswords, "static-passwords", false, staticPasswordsUsage)
CreateCmd.PersistentFlags().BoolVar(&devMode, "dev-mode", false, devModeUsage)
CreateCmd.PersistentFlags().StringVar(&kubeVersion, "kube-version", "v1.30.3", kubeVersionUsage)
CreateCmd.PersistentFlags().StringVar(&extraPortsMapping, "extra-ports", "", extraPortsMappingUsage)
CreateCmd.PersistentFlags().StringVar(&kindConfigPath, "kind-config", "", kindConfigPathUsage)
Expand Down Expand Up @@ -141,12 +141,12 @@ func create(cmd *cobra.Command, args []string) error {
ExtraPortsMapping: extraPortsMapping,

TemplateData: v1alpha1.BuildCustomizationSpec{
Protocol: protocol,
Host: host,
IngressHost: ingressHost,
Port: port,
UsePathRouting: pathRouting,
StaticPasswords: staticPasswords,
Protocol: protocol,
Host: host,
IngressHost: ingressHost,
Port: port,
UsePathRouting: pathRouting,
StaticPassword: devMode,
},

CustomPackageDirs: absDirPaths,
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/gitrepository/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (r *RepositoryReconciler) reconcileGitRepo(ctx context.Context, repo *v1alp
return ctrl.Result{}, fmt.Errorf("getting git provider credentials: %w", err)
}

if r.Config.StaticPasswords {
if r.Config.StaticPassword {
creds.password = "developer"
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/controllers/localbuild/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ func (r *LocalbuildReconciler) Reconcile(ctx context.Context, req ctrl.Request)
}
}

if r.Config.StaticPasswords {
logger.V(1).Info("StaticPasswords is enabled")
if r.Config.StaticPassword {
logger.V(1).Info("Dev mode is enabled")

// Check if the Argocd Initial admin secret exists
argocdInitialAdminPassword, err := r.extractArgocdInitialAdminSecret(ctx)
Expand All @@ -123,7 +123,7 @@ func (r *LocalbuildReconciler) Reconcile(ctx context.Context, req ctrl.Request)
if err != nil {
return ctrl.Result{}, err
} else {
logger.Info(fmt.Sprintf("Argocd admin password change %s !", argocdPasswordChangeStatus))
logger.V(1).Info(fmt.Sprintf("Argocd admin password change %s !", argocdPasswordChangeStatus))
}
}

Expand All @@ -141,7 +141,7 @@ func (r *LocalbuildReconciler) Reconcile(ctx context.Context, req ctrl.Request)
if err != nil {
return ctrl.Result{}, err
} else {
logger.Info(fmt.Sprintf("Gitea admin password change %s !", giteaPasswordChangeStatus))
logger.V(1).Info(fmt.Sprintf("Gitea admin password change %s !", giteaPasswordChangeStatus))
}
}
}
Expand Down

0 comments on commit d029f62

Please sign in to comment.