Skip to content

bug: fix returned error message #690

@senglezou

Description

@senglezou

Currently the following return error message can be misleading when it occurs in k8s logs/describe command https://github.com/syntasso/kratix/blob/main/util/git/ssh.go#L189:

func newSSHAuthCreds(stateStoreSpec v1alpha1.GitStateStoreSpec, creds map[string][]byte) (*sshAuthCreds, error) {
	sshPrivateKey, ok := creds["sshPrivateKey"]
	namespace := stateStoreSpec.SecretRef.Namespace
	name := stateStoreSpec.SecretRef.Name
	if !ok {
		return nil, fmt.Errorf("sshKey not found in secret %s/%s", namespace, name)
	}
	........
}

We should use return nil, fmt.Errorf("sshPrivateKey not found in secret %s/%s", namespace, name) instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions