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

Update Kanctl to Create profile with secret CredentialType #369

Merged
merged 4 commits into from
Nov 5, 2019

Conversation

SupriyaKasten
Copy link
Contributor

Change Overview

Update Kanctl to Create profile with secret CredentialType

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Issues

  • #XXX

Test Plan

 kanctl create profile s3compliant --bucket ssk-test --access-key ${AWS_ACCESS_KEY_ID} --secret-key ${AWS_SECRET_ACCESS_KEY}               --region us-west-2   --namespace supriya -R "ValidRolel"  --dry-run 
apiVersion: v1
kind: Secret
metadata:
  creationTimestamp: null
  name: s3-secret-6q4c58
  namespace: supriya
stringData:
  access_key_id: ValidID
  role: validRole
  secret_access_key: ValidKey
---
apiVersion: cr.kanister.io/v1alpha1
credential:
  keyPair: null
  secret:
    apiVersion: ""
    group: ""
    kind: ""
    name: s3-secret-6q4c58
    namespace: supriya
    resource: ""
  type: secret
kind: Profile
location:
  bucket: ssk-test
  endpoint: ""
  prefix: ""
  region: us-west-2
  type: s3Compliant
metadata:
  creationTimestamp: null
  generateName: s3-profile-
  namespace: supriya
skipSSLVerify: false
  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf(secretFormat, secretname, randString(6)),
Namespace: lP.namespace,
},
StringData: data,
}, nil
}
if roleKey != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't this specific to S3?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently we validate the profile to check for SecretType when credentialType = "Secret" and role != ""

@mergify mergify bot merged commit a5f0bd5 into master Nov 5, 2019
@mergify mergify bot deleted the kanctl-profile-role branch November 5, 2019 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants