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

feat(sdk): added sanitizing k8s object process and test. Fixes: #332 #345

Merged
merged 6 commits into from Nov 2, 2020

Conversation

jizg
Copy link
Contributor

@jizg jizg commented Oct 27, 2020

Which issue is resolved by this Pull Request:
Resolves #332

Description of your changes:
Added process and testcases for recursively sanitizing k8s container object type based on the kubernetes.client.models definition. Currently primitive types of string, integer, boolean, list of string are all the types included in kubernetes.client.models.V1Container and its children attributes.

Environment tested:

  • Python Version (use python --version): 3.7.7
  • Tekton Version (use tkn version): 0.13.1
  • Kubernetes Version (use kubectl version): v1.16.15
  • OS (e.g. from /etc/os-release): Ubuntu 18.04

Checklist:

  • The title for your pull request (PR) should follow our title convention. Learn more about the pull request title convention used in this repository.

    PR titles examples:

    • fix(frontend): fixes empty page. Fixes #1234
      Use fix to indicate that this PR fixes a bug.
    • feat(backend): configurable service account. Fixes #1234, fixes #1235
      Use feat to indicate that this PR adds a new feature.
    • chore: set up changelog generation tools
      Use chore to indicate that this PR makes some changes that users don't need to know.
    • test: fix CI failure. Part of #1234
      Use part of to indicate that a PR is working on an issue, but shouldn't close the issue when merged.
  • Do you want this pull request (PR) cherry-picked into the current release branch?

    If yes, use one of the following options:

    • (Recommended.) Ask the PR approver to add the cherrypick-approved label to this PR. The release manager adds this PR to the release branch in a batch update.
    • After this PR is merged, create a cherry-pick PR to add these changes to the release branch. (For more information about creating a cherry-pick PR, see the Kubeflow Pipelines release guide.)

@google-cla
Copy link

google-cla bot commented Oct 27, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@kubeflow-bot
Copy link

This change is Reviewable

@jizg jizg changed the title feat(sdk): added sanitizing k8s object process and test. Fixes: #322 feat(sdk): added sanitizing k8s object process and test. Fixes: #332 Oct 27, 2020
@jizg
Copy link
Contributor Author

jizg commented Oct 27, 2020

@googlebot I signed it!

@google-cla
Copy link

google-cla bot commented Oct 27, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@jizg
Copy link
Contributor Author

jizg commented Oct 27, 2020

@Tomcli How to sign CLA? Shall I choose contribution on behalf of your Employer?

@google-cla
Copy link

google-cla bot commented Oct 27, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla
Copy link

google-cla bot commented Oct 27, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla
Copy link

google-cla bot commented Oct 27, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@drewbutlerbb4
Copy link
Member

Hi @jizg there is a process that you need to follow to join the IBM Google CLA group before you are covered under the CLA. I have sent you a slack message with the IBM internal link to the instructions.

@Tomcli
Copy link
Member

Tomcli commented Oct 27, 2020

Thanks @jizg for your contribution. This PR looks good to me. We can approve this PR once you signed the cla.

@jizg
Copy link
Contributor Author

jizg commented Oct 29, 2020

I have raised a request to join IBM contributor google group, and it should be soon to sign the CLA.

@jizg
Copy link
Contributor Author

jizg commented Oct 30, 2020

@googlebot I signed it!

@google-cla
Copy link

google-cla bot commented Oct 30, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@jizg
Copy link
Contributor Author

jizg commented Oct 30, 2020

@googlebot I signed it!

@jizg
Copy link
Contributor Author

jizg commented Oct 30, 2020

@Tomcli I've signed the CLA. Would you please check whether it's ok to merge this PR? Thanks

@Tomcli
Copy link
Member

Tomcli commented Oct 30, 2020

thanks @jizg
/lgtm



def _to_str(s):
return None if s is None else str(s)
Copy link
Member

Choose a reason for hiding this comment

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

Thanks @jizg, quick question. Is there a reason we need to check for None here? Doesn't this get checked in sanitize_k8s_object? Or are there plans to use _to_str () outside this file in the future?

Copy link
Contributor Author

@jizg jizg Oct 31, 2020

Choose a reason for hiding this comment

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

You are right, '_to_str()' is not necessary now. I firstly did the 'None' type check in '_to_str()', and then moved the check to sanitize_k8s_object but forgot to remove '_to_str()'. I have updated the codes. Thanks @drewbutlerbb4 .

@k8s-ci-robot k8s-ci-robot removed the lgtm label Oct 31, 2020
@drewbutlerbb4
Copy link
Member

Thanks @jizg
/lgtm

@Tomcli
Copy link
Member

Tomcli commented Nov 2, 2020

thanks @jizg
/lgtm
/approve

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jizg, Tomcli

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

@k8s-ci-robot k8s-ci-robot merged commit 3d3ecfb into kubeflow:master Nov 2, 2020
jizg added a commit to jizg/kfp-tekton that referenced this pull request Nov 3, 2020
…sanitizing-k8s-objects

* commit '3d3ecfb05fc13f400d4aec5ee5a0ca9b13b1566f':
  feat(sdk): added sanitizing k8s object process and test. Fixes: kubeflow#332 (kubeflow#345)
  add a warning label to kustomize page (kubeflow#350)
  make user guide prominent (kubeflow#349)
  feat(backend): ARTIFACT_COPY_STEP_TEMPLATE - custom template for copy step (kubeflow#336)
  Add KFP Tekton release deployment yaml (kubeflow#347)
  Fix UI merge conflict that blocks the UI image build. (kubeflow#346)
  KFP 1.0.4 Rebase (kubeflow#337)
  fix(sdk): Quick fix for sanitizing conditional variables (kubeflow#344)
  fix(backend): cover nil status race condition from Tekton (kubeflow#329)
  updated titanic-ml generated with kale 0.5.1 (kubeflow#330)
  Add s3 endpoint instructions for admin use case (kubeflow#323)
  Add best practice for tekton and other argo executors (kubeflow#338)
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.

Sanitizing Kubernetes resources into strings
5 participants