Skip to content

Commit

Permalink
removing stripping as it broke autogenerated passwords for some reason
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jul 15, 2024
1 parent 0b53aae commit 6514348
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 1 addition & 5 deletions operator/user/observe.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ func (u *userClient) Observe(ctx context.Context, mg resource.Managed) (managed.
return managed.ExternalObservation{}, err
}

// this here prevents painful user errors with password generation using bash shell and `echo`
// if You want to use `echo` to generate a password, use `echo -n` to prevent adding a newline
strippedFromNewline := strings.ReplaceAll(string(secret.Data[AccessKeyName]), "\n", "")

err = u.ma.SetUser(ctx, string(secret.Data[AccessKeyName]), strippedFromNewline, madmin.AccountEnabled)
err = u.ma.SetUser(ctx, string(secret.Data[AccessKeyName]), string(secret.Data[SecretKeyName]), madmin.AccountEnabled)
if err != nil {
return managed.ExternalObservation{}, err
}
Expand Down
8 changes: 7 additions & 1 deletion test/e2e/upload-object.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ access_key=$(kubectl -n "${secret_namespace}" get secret "${secret_name}" -o jso
secret_key=$(kubectl -n "${secret_namespace}" get secret "${secret_name}" -o jsonpath='{.data.AWS_SECRET_ACCESS_KEY}' | base64 -d)
export MC_HOST_minio=http://${access_key}:${secret_key}@${endpoint}

"${GOBIN}/mc" cp --quiet "${file_path}" "minio/${bucket_name}"
echo "Uploading object to bucket: ${bucket_name}"
echo "File path: ${file_path}"
echo "Endpoint: ${endpoint}"
echo "Access key: ${access_key}"
echo "Secret key: ${secret_key}"

"${GOBIN}/mc" cp --quiet --debug "${file_path}" "minio/${bucket_name}"

0 comments on commit 6514348

Please sign in to comment.