Skip to content

Commit

Permalink
removed "todo" comments
Browse files Browse the repository at this point in the history
  • Loading branch information
manedurphy committed Jul 30, 2022
1 parent bf19a1d commit a87f94d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
1 change: 0 additions & 1 deletion controllers/secretproviderclasspodstatus_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ func (r *SecretProviderClassPodStatusReconciler) Reconcile(ctx context.Context,
errs := make([]error, 0)
for _, secretObj := range spc.Spec.SecretObjects {
secretName := strings.TrimSpace(secretObj.SecretName)
// TODO (manedurphy) can we migrate the configuration for the secret type to be in just syncOptions?
secretType := secretutil.GetSecretType(strings.TrimSpace(secretObj.Type), secretName, spc.Spec.SyncOptions)
jsonPath := secretutil.GetJsonPath(secretName, spc.Spec.SyncOptions)
secretFormat, err := secretutil.GetSecretFormat(secretName, spc.Spec.SyncOptions)
Expand Down
14 changes: 1 addition & 13 deletions pkg/util/secretutil/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,6 @@ func ValidateSecretObject(secretObj secretsstorev1.SecretObject) error {
if len(secretObj.SecretName) == 0 {
return fmt.Errorf("secret name is empty")
}
// TODO (manedurphy) remove this because we are determining the secret type between the secret object & sync options
// if len(secretObj.Type) == 0 {
// return fmt.Errorf("secret type is empty")
// }
if len(secretObj.Data) == 0 {
return fmt.Errorf("data is empty")
}
Expand Down Expand Up @@ -223,7 +219,7 @@ func GetSecretData(secretObjData []*secretsstorev1.SecretObjectData, secretType
case string:
valBytes = []byte(val)
default:
// TODO (manedurphy) Describe the behavior here
// we can marshal non-string types to get unquoted values as well as handle nested objects
if valBytes, err = json.Marshal(val); err != nil {
return datamap, fmt.Errorf("failed to marshal value %v, err: %w", val, err)
}
Expand All @@ -243,14 +239,6 @@ func GetSecretData(secretObjData []*secretsstorev1.SecretObjectData, secretType
}
datamap[dataKey] = c
}
// TODO (manedurphy) handle basic auth data, perhaps differently
// if secretType == corev1.SecretTypeBasicAuth {
// username, password := getBasicAuthCredentials(content)
// delete(datamap, dataKey)

// datamap[basicAuthUsername] = []byte(username)
// datamap[basicAuthPassword] = []byte(password)
// }
}
}
return datamap, nil
Expand Down

0 comments on commit a87f94d

Please sign in to comment.