1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-06-30 22:13:45 +02:00

Make sure we dont have hidden options for backend and pipeline compiler (#2123)

move options based on **os.Getenv** into flags

---------
*Sponsored by Kithara Software GmbH*
This commit is contained in:
6543
2023-08-07 21:13:26 +02:00
committed by GitHub
parent 3d4758578a
commit d253f8cc30
28 changed files with 562 additions and 296 deletions

View File

@ -1,3 +1,17 @@
// Copyright 2022 Woodpecker Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package kubernetes
import (
@ -41,13 +55,13 @@ func isImagePullBackOffState(pod *v1.Pod) bool {
// getClientOutOfCluster returns a k8s clientset to the request from outside of cluster
func getClientOutOfCluster() (kubernetes.Interface, error) {
kubeconfigPath := os.Getenv("KUBECONFIG")
if kubeconfigPath == "" {
kubeconfigPath = os.Getenv("HOME") + "/.kube/config"
kubeConfigPath := os.Getenv("KUBECONFIG")
if kubeConfigPath == "" {
kubeConfigPath = os.Getenv("HOME") + "/.kube/config"
}
// use the current context in kubeconfig
config, err := clientcmd.BuildConfigFromFlags("", kubeconfigPath)
config, err := clientcmd.BuildConfigFromFlags("", kubeConfigPath)
if err != nil {
return nil, err
}