mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-04 10:03:42 +08:00 
			
		
		
		
	new driver: kubernetes
Tested with `kind` and GKE. Note: "nodes" shown in `docker buildx ls` are unrelated to Kubernetes "nodes". Probably buildx should come up with an alternative term. Usage: $ kind create cluster $ export KUBECONFIG="$(kind get kubeconfig-path --name="kind")" $ docker buildx create --driver kubernetes --driver-opt replicas=3 --use $ docker buildx build -t foo --load . `--load` loads the image into the local Docker. Driver opts: - `image=IMAGE` - Sets the container image to be used for running buildkit. - `namespace=NS` - Sets the Kubernetes namespace. Defaults to the current namespace. - `replicas=N` - Sets the number of `Pod` replicas. Defaults to 1. - `rootless=(true|false)` - Run the container as a non-root user without `securityContext.privileged`. Defaults to false. - `loadbalance=(sticky|random)` - Load-balancing strategy. If set to "sticky", the pod is chosen using the hash of the context path. Defaults to "sticky" Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
		
							
								
								
									
										15
									
								
								vendor/github.com/golang/protobuf/proto/pointer_unsafe.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										15
									
								
								vendor/github.com/golang/protobuf/proto/pointer_unsafe.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -85,16 +85,21 @@ func toPointer(i *Message) pointer {
 | 
			
		||||
 | 
			
		||||
// toAddrPointer converts an interface to a pointer that points to
 | 
			
		||||
// the interface data.
 | 
			
		||||
func toAddrPointer(i *interface{}, isptr bool) pointer {
 | 
			
		||||
func toAddrPointer(i *interface{}, isptr, deref bool) (p pointer) {
 | 
			
		||||
	// Super-tricky - read or get the address of data word of interface value.
 | 
			
		||||
	if isptr {
 | 
			
		||||
		// The interface is of pointer type, thus it is a direct interface.
 | 
			
		||||
		// The data word is the pointer data itself. We take its address.
 | 
			
		||||
		return pointer{p: unsafe.Pointer(uintptr(unsafe.Pointer(i)) + ptrSize)}
 | 
			
		||||
		p = pointer{p: unsafe.Pointer(uintptr(unsafe.Pointer(i)) + ptrSize)}
 | 
			
		||||
	} else {
 | 
			
		||||
		// The interface is not of pointer type. The data word is the pointer
 | 
			
		||||
		// to the data.
 | 
			
		||||
		p = pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]}
 | 
			
		||||
	}
 | 
			
		||||
	// The interface is not of pointer type. The data word is the pointer
 | 
			
		||||
	// to the data.
 | 
			
		||||
	return pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]}
 | 
			
		||||
	if deref {
 | 
			
		||||
		p.p = *(*unsafe.Pointer)(p.p)
 | 
			
		||||
	}
 | 
			
		||||
	return p
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// valToPointer converts v to a pointer. v must be of pointer type.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user