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
1 change: 1 addition & 0 deletions api/v1alpha1/environment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type EnvironmentStatus struct {
// Environment is the Schema for the environments API
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Active\")].status"
// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type==\"Active\")].reason"
// +kubebuilder:printcolumn:name="Description",type="string",JSONPath=".status.conditions[?(@.type==\"Active\")].message"
type Environment struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ spec:
- jsonPath: .status.conditions[?(@.type=="Active")].reason
name: Reason
type: string
- jsonPath: .status.conditions[?(@.type=="Active")].message
name: Description
type: string
name: v1alpha1
schema:
openAPIV3Schema:
Expand Down
12 changes: 10 additions & 2 deletions internal/controller/environment_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,16 @@ func (r EnvironmentReconciler) releaseJob(environment *etosv1alpha1.Environment,
corev1.ResourceCPU: resource.MustParse("100m"),
},
},
Command: []string{"python", "-u", "-m", "environment_provider.environment"},
Args: []string{environment.Name},
Env: []corev1.EnvVar{
{
Name: "REQUEST",
Value: environmentRequest.Name,
},
{
Name: "ENVIRONMENT",
Value: environment.Name,
},
},
},
},
},
Expand Down
18 changes: 18 additions & 0 deletions internal/etos/etos.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,24 @@ func (r *ETOSDeployment) role(name types.NamespacedName, labelName string) *rbac
"create", "get", "list", "watch", "delete",
},
},
{
APIGroups: []string{"batch"},
Resources: []string{
"jobs",
},
Verbs: []string{
"create", "get", "list", "watch", "delete",
},
},
{
APIGroups: []string{""},
Resources: []string{
"pods",
},
Verbs: []string{
"get", "list", "watch",
},
},
},
}
}
Expand Down