Skip to content
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

Promote ApigeeInstance to v1beta1 #3599

Conversation

jasonvigil
Copy link
Collaborator

No description provided.

@jasonvigil
Copy link
Collaborator Author

/hold need to rebase after #3593 merges

@jasonvigil jasonvigil force-pushed the apigee-instance-promote branch 4 times, most recently from ff7f570 to 43a5bde Compare February 4, 2025 23:04
@jasonvigil jasonvigil force-pushed the apigee-instance-promote branch from 43a5bde to 14bdd1b Compare February 5, 2025 03:23
@jasonvigil
Copy link
Collaborator Author

/hold cancel

@@ -24,7 +24,7 @@ var ApigeeEnvgroupGVK = GroupVersion.WithKind("ApigeeEnvgroup")

type Parent struct {
// +required
OrganizationRef *refv1alpha1.ApigeeOrganizationRef `json:"organizationRef"`
OrganizationRef *refs.ApigeeOrganizationRef `json:"organizationRef"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should move the ApigeeOrganizationRef to apis/apigee? So version promotion do not need to change the import, and we can have different versions for ApigeeOrganizationRef

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do, in a follow-up PR.

@@ -19,7 +19,7 @@ import (
"fmt"
"strings"

refs "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1alpha1"
refs "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do, in a follow-up PR.

@@ -89,6 +89,7 @@ func addResourceConfig(t *testing.T, smLoader *servicemappingloader.ServiceMappi
func IsPureDirectResource(gk schema.GroupKind) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maqiuyujoyce Could you confirm if we still need this hack with the removal of the service mapping ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created #3614 to track this improvement

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My change in #3443 didn't touch this hack so yes, let's still use it to avoid potential issues.

@jasonvigil filed an issue #3614 (thank you, Jason) and I'll take a look at it later.

@@ -65,6 +65,7 @@
[missing_field] crd=alloydbinstances.alloydb.cnrm.cloud.google.com version=v1beta1: field ".spec.networkConfig.authorizedExternalNetworks[].cidrRange" is not set in unstructured objects
[missing_field] crd=alloydbusers.alloydb.cnrm.cloud.google.com version=v1beta1: field ".spec.databaseRoles[]" is not set in unstructured objects
[missing_field] crd=apigeeenvgroups.apigee.cnrm.cloud.google.com version=v1beta1: field ".spec.hostnames[]" is not set in unstructured objects
[missing_field] crd=apigeeinstances.apigee.cnrm.cloud.google.com version=v1beta1: field ".spec.consumerAcceptList[]" is not set in unstructured objects
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will leave the field uncovered (and does not meet the exit criteria). Can we fix the code to make the CRD check pass? cc @acpana

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, this test appears to be broken #3571. @acpana can you please help fix this?

Copy link
Collaborator

@yuwenma yuwenma Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update method misses 5 fields (are they all immutable? I don't see the immutable marker in the API). Something like Description, DisplayName, KMSKey seems to be mutable. Even if they are not, it could be a better UX to tell users why those fields are not updated by checking all the changed fields. Because users need to get this information to fix their config.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experiments, the API does not support changing these fields. Are you suggesting we should allow user to attempt to change them anyway, and return the error from GCP?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't make it clear. We can either "allow user to attempt to change them anyway, and return the error from GCP" or add the check in the controller. The advantage for the former is that the users can get the exact error message from GCP and once GCP changes the behavior KCC does not need to update the code. The disadvantage is repeated reconcile failures (which may not be too bad).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, I agree. Will make the change

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok updated

@yuwenma
Copy link
Collaborator

yuwenma commented Feb 5, 2025

/approve

A few nits for better UX and maintenance.

Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yuwenma

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jasonvigil jasonvigil force-pushed the apigee-instance-promote branch from 14bdd1b to dccaa03 Compare February 5, 2025 23:47
@jasonvigil jasonvigil requested a review from yuwenma February 6, 2025 15:07
@yuwenma
Copy link
Collaborator

yuwenma commented Feb 6, 2025

/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Feb 6, 2025
@google-oss-prow google-oss-prow bot merged commit 0a48b49 into GoogleCloudPlatform:master Feb 6, 2025
18 checks passed
@@ -12,14 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package v1alpha1
package v1beta1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I think this bit me in #3605

@jasonvigil jasonvigil deleted the apigee-instance-promote branch February 7, 2025 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants