mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: update controller-runtime package to v0.9.2
This commit updates controller-runtime to v0.9.2 and makes changes in persistentvolume.go to add context to various functions and function calls made here instead of context.TODO(). Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
48
vendor/gopkg.in/yaml.v3/parserc.go
generated
vendored
48
vendor/gopkg.in/yaml.v3/parserc.go
generated
vendored
@ -648,6 +648,10 @@ func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, i
|
||||
implicit: implicit,
|
||||
style: yaml_style_t(yaml_BLOCK_MAPPING_STYLE),
|
||||
}
|
||||
if parser.stem_comment != nil {
|
||||
event.head_comment = parser.stem_comment
|
||||
parser.stem_comment = nil
|
||||
}
|
||||
return true
|
||||
}
|
||||
if len(anchor) > 0 || len(tag) > 0 {
|
||||
@ -694,25 +698,13 @@ func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_e
|
||||
|
||||
if token.typ == yaml_BLOCK_ENTRY_TOKEN {
|
||||
mark := token.end_mark
|
||||
prior_head := len(parser.head_comment)
|
||||
prior_head_len := len(parser.head_comment)
|
||||
skip_token(parser)
|
||||
yaml_parser_split_stem_comment(parser, prior_head_len)
|
||||
token = peek_token(parser)
|
||||
if token == nil {
|
||||
return false
|
||||
}
|
||||
if prior_head > 0 && token.typ == yaml_BLOCK_SEQUENCE_START_TOKEN {
|
||||
// [Go] It's a sequence under a sequence entry, so the former head comment
|
||||
// is for the list itself, not the first list item under it.
|
||||
parser.stem_comment = parser.head_comment[:prior_head]
|
||||
if len(parser.head_comment) == prior_head {
|
||||
parser.head_comment = nil
|
||||
} else {
|
||||
// Copy suffix to prevent very strange bugs if someone ever appends
|
||||
// further bytes to the prefix in the stem_comment slice above.
|
||||
parser.head_comment = append([]byte(nil), parser.head_comment[prior_head+1:]...)
|
||||
}
|
||||
|
||||
}
|
||||
if token.typ != yaml_BLOCK_ENTRY_TOKEN && token.typ != yaml_BLOCK_END_TOKEN {
|
||||
parser.states = append(parser.states, yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE)
|
||||
return yaml_parser_parse_node(parser, event, true, false)
|
||||
@ -754,7 +746,9 @@ func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *y
|
||||
|
||||
if token.typ == yaml_BLOCK_ENTRY_TOKEN {
|
||||
mark := token.end_mark
|
||||
prior_head_len := len(parser.head_comment)
|
||||
skip_token(parser)
|
||||
yaml_parser_split_stem_comment(parser, prior_head_len)
|
||||
token = peek_token(parser)
|
||||
if token == nil {
|
||||
return false
|
||||
@ -780,6 +774,32 @@ func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *y
|
||||
return true
|
||||
}
|
||||
|
||||
// Split stem comment from head comment.
|
||||
//
|
||||
// When a sequence or map is found under a sequence entry, the former head comment
|
||||
// is assigned to the underlying sequence or map as a whole, not the individual
|
||||
// sequence or map entry as would be expected otherwise. To handle this case the
|
||||
// previous head comment is moved aside as the stem comment.
|
||||
func yaml_parser_split_stem_comment(parser *yaml_parser_t, stem_len int) {
|
||||
if stem_len == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
token := peek_token(parser)
|
||||
if token.typ != yaml_BLOCK_SEQUENCE_START_TOKEN && token.typ != yaml_BLOCK_MAPPING_START_TOKEN {
|
||||
return
|
||||
}
|
||||
|
||||
parser.stem_comment = parser.head_comment[:stem_len]
|
||||
if len(parser.head_comment) == stem_len {
|
||||
parser.head_comment = nil
|
||||
} else {
|
||||
// Copy suffix to prevent very strange bugs if someone ever appends
|
||||
// further bytes to the prefix in the stem_comment slice above.
|
||||
parser.head_comment = append([]byte(nil), parser.head_comment[stem_len+1:]...)
|
||||
}
|
||||
}
|
||||
|
||||
// Parse the productions:
|
||||
// block_mapping ::= BLOCK-MAPPING_START
|
||||
// *******************
|
||||
|
Reference in New Issue
Block a user