Skip to content

Commit

Permalink
fix(logagent): use get to download log file
Browse files Browse the repository at this point in the history
  • Loading branch information
yiwenshao authored and tke-robot committed Sep 10, 2020
1 parent 47ab08f commit d7b2b86
Show file tree
Hide file tree
Showing 15 changed files with 243 additions and 725 deletions.
2 changes: 1 addition & 1 deletion api/logagent/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&LogAgentProxyOptions{},
&LogFileTree{},
&LogFileContent{},
&LogFileDownload{},
&LogFileProxyOptions{},
&ConfigMap{},
&ConfigMapList{},
)
Expand Down
17 changes: 5 additions & 12 deletions api/logagent/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,26 +152,19 @@ type LogFileContentSpec struct {
Filepath string `json:"filepath,omitempty"`
}



// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// LogFileDownload
type LogFileDownload struct {
// LogFileProxyOptions is the query options to a kube-apiserver proxy call for Logfile requests.
type LogFileProxyOptions struct {
metav1.TypeMeta `json:",inline"`
Spec LogFileDownloadSpec `json:"spec"`
}

type LogFileDownloadSpec struct {
ClusterId string `json:"clusterId,omitempty"`
Namespace string `json:"namespace,omitempty"`
Container string `json:"container,omitempty"`
Pod string `json:"pod,omitempty"`
Start int32 `json:"start,omitempty"`
Length int32 `json:"length,omitempty"`
Filepath string `json:"filepath,omitempty"`
Container string `json:"container,omitempty"`
}



// +genclient
// +genclient:nonNamespaced
// +genclient:skipVerbs=deleteCollection
Expand Down
491 changes: 96 additions & 395 deletions api/logagent/v1/generated.pb.go

Large diffs are not rendered by default.

20 changes: 4 additions & 16 deletions api/logagent/v1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/logagent/v1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&LogAgentProxyOptions{},
&LogFileTree{},
&LogFileContent{},
&LogFileDownload{},
&LogFileProxyOptions{},
&ConfigMap{},
&ConfigMapList{},
)
Expand Down
15 changes: 4 additions & 11 deletions api/logagent/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,20 +141,13 @@ type LogFileContentSpec struct {

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// LogFileDownload
type LogFileDownload struct {
// LogFileProxyOptions is the query options to a kube-apiserver proxy call for LogFile requests.
type LogFileProxyOptions struct {
metav1.TypeMeta `json:",inline"`
Spec LogFileDownloadSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"`
}

type LogFileDownloadSpec struct {
ClusterId string `json:"clusterId,omitempty" protobuf:"bytes,1,opt,name=clusterId"`
Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"`
Namespace string `json:"namespace,omitempty" protobuf:"bytes,1,opt,name=namespace"`
Pod string `json:"pod,omitempty" protobuf:"bytes,2,opt,name=pod"`
Container string `json:"container,omitempty" protobuf:"bytes,3,opt,name=container"`
Pod string `json:"pod,omitempty" protobuf:"bytes,4,opt,name=pod"`
Start int32 `json:"start,omitempty" protobuf:"varint,5,opt,name=start"`
Length int32 `json:"length,omitempty" protobuf:"varint,6,opt,name=length"`
Filepath string `json:"filepath,omitempty" protobuf:"bytes,7,opt,name=filepath"`
}

// +genclient
Expand Down
8 changes: 4 additions & 4 deletions api/logagent/v1/types_swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 14 additions & 56 deletions api/logagent/v1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 5 additions & 22 deletions api/logagent/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 5 additions & 22 deletions api/logagent/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d7b2b86

Please sign in to comment.