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

Propagate kubeconfigs to e2e Pod #1951

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions hack/.ci/lib/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ function run-e2e {
kubectl -n=scylla-manager patch --field-manager="${FIELD_MANAGER}" deployment/scylla-manager-controller --type=json -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--loglevel=4"}]'
kubectl -n=scylla-manager rollout status deployment/scylla-manager-controller

kubectl create -n=e2e secret generic kubeconfigs ${KUBECONFIGS[@]/#/--from-file=} --dry-run=client -o=yaml | kubectl_create -f=-
kubeconfigs_in_container_path=$( IFS=','; basenames=( "${KUBECONFIGS[@]##*/}" ) && in_container_paths="${basenames[@]/#//var/run/secrets/kubeconfigs/}" && echo "${in_container_paths[*]}" )

gcs_sa_in_container_path=""
if [[ -n "${SO_GCS_SERVICE_ACCOUNT_CREDENTIALS_PATH+x}" ]]; then
gcs_sa_in_container_path=/var/run/secrets/gcs-service-account-credentials/gcs-service-account.json
Expand Down Expand Up @@ -248,6 +251,7 @@ spec:
- scylla-operator-tests
- run
- "${SO_SUITE}"
- "--kubeconfig=${kubeconfigs_in_container_path}"
- --loglevel=2
- --color=false
- --artifacts-dir=/tmp/artifacts
Expand All @@ -267,12 +271,18 @@ spec:
mountPath: /tmp/artifacts
- name: gcs-service-account-credentials
mountPath: /var/run/secrets/gcs-service-account-credentials
- name: kubeconfigs
mountPath: /var/run/secrets/kubeconfigs
readOnly: true
volumes:
- name: artifacts
emptyDir: {}
- name: gcs-service-account-credentials
secret:
secretName: gcs-service-account-credentials
- name: kubeconfigs
secret:
secretName: kubeconfigs
EOF
kubectl -n=e2e wait --for=condition=Ready pod/e2e

Expand Down
2 changes: 1 addition & 1 deletion pkg/genericclioptions/genericclioptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewClientConfigSet(userAgentName string) ClientConfigSet {
func (ccs *ClientConfigSet) AddFlags(cmd *cobra.Command) {
ccs.ClientConfigBase.AddFlags(cmd)

cmd.PersistentFlags().StringArrayVarP(&ccs.kubeconfigs, "kubeconfig", "", ccs.kubeconfigs, "Path to kubeconfig file(s).")
cmd.PersistentFlags().StringSliceVarP(&ccs.kubeconfigs, "kubeconfig", "", ccs.kubeconfigs, "Path to kubeconfig file(s).")
}

func (ccs *ClientConfigSet) Validate() error {
Expand Down