Skip to content

Commit dbcf8fd

Browse files
authored
Merge pull request #476 from NetApp/bugfix-double-b64-encoding
Bugfix: Double base64 encoding of cloud provider credentials
2 parents a0f94df + aca9808 commit dbcf8fd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pkg/cloud/vsphere/actuators/cluster/actuator.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package cluster
1818

1919
import (
20-
"encoding/base64"
2120
"fmt"
2221
"net/url"
2322
"strconv"
@@ -217,16 +216,16 @@ func (a *Actuator) reconcileCloudConfigSecret(ctx *context.ClusterContext) error
217216
ctx.Logger.Error(err, "target cluster is not ready")
218217
return &clusterErr.RequeueAfterError{RequeueAfter: config.DefaultRequeue}
219218
}
220-
// Define the kubeconfig secret for the target cluster.
219+
// Define the cloud provider credentials secret for the target cluster.
221220
secret := &apiv1.Secret{
222221
ObjectMeta: metav1.ObjectMeta{
223222
Namespace: constants.CloudProviderSecretNamespace,
224223
Name: constants.CloudProviderSecretName,
225224
},
226225
Type: apiv1.SecretTypeOpaque,
227226
StringData: map[string]string{
228-
fmt.Sprintf("%s.username", ctx.ClusterConfig.Server): base64.StdEncoding.EncodeToString([]byte(ctx.User())),
229-
fmt.Sprintf("%s.password", ctx.ClusterConfig.Server): base64.StdEncoding.EncodeToString([]byte(ctx.Pass())),
227+
fmt.Sprintf("%s.username", ctx.ClusterConfig.Server): ctx.User(),
228+
fmt.Sprintf("%s.password", ctx.ClusterConfig.Server): ctx.Pass(),
230229
},
231230
}
232231
if _, err := client.Secrets(constants.CloudProviderSecretNamespace).Create(secret); err != nil {

0 commit comments

Comments
 (0)