Skip to content

Conversation

@wafuwafu13
Copy link
Contributor

@wafuwafu13 wafuwafu13 commented May 25, 2025

Issue # (if applicable)

Closes #34148

Reason for this change

Currently, objectName is required so we can't retrieve some values from cluster without objectName like kubectl get pod -o jsonpath={.apiVersion}.

/**
* The name of the object to query.
*/
readonly objectName: string;

Description of changes

Describe any new or updated permissions being added

When objectName is not provided, pass the default --all-namespaces=false argument which has no effect.

Description of how you validated changes

Pass unit tests

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added admired-contributor [Pilot] contributed between 13-24 PRs to the CDK bug This issue is a bug. effort/medium Medium work item – several days of effort p2 labels May 25, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team May 25, 2025 10:46
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter fails with the following errors:

❌ Features must contain a change to a README file.
❌ Features must contain a change to an integration test file and the resulting snapshot.

If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.

✅ A exemption request has been requested. Please wait for a maintainer's review.

@wafuwafu13
Copy link
Contributor Author

Exemption Request

Unit tests exist

@aws-cdk-automation aws-cdk-automation added pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels May 26, 2025
@aemada-aws aemada-aws self-assigned this Jun 17, 2025
@aemada-aws
Copy link
Contributor

aemada-aws commented Jun 17, 2025

Exemption Request

Unit tests exist

It still needs an integ test because building an invalid command would cause deployment to fail, which the integ test catches but the unit test does not.

ClusterName: props.cluster.clusterName,
ObjectType: props.objectType,
ObjectName: props.objectName,
ObjectName: props.objectName ?? '--all-namespaces=false',
Copy link
Contributor

@aemada-aws aemada-aws Jun 17, 2025

Choose a reason for hiding this comment

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

We shouldn't "hack" the parameter by passing a flag or an empty string in place of ObjectName, instead we should handle the case of ObjectName not being provided in the custom resource at:

output = wait_for_output(['get', '-n', object_namespace, object_type, object_name, "-o=jsonpath='{{{0}}}'".format(json_path)], int(timeout_seconds))

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 17, 2025
@aemada-aws aemada-aws changed the title fix(eks): make objectName optional in KubernetesObjectValue fix(eks-v2-alpha): make objectName optional in KubernetesObjectValue Jun 17, 2025
@aemada-aws
Copy link
Contributor

aemada-aws commented Jun 17, 2025

we should make this pr a feat not a fix because technically we are not fixing a bug but rather allowing extra functionality.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 955aac1
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@wafuwafu13 wafuwafu13 changed the title fix(eks-v2-alpha): make objectName optional in KubernetesObjectValue feat(eks-v2-alpha): make objectName optional in KubernetesObjectValue Jul 6, 2025
@wafuwafu13 wafuwafu13 marked this pull request as draft July 6, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

admired-contributor [Pilot] contributed between 13-24 PRs to the CDK bug This issue is a bug. effort/medium Medium work item – several days of effort p2 pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(aws-eks): kubectl objectName is required by CDK, but not always by kubectl get

3 participants