Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/druid/adapters/cli/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func init() {
PushCommand.Flags().BoolVarP(&pushSmart, "smart", "s", false, "Indicates, if the scroll is able to run as a smart deployment (Will be added as a manifest annotation gg.druid.scroll.smart)")
PushCommand.Flags().StringVar(&pushCategory, "category", pushCategory, "Category of the scroll. (Will be added as a manifest annotation gg.druid.scroll.category)")
PushCommand.Flags().StringVarP(&pushImage, "image", "i", pushImage, "Image to use for the scroll. (Will be added as a manifest annotation gg.druid.scroll.image)")
PushCommand.Flags().StringSliceVarP(&pushScrollPorts, "port", "p", pushScrollPorts, "Ports to expose. Format webserver=80, dns=53/udp or just ftp (Will be added as a manifest annotation gg.druid.scroll.ports.<name>)")
PushCommand.Flags().StringSliceVarP(&pushScrollPorts, "port", "p", pushScrollPorts, "Ports to expose. Format webserver=80, dns=53/udp or just minecraft (Will be added as a manifest annotation gg.druid.scroll.ports.<name>)")
PushCommand.Flags().BoolVarP(&pushPackMeta, "pack-meta", "m", pushPackMeta, "Pack the meta folder into the scroll.")
PushCommand.PersistentFlags().BoolVar(&pushDisableTarReproducible, "no-tar-reproducible", false, "Preserve file timestamps in pushed tar layers.")
}
14 changes: 13 additions & 1 deletion test/integration/kubernetes/kubernetes_cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func TestKubernetesBackendCLIComplexLifecycle(t *testing.T) {
deadline := time.Now().Add(30 * time.Second)
var statuses []e2e.RuntimePortStatus
for time.Now().Before(deadline) {
_ = e2e.WaitHTTP(t, fmt.Sprintf("http://127.0.0.1:%d/index.txt", localPort))
requestServiceFromRuntimePod(t, namespace, pvc, fixture.ServeProc, target.ServiceName, fixture.Port)
time.Sleep(1 * time.Second)
statuses = e2e.RunClientJSON[[]e2e.RuntimePortStatus](t, bins, socket, "ports", created.ID)
if status, ok := findRuntimePortStatus(statuses, fixture); ok && status.Source == "kubernetes-pod-stats" && status.RXBytes != nil && status.TXBytes != nil && status.TrafficBytes != nil && *status.TrafficBytes > 0 && status.TrafficOK != nil && *status.TrafficOK {
Expand Down Expand Up @@ -127,6 +127,18 @@ func TestKubernetesBackendCLIComplexLifecycle(t *testing.T) {
waitKubernetesResourcesGone(t, namespace, pvc, "service")
}

func requestServiceFromRuntimePod(t *testing.T, namespace string, pvc string, procedure string, service string, port int) {
t.Helper()
selector := "app.kubernetes.io/managed-by=druid,druid.gg/scroll-id=" + pvc + ",druid.gg/procedure=" + procedure
pod, err := kubectlOutput("get", "pod", "-n", namespace, "-l", selector, "-o", "jsonpath={.items[0].metadata.name}")
if err != nil {
t.Fatalf("get runtime pod: %v: %s", err, pod)
}
if out, err := kubectlOutput("exec", "-n", namespace, strings.TrimSpace(pod), "--", "wget", "-qO-", fmt.Sprintf("http://%s:%d/index.txt", service, port)); err != nil {
t.Fatalf("request runtime service: %v: %s", err, out)
}
}

func requireKubernetes(t *testing.T) {
t.Helper()
e2e.RequireCommand(t, "kubectl")
Expand Down
Loading