-
Notifications
You must be signed in to change notification settings - Fork 612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: improve default_prompt #406
fix: improve default_prompt #406
Conversation
f5bb9a8
to
5cae455
Compare
Signed-off-by: Camilo Giraldo <camigira@gmail.com>
5cae455
to
9e74b6a
Compare
I wonder how the prompt behaves in case there are several errors on an object? Could you please provide an example with this case? |
Signed-off-by: Camilo Giraldo <camigira@gmail.com>
Example for a broken pod and deployment with multiple issues (hope this is what you had in mind with your question) broken-pod.yml apiVersion: v1
kind: Pod
metadata:
name: broken-pod
spec:
containers:
- name: broken-pod
image: nginx:1.a.b.c
livenessProbe:
httpGet:
path: /
port: 90
initialDelaySeconds: 3
periodSeconds: 3 broken-deployment.yml apiVersion: apps/v1
kind: Deployment
metadata:
name: broken-deployment
spec:
replicas: 3
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: myapp
spec:
containers:
- name: nginx-container
image: nginx:latest
ports:
- containerPort: 80
livenessProbe:
httpGet:
path: /healthz #doesn't exist in nginx
port: 80
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /readiness #doesn't exist in nginx
port: 80
initialDelaySeconds: 20
periodSeconds: 5 |
You still have only one error per object. Please try with this object: apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: fake-ingress
spec:
rules:
- host: fake-ingress.example.com
http:
paths:
- backend:
service:
name: fake-service
port:
number: 80
path: /
pathType: Prefix
tls:
- hosts:
- fake-ingress.example.com
secretName: fake-secret You should have this result : 0 k8sgpt/fake-ingress(fake-ingress)
- Error: Ingress k8sgpt/fake-ingress does not specify an Ingress class.
- Error: Ingress uses the service k8sgpt/fake-service which does not exist.
- Error: Ingress uses the secret k8sgpt/fake-secret as a TLS certificate which does not exist. |
Thanks @matthisholleville for providing the example, here the results: Current Default Prompt 0 default/fake-ingress(fake-ingress)
- Error: Ingress default/fake-ingress does not specify an Ingress class.
- Error: Ingress uses the service default/fake-service which does not exist.
- Error: Ingress uses the secret default/fake-secret as a TLS certificate which does not exist.
The Ingress resource is trying to use a service and a TLS certificate that do not exist, and it also does not specify which Ingress class to use.
To fix this error, create the necessary service and secret resources, and specify the Ingress class to use in the Ingress resource. Proposed Default Prompt 0 default/fake-ingress(fake-ingress)
- Error: Ingress default/fake-ingress does not specify an Ingress class.
- Error: Ingress uses the service default/fake-service which does not exist.
- Error: Ingress uses the secret default/fake-secret as a TLS certificate which does not exist.
Error: Ingress default/fake-ingress needs an Ingress class, service default/fake-service doesn't exist, and secret default/fake-secret is a non-existent TLS cert.
Solution:
1. Create a service named default/fake-service.
2. Create a secret named default/fake-secret with your TLS cert.
3. Add an ingress class to your Ingress resource, like nginx or traefik.
4. Update your Ingress resource to use the service and secret created in step 1 and 2. |
I really like the solution part @camigira but the error part in the prompt seems redondant. What do you think @AlexsJones ? |
I think as long as it yields the outputs that are clear and understandable to the user its good. |
👋 @AlexsJones @matthisholleville I saw this PR was approved but there are still unresolved conversations. Should I mark as completed and merge? Thanks! |
📑 Description
(closes: #417)
Attempt to improve the
default_prompt
aiming to:-
.Original Prompt
![image](https://private-user-images.githubusercontent.com/7347011/238170931-4d5e9c64-7d9e-415a-8352-f66356a5a4e2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1NjAzMzYsIm5iZiI6MTcyNDU2MDAzNiwicGF0aCI6Ii83MzQ3MDExLzIzODE3MDkzMS00ZDVlOWM2NC03ZDllLTQxNWEtODM1Mi1mNjYzNTZhNWE0ZTIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQU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aWQ9MCZyZXBvX2lkPTAifQ.btefHEAKZfiX219Foampg9JmxaQ-fKQvAO7GeZ4TnK8)
Note: After a few tests, the text
Provide the most possible solution
seemed to be better thanProvide the most likely solution
as it explored multiple options as opposed to focusing the answer on a single option.✅ Checks
ℹ Additional Information