Skip to content

Commit

Permalink
Combine CAPIProvider variables witin secret with defaults
Browse files Browse the repository at this point in the history
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
  • Loading branch information
Danil-Grigorev committed Oct 21, 2024
1 parent 77cac4c commit d51a159
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion internal/sync/secret_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"cmp"
"context"
"encoding/base64"
"maps"
"strconv"

corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -106,7 +107,7 @@ func (s *SecretSync) SyncObjects() {

func setVariables(capiProvider *turtlesv1.CAPIProvider) {
if capiProvider.Spec.Variables != nil {
capiProvider.Status.Variables = capiProvider.Spec.Variables
maps.Copy(capiProvider.Status.Variables, capiProvider.Spec.Variables)
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/data/capi-operator/capa-variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
apiVersion: v1
kind: Secret
metadata:
name: full-variables
name: aws
namespace: capa-system
type: Opaque
stringData:
Expand Down

0 comments on commit d51a159

Please sign in to comment.