-
Notifications
You must be signed in to change notification settings - Fork 22
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
removed optional annotation from non-optional fields #427
Open
deepakm-ntnx
wants to merge
1
commit into
main
Choose a base branch
from
jira/krbn-8094
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The original purpose was that if prismCentralInfo is not present, prismCentralInfo including credentials of the prism central on which management cluster is running will be used. If it is provided, the credentials were mandatory because you can't just expect credentials of one prism central to work on another. The switchover of these two conditions with that context is rather confusing to me and the motivation for doing so unclear.
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.
ok but per public docs, thats what is expected https://opendocs.nutanix.com/capx/v1.3.x/credential_management/. if you dont provide then use creds of controller and if given then use overridden ones.
also per type def https://github.com/nutanix-cloud-native/prism-go-client/blob/main/environment/credentials/types.go#L130 its specified as optional as well
we can debate separately on the confusing part of this from user perspective but this is the designed behavior at this time in my understanding. cc @yannickstruyf3
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.
IMO, in that case, it's the documentation that should be fixed; not the code to match unclear documentation. My understanding of what this change was originally supposed to be was to make credentials always mandatory and do away with optional credentials behavior. This PR is no longer doing what the original PR was doing.
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.
We have following cases:
Controller manager uses PC 1 with creds for user1/pwd1
Workload Cluster 2 needs to be created on same pc PC 1 with different user as controller used
Here prismCentral section is required with same pc endpoint but different user creds secret referred thru CredentialRef
Workload Cluster 3 needs to be created on PC 2 with different user from that PC
Here prismCentral section is required with pc2 endpoint and different user from that PC
Are you proposing that we should not support bullet 1, option 1 and 2 and make option 3 available?
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.
For the sake of this comment, I'll refer to the three unnamed bullet cases above as a, b, and c (in the order they appear).
a. Current implementation entails either 1 or 3 can be used to satisfy this requirement.
b. Current implementation entails only 3 can be used to satisfy this requirement.
c. Current implementation entails only 3 can be used to satisfy this requirement.
To be more explicit, 2 has never been a supported mechanism. To that extent, we even have explicit E2E test cases to ensure new changes don't accidentally change the behavior to support 2 and remove support for 1.
cluster-api-provider-nutanix/test/e2e/nutanix_client_test.go
Lines 75 to 129 in 74c5d33
cluster-api-provider-nutanix/test/e2e/nutanix_client_test.go
Lines 134 to 176 in 74c5d33
Now for the proposal of removing support for 1. I was under the impression that this was originally your proposal. This is what the original PR #400 was doing. It entailed removing the optionality of relying on "defaults" altogether. I highlighted this in a comment on the original PR #400 (comment). It was a breaking change but that was something I could get behind as it simplifies the controller by ensuring credentials and prism central are always required for each cluster.
I am advocating for one of these two (using alpha (ɑ) and beta (β) as we're now running out of bullet indexes):
ɑ. leave things as is: i.e. prism central info stays optional; if it's left blank, prism central info and credentials are taken from default CAPX config. If the prism central info is specified, credentials have to be explicitly provided.
β. make both mandatory: no more clusters relying on default prism central and credentials i.e. remove support for 1. This is what #400 was doing.
Between ɑ and β, I personally lean towards β.
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.
The first comment made by @thunderboltsid explains the initial intent of the code. The documentation can be modified to reflect the same.