Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions internal/gatewayapi/resource/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ func loadKubernetesYAMLToResources(input []byte, addMissingResources bool) (*Res
case KindSecret:
typedData := data.Interface()
typedStringData := stringData.Interface()
secretType := kobjVal.FieldByName("Type")
typedSecretType := secretType.Interface()
Comment thread
arminabf marked this conversation as resolved.
Outdated

secret := &corev1.Secret{
TypeMeta: metav1.TypeMeta{
Kind: KindSecret,
Expand All @@ -323,6 +326,7 @@ func loadKubernetesYAMLToResources(input []byte, addMissingResources bool) (*Res
Name: name,
Namespace: namespace,
},
Type: typedSecretType.(corev1.SecretType),
Data: typedData.(map[string][]byte),
StringData: typedStringData.(map[string]string),
}
Expand Down
9 changes: 9 additions & 0 deletions internal/gatewayapi/resource/testdata/all-resources.in.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,15 @@ stringData:
secret: "literal value"
---
apiVersion: v1
kind: Secret
metadata:
name: secret-with-type
namespace: default
type: "type value"
data:
.secret-file: dmFsdWUtMg0KDQo=
---
apiVersion: v1
kind: ConfigMap
metadata:
name: configmap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,14 @@ secrets:
namespace: default
stringData:
secret: literal value
- data:
.secret-file: dmFsdWUtMg0KDQo=
kind: Secret
metadata:
creationTimestamp: null
name: secret-with-type
namespace: default
type: type value
securityPolicies:
- kind: SecurityPolicy
metadata:
Expand Down