Skip to content

Commit

Permalink
fix knative envoyfilter
Browse files Browse the repository at this point in the history
Signed-off-by: DavidSpek <[email protected]>
  • Loading branch information
davidspek committed Sep 9, 2022
1 parent e432ce5 commit a99665f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions apis/kubeflow.org/v1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ limitations under the License.
*/

// Package v1 contains API Schema definitions for the v1 API group
//+kubebuilder:object:generate=true
//+groupName=kubeflow.org
// +kubebuilder:object:generate=true
// +groupName=kubeflow.org
package v1

import (
Expand Down
4 changes: 2 additions & 2 deletions apis/kubeflow.org/v1beta1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ limitations under the License.
*/

// Package v1beta1 contains API Schema definitions for the v1beta1 API group
//+kubebuilder:object:generate=true
//+groupName=kubeflow.org
// +kubebuilder:object:generate=true
// +groupName=kubeflow.org
package v1beta1

import (
Expand Down
4 changes: 2 additions & 2 deletions apis/kubeflow.org/v2alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ limitations under the License.
*/

// Package v2alpha1 contains API Schema definitions for the kubeflow.org v2alpha1 API group
//+kubebuilder:object:generate=true
//+groupName=kubeflow.org
// +kubebuilder:object:generate=true
// +groupName=kubeflow.org
package v2alpha1

import (
Expand Down
4 changes: 2 additions & 2 deletions apis/platform/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ limitations under the License.
*/

// Package v1alpha1 contains API Schema definitions for the platform v1alpha1 API group
//+kubebuilder:object:generate=true
//+groupName=platform.kubeflow.org
// +kubebuilder:object:generate=true
// +groupName=platform.kubeflow.org
package v1alpha1

import (
Expand Down
10 changes: 6 additions & 4 deletions controllers/kubeflow.org/profile_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,11 @@ func (r *ProfileReconciler) generatePeerAuthentication(profileIns *profilev2alph

func (r *ProfileReconciler) generateEnvoyFilter(profileIns *profilev2alpha1.Profile) *istioNetworkingClientv1alpha3.EnvoyFilter {

luaString := fmt.Sprintf(`function envoy_on_request(request_handle)
headers = request_handle:headers()
request_handle:headers():replace("kubeflow-request-source-namespace", "%s")
end`, profileIns.Name)

envoyfilter := &istioNetworkingClientv1alpha3.EnvoyFilter{

ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -1137,10 +1142,7 @@ func (r *ProfileReconciler) generateEnvoyFilter(profileIns *profilev2alpha1.Prof
},
"inline_code": {
Kind: &structpb.Value_StringValue{
StringValue: `function envoy_on_request(request_handle)
headers = request_handle:headers()
request_handle:headers():replace("kubeflow-request-source-namespace", "david")
end`,
StringValue: luaString,
},
},
},
Expand Down

0 comments on commit a99665f

Please sign in to comment.