Use k8s.io/cli-runtime for kubernetes flags

Signed-off-by: Jakob Schrettenbrunner <jakob.schrettenbrunner@telekom.de>
This commit is contained in:
Jakob Schrettenbrunner
2021-11-25 17:08:34 +01:00
parent 0b133ca9f2
commit ca7d2e783f
48 changed files with 172 additions and 197 deletions

View File

@ -193,7 +193,7 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
gitRepository := sourcev1.GitRepository{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: rootArgs.namespace,
Namespace: *kubeconfigArgs.Namespace,
Labels: sourceLabels,
},
Spec: sourcev1.GitRepositorySpec{
@ -235,7 +235,7 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
kubeClient, err := utils.KubeClient(rootArgs.kubeconfig, rootArgs.kubecontext)
kubeClient, err := utils.KubeClient(kubeconfigArgs)
if err != nil {
return err
}
@ -244,7 +244,7 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
if sourceGitArgs.secretRef == "" {
secretOpts := sourcesecret.Options{
Name: name,
Namespace: rootArgs.namespace,
Namespace: *kubeconfigArgs.Namespace,
ManifestFile: sourcesecret.MakeDefaultOptions().ManifestFile,
}
switch u.Scheme {