-
Notifications
You must be signed in to change notification settings - Fork 65
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
Added IngressClass objects support #117 #132
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Varun1300211 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @Varun1300211! |
Hi @Varun1300211. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/easycla |
/ok-to-test |
Thanks @Varun1300211 ! I will probably look at it tomorrow. In the meantime, can you:
Thanks! |
Done all the changes requested by you @LiorLieberman, please let me know if anything else is required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Varun1300211 and welcome!
I left a few comments regarding some things that need to be taken into account.
If you have any questions or need any help feel free to let us know
@Varun1300211: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Hi @levikobi, I made the changes suggested by you. Please take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again @Varun1300211!
I think it may help you to try playing around with the tool for a bit and see the different options it provides. Afterwards maybe try to compile your version and see what changes/breaks.
This new addition needs to take into account different options the user may pass.
switch extension { | ||
case "yaml": | ||
err = yaml.Unmarshal(data, ingressClasses) | ||
case "json": | ||
err = json.Unmarshal(data, ingressClasses) | ||
default: | ||
return nil, fmt.Errorf("unsupported file type: %s", extension) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I missed something but it seems like you're always sending an empty slice of data
func init() { | ||
|
||
config, err := rest.InClusterConfig() | ||
if err != nil { | ||
log.Fatal(errors.New("unable to create config")) | ||
} | ||
|
||
k8sClientset, err = kubernetes.NewForConfig(config) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This init function will always try to create a k8s client, even if the user doesn't have a cluster and want to convert some local file.
You'll need to pass the user's choice of where he wants to read resources from (cluster or file) and the k8s client, which was initialized in the i2gw package.
@Varun1300211 Just checking in, please let us know if you need any help with moving this forward |
@Varun1300211 a friendly ping, are you still planning to work on this? |
What type of PR is this?
This pull request implements IngressClass support.
Add one of the following kinds:
/kind feature
What this PR does / why we need it:
It retrieves the default IngressClass based on its API group (networking.k8s.io) and a dedicated annotation (ingressclass.kubernetes.io/is-default-class).
If no explicit IngressClass is specified in the Ingress object or via annotation, the default class is used for resource processing.
Which issue(s) this PR fixes:
Fixes #117
Does this PR introduce a user-facing change?:
Please do let me know if it was done in the correct way.