417
418// getServerCA returns a byte slice containing the PEM encoding of the server's CA certificate
419func getServerCA(server *httptest.Server) []byte {
420 bytes := []byte{}421 for i, cert := range server.TLS.Certificates {
422 if i == 0 {
423 continue // Just return the chain, not the leaf server cert
489 splitter := func(c rune) bool {
490 return c == ','
491 }
492 envList := []string{}493 envList = append(envList, strings.FieldsFunc(os.Getenv("NO_PROXY"), splitter)...)
494 envList = append(envList, strings.FieldsFunc(os.Getenv("no_proxy"), splitter)...)
495 envList = append(envList,
568 return nil, err
569 }
570
571 endpoints := []string{}572 return endpoints, json.Unmarshal(data, &endpoints)
573}
574
128 }
129 }
130 }
131 fileList := []string{}132 for _, service := range cmds.ServicesList {
133 logrus.Infof("Rotating certificates for %s service", service)
134 switch service {
88// - The new leaf CA certificates must be verifiable using the same root and intermediate certs as the current leaf CA certificates.
89// - The new service account signing key bundle must include the currently active signing key.
90func validateBootstrap(oldServer, newServer *config.Control) error {
91 errs := []error{} 92
93 // Use reflection to iterate over all of the bootstrap fields, checking files at each of the new paths.
94 oldMeta := reflect.ValueOf(&oldServer.Runtime.ControlRuntimeBootstrap).Elem()
An empty slice can be represented by nil
or an empty slice literal. They are
functionally equivalent — their len
and cap
are both zero — but the nil
slice is the preferred style. For more information about empty slices,
see Declaring Empty Slices.
package main
func foo() {
a := []int{}
}
package main
func foo() {
var a []int
}