Skip to content

Commit

Permalink
Merge pull request kata-containers#10426 from 3u13r/fix/genpolicy/han…
Browse files Browse the repository at this point in the history
…dle-config-map-binary-data

genpolicy: read binaryData value as String
  • Loading branch information
sprt authored Oct 15, 2024
2 parents f9b7a8a + c06bf2e commit c371b4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tools/genpolicy/src/config_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ pub struct ConfigMap {
#[serde(skip_serializing_if = "Option::is_none")]
pub data: Option<BTreeMap<String, String>>,

// When parsing a YAML file, binaryData is encoded as base64.
// Therefore, this is a BTreeMap<String, String> instead of BTreeMap<String, Vec<u8>>.
#[serde(skip_serializing_if = "Option::is_none")]
pub binaryData: Option<BTreeMap<String, Vec<u8>>>,
pub binaryData: Option<BTreeMap<String, String>>,

#[serde(skip_serializing_if = "Option::is_none")]
immutable: Option<bool>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ data:
data-1: value-1
data-2: value-2
data-3: value-3
binaryData:
bin-data-1: YmluLXZhbHVlLTE=
bin-data-2: YmluLXZhbHVlLTI=
bin-data-3: YmluLXZhbHVlLTM=

0 comments on commit c371b4e

Please sign in to comment.