@@ -249,7 +249,7 @@ public function whereNamespace($namespace)
249
249
/**
250
250
* Get the namespace for the resource.
251
251
*
252
- * @return void
252
+ * @return string
253
253
*/
254
254
public function getNamespace ()
255
255
{
@@ -567,7 +567,7 @@ public function refreshOriginal(array $query = ['pretty' => 1])
567
567
*
568
568
* @param Closure $callback
569
569
* @param array $query
570
- * @return void
570
+ * @return mixed
571
571
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesWatchException
572
572
*/
573
573
public function watchAll (Closure $ callback , array $ query = ['pretty ' => 1 ])
@@ -593,7 +593,7 @@ public function watchAll(Closure $callback, array $query = ['pretty' => 1])
593
593
*
594
594
* @param Closure $callback
595
595
* @param array $query
596
- * @return void
596
+ * @return mixed
597
597
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesWatchException
598
598
*/
599
599
public function watch (Closure $ callback , array $ query = ['pretty ' => 1 ])
@@ -619,7 +619,8 @@ public function watch(Closure $callback, array $query = ['pretty' => 1])
619
619
*
620
620
* @param Closure $callback
621
621
* @param array $query
622
- * @return void
622
+ * @return mixed
623
+ * @throws \RenokiCo\PhpK8s\Exceptions\KubernetesWatchException
623
624
*/
624
625
public function watchByName (string $ name , Closure $ callback , array $ query = ['pretty ' => 1 ])
625
626
{
@@ -630,7 +631,7 @@ public function watchByName(string $name, Closure $callback, array $query = ['pr
630
631
* Get a specific resource's logs.
631
632
*
632
633
* @param array $query
633
- * @return \RenokiCo\PhpK8s\Kinds\K8sResource
634
+ * @return string
634
635
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesWatchException
635
636
*/
636
637
public function logs (array $ query = ['pretty ' => 1 ])
@@ -651,24 +652,54 @@ public function logs(array $query = ['pretty' => 1])
651
652
);
652
653
}
653
654
655
+ /**
656
+ * Get logs for a specific container.
657
+ *
658
+ * @param string $container
659
+ * @param array $query
660
+ * @return string
661
+ * @throws \RenokiCo\PhpK8s\Exceptions\KubernetesWatchException
662
+ */
663
+ public function containerLogs (string $ container , array $ query = ['pretty ' => 1 ])
664
+ {
665
+ return $ this ->logs (array_merge ($ query , ['container ' => $ container ]));
666
+ }
667
+
654
668
/**
655
669
* Watch the specific resource by name.
656
670
*
671
+ * @param string $name
657
672
* @param Closure $callback
658
673
* @param array $query
659
- * @return void
674
+ * @return string
675
+ * @throws \RenokiCo\PhpK8s\Exceptions\KubernetesWatchException
660
676
*/
661
- public function logsByName (array $ query = ['pretty ' => 1 ])
677
+ public function logsByName (string $ name , array $ query = ['pretty ' => 1 ])
662
678
{
663
679
return $ this ->whereName ($ name )->logs ($ query );
664
680
}
665
681
682
+ /**
683
+ * Watch the specific resource by name.
684
+ *
685
+ * @param string $name
686
+ * @param string $container
687
+ * @param Closure $callback
688
+ * @param array $query
689
+ * @return string
690
+ * @throws \RenokiCo\PhpK8s\Exceptions\KubernetesWatchException
691
+ */
692
+ public function containerLogsByName (string $ name , string $ container , array $ query = ['pretty ' => 1 ])
693
+ {
694
+ return $ this ->logsByName ($ name , array_merge ($ query , ['container ' => $ container ]));
695
+ }
696
+
666
697
/**
667
698
* Watch the specific resource's logs until the closure returns true or false.
668
699
*
669
700
* @param Closure $callback
670
701
* @param array $query
671
- * @return void
702
+ * @return mixed
672
703
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesWatchException
673
704
*/
674
705
public function watchLogs (Closure $ callback , array $ query = ['pretty ' => 1 ])
@@ -692,15 +723,45 @@ public function watchLogs(Closure $callback, array $query = ['pretty' => 1])
692
723
);
693
724
}
694
725
726
+ /**
727
+ * Watch the specific resource's container logs until the closure returns true or false.
728
+ *
729
+ * @param string $container
730
+ * @param Closure $callback
731
+ * @param array $query
732
+ * @return mixed
733
+ * @throws \RenokiCo\PhpK8s\Exceptions\KubernetesWatchException
734
+ */
735
+ public function watchContainerLogs (string $ container , Closure $ callback , array $ query = ['pretty ' => 1 ])
736
+ {
737
+ return $ this ->watchLogs ($ callback , array_merge ($ query , ['container ' => $ container ]));
738
+ }
739
+
695
740
/**
696
741
* Watch the specific resource's logs by name.
697
742
*
698
743
* @param Closure $callback
699
744
* @param array $query
700
- * @return void
745
+ * @return mixed
746
+ * @throws \RenokiCo\PhpK8s\Exceptions\KubernetesWatchException
701
747
*/
702
748
public function watchLogsByName (string $ name , Closure $ callback , array $ query = ['pretty ' => 1 ])
703
749
{
704
750
return $ this ->whereName ($ name )->watchLogs ($ callback , $ query );
705
751
}
752
+
753
+ /**
754
+ * Watch the specific resource's container logs by names.
755
+ *
756
+ * @param string $name
757
+ * @param string $container
758
+ * @param Closure $callback
759
+ * @param array $query
760
+ * @return mixed
761
+ * @throws \RenokiCo\PhpK8s\Exceptions\KubernetesWatchException
762
+ */
763
+ public function watchContainerLogsByName (string $ name , string $ container , Closure $ callback , array $ query = ['pretty ' => 1 ])
764
+ {
765
+ return $ this ->watchLogsByName ($ name , $ callback , array_merge ($ query , ['container ' => $ container ]));
766
+ }
706
767
}
0 commit comments