Upgrade to golang 1.12.6 (#29)
This commit is contained in:
Родитель
243996c2c0
Коммит
2caad5b969
|
@ -20,7 +20,7 @@
|
||||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
# SOFTWARE
|
# SOFTWARE
|
||||||
|
|
||||||
FROM golang:alpine as builder
|
FROM golang:1.12.6-alpine as builder
|
||||||
|
|
||||||
ENV PROJECT_DIR=${GOPATH}/src/github.com/microsoft/frameworkcontroller
|
ENV PROJECT_DIR=${GOPATH}/src/github.com/microsoft/frameworkcontroller
|
||||||
ENV INSTALL_DIR=/opt/frameworkcontroller/frameworkbarrier
|
ENV INSTALL_DIR=/opt/frameworkcontroller/frameworkbarrier
|
||||||
|
@ -32,7 +32,7 @@ RUN ${PROJECT_DIR}/build/frameworkbarrier/go-build.sh && \
|
||||||
mv ${PROJECT_DIR}/dist/frameworkbarrier/* ${INSTALL_DIR}
|
mv ${PROJECT_DIR}/dist/frameworkbarrier/* ${INSTALL_DIR}
|
||||||
|
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:3.10.1
|
||||||
|
|
||||||
ENV INSTALL_DIR=/opt/frameworkcontroller/frameworkbarrier
|
ENV INSTALL_DIR=/opt/frameworkcontroller/frameworkbarrier
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
# SOFTWARE
|
# SOFTWARE
|
||||||
|
|
||||||
FROM golang:alpine as builder
|
FROM golang:1.12.6-alpine as builder
|
||||||
|
|
||||||
ENV PROJECT_DIR=${GOPATH}/src/github.com/microsoft/frameworkcontroller
|
ENV PROJECT_DIR=${GOPATH}/src/github.com/microsoft/frameworkcontroller
|
||||||
ENV INSTALL_DIR=/opt/frameworkcontroller/frameworkcontroller
|
ENV INSTALL_DIR=/opt/frameworkcontroller/frameworkcontroller
|
||||||
|
@ -32,7 +32,7 @@ RUN ${PROJECT_DIR}/build/frameworkcontroller/go-build.sh && \
|
||||||
mv ${PROJECT_DIR}/dist/frameworkcontroller/* ${INSTALL_DIR}
|
mv ${PROJECT_DIR}/dist/frameworkcontroller/* ${INSTALL_DIR}
|
||||||
|
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:3.10.1
|
||||||
|
|
||||||
ENV INSTALL_DIR=/opt/frameworkcontroller/frameworkcontroller
|
ENV INSTALL_DIR=/opt/frameworkcontroller/frameworkcontroller
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/microsoft/frameworkcontroller/pkg/common"
|
|
||||||
"github.com/microsoft/frameworkcontroller/pkg/barrier"
|
"github.com/microsoft/frameworkcontroller/pkg/barrier"
|
||||||
|
"github.com/microsoft/frameworkcontroller/pkg/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
|
@ -23,11 +23,11 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/microsoft/frameworkcontroller/pkg/common"
|
||||||
|
"github.com/microsoft/frameworkcontroller/pkg/controller"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
"github.com/microsoft/frameworkcontroller/pkg/common"
|
|
||||||
"github.com/microsoft/frameworkcontroller/pkg/controller"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
|
@ -97,7 +97,7 @@ docker run -e KUBECONFIG=/mnt/.kube/config \
|
||||||
|
|
||||||
**Prerequisite**
|
**Prerequisite**
|
||||||
|
|
||||||
Ensure you have installed [Golang 1.10 or above](https://golang.org/doc/install#install) and the [${GOPATH}](https://golang.org/doc/code.html#GOPATH) is valid.
|
Ensure you have installed [Golang 1.12.6 or above](https://golang.org/doc/install#install) and the [${GOPATH}](https://golang.org/doc/code.html#GOPATH) is valid.
|
||||||
|
|
||||||
Then build the FrameworkController binary distribution:
|
Then build the FrameworkController binary distribution:
|
||||||
```shell
|
```shell
|
||||||
|
|
|
@ -23,12 +23,12 @@
|
||||||
package v1
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/microsoft/frameworkcontroller/pkg/common"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"k8s.io/client-go/rest"
|
"k8s.io/client-go/rest"
|
||||||
"k8s.io/client-go/tools/clientcmd"
|
"k8s.io/client-go/tools/clientcmd"
|
||||||
"github.com/microsoft/frameworkcontroller/pkg/common"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
@ -177,7 +177,7 @@ func initConfig() *Config {
|
||||||
return &c
|
return &c
|
||||||
}
|
}
|
||||||
|
|
||||||
func BuildKubeConfig(cConfig *Config) (*rest.Config) {
|
func BuildKubeConfig(cConfig *Config) *rest.Config {
|
||||||
kConfig, err := clientcmd.BuildConfigFromFlags(
|
kConfig, err := clientcmd.BuildConfigFromFlags(
|
||||||
*cConfig.KubeApiServerAddress, *cConfig.KubeConfigFilePath)
|
*cConfig.KubeApiServerAddress, *cConfig.KubeConfigFilePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
package v1
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
core "k8s.io/api/core/v1"
|
core "k8s.io/api/core/v1"
|
||||||
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
package v1
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/microsoft/frameworkcontroller/pkg/common"
|
||||||
apiExtensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
|
apiExtensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
|
||||||
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"github.com/microsoft/frameworkcontroller/pkg/common"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -24,13 +24,13 @@ package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"github.com/microsoft/frameworkcontroller/pkg/common"
|
||||||
"strconv"
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
core "k8s.io/api/core/v1"
|
core "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
|
||||||
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"github.com/microsoft/frameworkcontroller/pkg/common"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -24,8 +24,8 @@ package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
core "k8s.io/api/core/v1"
|
core "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
|
||||||
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
|
|
@ -24,21 +24,21 @@ package barrier
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
ci "github.com/microsoft/frameworkcontroller/pkg/apis/frameworkcontroller/v1"
|
||||||
|
frameworkClient "github.com/microsoft/frameworkcontroller/pkg/client/clientset/versioned"
|
||||||
|
"github.com/microsoft/frameworkcontroller/pkg/common"
|
||||||
|
"github.com/microsoft/frameworkcontroller/pkg/util"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
"io/ioutil"
|
||||||
|
apiErrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
|
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
|
kubeClient "k8s.io/client-go/kubernetes"
|
||||||
|
"k8s.io/client-go/rest"
|
||||||
|
"k8s.io/client-go/tools/clientcmd"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"io/ioutil"
|
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
|
||||||
"k8s.io/client-go/rest"
|
|
||||||
"k8s.io/client-go/tools/clientcmd"
|
|
||||||
apiErrors "k8s.io/apimachinery/pkg/api/errors"
|
|
||||||
kubeClient "k8s.io/client-go/kubernetes"
|
|
||||||
frameworkClient "github.com/microsoft/frameworkcontroller/pkg/client/clientset/versioned"
|
|
||||||
ci "github.com/microsoft/frameworkcontroller/pkg/apis/frameworkcontroller/v1"
|
|
||||||
"github.com/microsoft/frameworkcontroller/pkg/util"
|
|
||||||
"github.com/microsoft/frameworkcontroller/pkg/common"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// FrameworkController Extension: FrameworkBarrier
|
// FrameworkController Extension: FrameworkBarrier
|
||||||
|
@ -191,7 +191,7 @@ func defaultKubeConfigFilePath() *string {
|
||||||
return &configPath
|
return &configPath
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildKubeConfig(bConfig *Config) (*rest.Config) {
|
func buildKubeConfig(bConfig *Config) *rest.Config {
|
||||||
kConfig, err := clientcmd.BuildConfigFromFlags(
|
kConfig, err := clientcmd.BuildConfigFromFlags(
|
||||||
bConfig.KubeApiServerAddress, bConfig.KubeConfigFilePath)
|
bConfig.KubeApiServerAddress, bConfig.KubeConfigFilePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
package common
|
package common
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
"io"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Empty struct{}
|
type Empty struct{}
|
||||||
|
|
|
@ -23,19 +23,19 @@
|
||||||
package common
|
package common
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
"gopkg.in/yaml.v2"
|
||||||
|
"io/ioutil"
|
||||||
|
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/types"
|
||||||
|
"k8s.io/klog"
|
||||||
|
"math/rand"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"os"
|
|
||||||
"flag"
|
|
||||||
"math/rand"
|
|
||||||
"io/ioutil"
|
|
||||||
"gopkg.in/yaml.v2"
|
|
||||||
"encoding/json"
|
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
"k8s.io/klog"
|
|
||||||
"k8s.io/apimachinery/pkg/types"
|
|
||||||
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func Quote(s string) string {
|
func Quote(s string) string {
|
||||||
|
|
|
@ -24,32 +24,32 @@ package controller
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
ci "github.com/microsoft/frameworkcontroller/pkg/apis/frameworkcontroller/v1"
|
||||||
"reflect"
|
|
||||||
"strings"
|
|
||||||
"sync"
|
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
errorWrap "github.com/pkg/errors"
|
|
||||||
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
||||||
"k8s.io/apimachinery/pkg/util/runtime"
|
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
|
||||||
"k8s.io/apimachinery/pkg/types"
|
|
||||||
core "k8s.io/api/core/v1"
|
|
||||||
"k8s.io/client-go/tools/cache"
|
|
||||||
"k8s.io/client-go/util/workqueue"
|
|
||||||
"k8s.io/client-go/util/retry"
|
|
||||||
"k8s.io/client-go/rest"
|
|
||||||
apiErrors "k8s.io/apimachinery/pkg/api/errors"
|
|
||||||
errorAgg "k8s.io/apimachinery/pkg/util/errors"
|
|
||||||
kubeClient "k8s.io/client-go/kubernetes"
|
|
||||||
kubeInformer "k8s.io/client-go/informers"
|
|
||||||
coreLister "k8s.io/client-go/listers/core/v1"
|
|
||||||
frameworkClient "github.com/microsoft/frameworkcontroller/pkg/client/clientset/versioned"
|
frameworkClient "github.com/microsoft/frameworkcontroller/pkg/client/clientset/versioned"
|
||||||
frameworkInformer "github.com/microsoft/frameworkcontroller/pkg/client/informers/externalversions"
|
frameworkInformer "github.com/microsoft/frameworkcontroller/pkg/client/informers/externalversions"
|
||||||
frameworkLister "github.com/microsoft/frameworkcontroller/pkg/client/listers/frameworkcontroller/v1"
|
frameworkLister "github.com/microsoft/frameworkcontroller/pkg/client/listers/frameworkcontroller/v1"
|
||||||
ci "github.com/microsoft/frameworkcontroller/pkg/apis/frameworkcontroller/v1"
|
|
||||||
"github.com/microsoft/frameworkcontroller/pkg/util"
|
|
||||||
"github.com/microsoft/frameworkcontroller/pkg/common"
|
"github.com/microsoft/frameworkcontroller/pkg/common"
|
||||||
|
"github.com/microsoft/frameworkcontroller/pkg/util"
|
||||||
|
errorWrap "github.com/pkg/errors"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
core "k8s.io/api/core/v1"
|
||||||
|
apiErrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
|
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/types"
|
||||||
|
errorAgg "k8s.io/apimachinery/pkg/util/errors"
|
||||||
|
"k8s.io/apimachinery/pkg/util/runtime"
|
||||||
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
|
kubeInformer "k8s.io/client-go/informers"
|
||||||
|
kubeClient "k8s.io/client-go/kubernetes"
|
||||||
|
coreLister "k8s.io/client-go/listers/core/v1"
|
||||||
|
"k8s.io/client-go/rest"
|
||||||
|
"k8s.io/client-go/tools/cache"
|
||||||
|
"k8s.io/client-go/util/retry"
|
||||||
|
"k8s.io/client-go/util/workqueue"
|
||||||
|
"reflect"
|
||||||
|
"strings"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FrameworkController maintains the lifecycle for all Frameworks in the cluster.
|
// FrameworkController maintains the lifecycle for all Frameworks in the cluster.
|
||||||
|
@ -1736,8 +1736,7 @@ func (c *FrameworkController) updateRemoteFrameworkStatus(f *ci.Framework) error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *FrameworkController) getExpectedFrameworkStatusInfo(key string) (
|
func (c *FrameworkController) getExpectedFrameworkStatusInfo(key string) *ExpectedFrameworkStatusInfo {
|
||||||
*ExpectedFrameworkStatusInfo) {
|
|
||||||
if value, ok := c.fExpectedStatusInfos.Load(key); ok {
|
if value, ok := c.fExpectedStatusInfos.Load(key); ok {
|
||||||
return value.(*ExpectedFrameworkStatusInfo)
|
return value.(*ExpectedFrameworkStatusInfo)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -24,7 +24,7 @@ package util
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
"github.com/microsoft/frameworkcontroller/pkg/common"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
apiExtensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
|
apiExtensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
|
||||||
apiClient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
|
apiClient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
|
||||||
|
@ -32,7 +32,7 @@ import (
|
||||||
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
"k8s.io/client-go/rest"
|
"k8s.io/client-go/rest"
|
||||||
"github.com/microsoft/frameworkcontroller/pkg/common"
|
"reflect"
|
||||||
)
|
)
|
||||||
|
|
||||||
func PutCRD(
|
func PutCRD(
|
||||||
|
|
|
@ -24,12 +24,12 @@ package util
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
frameworkClient "github.com/microsoft/frameworkcontroller/pkg/client/clientset/versioned"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"k8s.io/client-go/tools/cache"
|
|
||||||
"k8s.io/client-go/rest"
|
|
||||||
core "k8s.io/api/core/v1"
|
core "k8s.io/api/core/v1"
|
||||||
kubeClient "k8s.io/client-go/kubernetes"
|
kubeClient "k8s.io/client-go/kubernetes"
|
||||||
frameworkClient "github.com/microsoft/frameworkcontroller/pkg/client/clientset/versioned"
|
"k8s.io/client-go/rest"
|
||||||
|
"k8s.io/client-go/tools/cache"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CreateClients(kConfig *rest.Config) (
|
func CreateClients(kConfig *rest.Config) (
|
||||||
|
|
Загрузка…
Ссылка в новой задаче