Last active
August 31, 2020 13:57
-
-
Save isutton/61e20b4034207ef065821246df6ab3a4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func loadDescriptor(anns map[string]string, path string, descriptor string, root string) { | |
if !strings.HasPrefix(descriptor, "binding:") { | |
return | |
} | |
n := annotations.ServiceBindingOperatorAnnotationPrefix + root + "." + path | |
v := strings.Split(descriptor, ":") | |
if descriptor == "binding:env:attribute" { | |
// treat here | |
} else if strings.HasPrefix(descriptor, "binding:env:") { | |
if len(v) > 4 { | |
n = n + "-" + v[4] | |
anns[n] = strings.Join(v[0:4], ":") | |
} | |
if len(v) == 4 { | |
anns[n] = strings.Join(v[0:4], ":") | |
} | |
} | |
if strings.HasPrefix(descriptor, "binding:volumemount:") { | |
anns[n] = strings.Join(v[0:3], ":") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment