Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 28 for Marshall (0.18 sec)

  1. istioctl/pkg/util/proto/messageslice.go

    // limitations under the License.
    
    package proto
    
    import (
    	"bytes"
    
    	"google.golang.org/protobuf/proto"
    
    	"istio.io/istio/pkg/util/protomarshal"
    )
    
    // MessageSlice allows us to marshal slices of protobuf messages like clusters/listeners/routes/endpoints correctly
    type MessageSlice []proto.Message
    
    // MarshalJSON handles marshaling of slices of proto messages
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Tue Oct 19 21:53:59 GMT 2021
    - 1.3K bytes
    - Viewed (0)
  2. istioctl/pkg/writer/ztunnel/configdump/services.go

    		if r := cmp.Compare(a.Name, b.Name); r != 0 {
    			return r
    		}
    		return cmp.Compare(a.Hostname, b.Hostname)
    	})
    	out, err := json.MarshalIndent(svcs, "", "    ")
    	if err != nil {
    		return fmt.Errorf("failed to marshal workloads: %v", err)
    	}
    	if outputFormat == "yaml" {
    		if out, err = yaml.JSONToYAML(out); err != nil {
    			return err
    		}
    	}
    	fmt.Fprintln(c.Stdout, string(out))
    	return nil
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Tue Apr 23 21:30:30 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  3. istioctl/pkg/waypoint/waypoint.go

    		RunE: func(cmd *cobra.Command, args []string) error {
    			gw, err := makeGateway(false)
    			if err != nil {
    				return fmt.Errorf("failed to create gateway: %v", err)
    			}
    			b, err := yaml.Marshal(gw)
    			if err != nil {
    				return err
    			}
    			// strip junk
    			res := strings.ReplaceAll(string(b), `  creationTimestamp: null
    `, "")
    			res = strings.ReplaceAll(res, `status: {}
    `, "")
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Mon Apr 22 20:20:40 GMT 2024
    - 15K bytes
    - Viewed (0)
  4. cni/pkg/nodeagent/cni-watcher_test.go

    	}
    
    	payload, _ := json.Marshal(valid)
    
    	addEvent, err := processAddEvent(payload)
    
    	assert.NoError(t, err)
    	assert.Equal(t, valid, addEvent)
    }
    
    func TestProcessAddEventBadPayload(t *testing.T) {
    	valid := CNIPluginAddEvent{
    		Netns:        "/var/netns/foo",
    		PodName:      "pod-bingo",
    		PodNamespace: "funkyns",
    	}
    
    	payload, _ := json.Marshal(valid)
    
    	invalid := string(payload) + "funkyjunk"
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Feb 02 08:18:40 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  5. cni/pkg/install/kubeconfig.go

    	}
    
    	lcfg, err := latest.Scheme.ConvertToVersion(kcfg, latest.ExternalVersion)
    	if err != nil {
    		return kubeconfig{}, err
    	}
    	// Convert to v1 schema which has proper encoding
    	fullYaml, err := yaml.Marshal(lcfg)
    	if err != nil {
    		return kubeconfig{}, err
    	}
    
    	// Log with redaction
    	if err := api.RedactSecrets(kcfg); err != nil {
    		return kubeconfig{}, err
    	}
    	for _, c := range kcfg.Clusters {
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Aug 11 01:19:03 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  6. cni/pkg/plugin/cnieventclient.go

    	}
    	// Currently we only use the netns from the original CNI event
    	addEvent := nodeagent.CNIPluginAddEvent{Netns: event.Netns, PodName: podName, PodNamespace: podNamespace, IPs: ncconfigs}
    	eventData, err := json.Marshal(addEvent)
    	if err != nil {
    		return err
    	}
    	var response *http.Response
    	response, err = cniClient.client.Post(cniClient.url, "application/json", bytes.NewBuffer(eventData))
    	if err != nil {
    		return err
    	}
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 2.4K bytes
    - Viewed (0)
  7. istioctl/pkg/workload/workload.go

    	iSpec, err := unstructureIstioType(spec)
    	if err != nil {
    		return nil, err
    	}
    	u.Object["spec"] = iSpec
    
    	wgYAML, err := yaml.Marshal(u.Object)
    	if err != nil {
    		return nil, err
    	}
    	return wgYAML, nil
    }
    
    func configureCommand(ctx cli.Context) *cobra.Command {
    	var opts clioptions.ControlPlaneOptions
    
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Wed Apr 17 20:06:41 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  8. cni/pkg/util/pluginutil.go

    	plugin, ok := rawPlugin.(map[string]any)
    	if !ok {
    		err = fmt.Errorf("error reading plugin from CNI config plugin list")
    		return
    	}
    	return
    }
    
    // Marshal the CNI config map and append a new line
    func MarshalCNIConfig(cniConfigMap map[string]any) ([]byte, error) {
    	cniConfig, err := json.MarshalIndent(cniConfigMap, "", "  ")
    	if err != nil {
    		return nil, err
    	}
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  9. istioctl/pkg/util/configdump/wrapper.go

    		return msg.ProtoReflect().Type(), nil
    	}
    	return typ, nil
    }
    
    // Wrapper is a wrapper around the Envoy ConfigDump
    // It has extra helper functions for handling any/struct/marshal protobuf pain
    type Wrapper struct {
    	*admin.ConfigDump
    }
    
    // UnmarshalJSON is a custom unmarshaller to handle protobuf pain
    func (w *Wrapper) UnmarshalJSON(b []byte) error {
    	cd := &admin.ConfigDump{}
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Sun Apr 21 17:42:54 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  10. istioctl/pkg/wait/wait_test.go

    	cannedResponseObj := []xds.SyncedVersions{
    		{
    			ProxyID:         "foo",
    			ClusterVersion:  "1",
    			ListenerVersion: "1",
    			RouteVersion:    "1",
    			EndpointVersion: "1",
    		},
    	}
    	cannedResponse, _ := json.Marshal(cannedResponseObj)
    	cannedResponseMap := map[string][]byte{"onlyonepilot": cannedResponse}
    
    	distributionTrackingDisabledResponse := xds.DistributionTrackingDisabledMessage
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Mar 15 08:28:50 GMT 2024
    - 6.8K bytes
    - Viewed (0)
Back to top