Openstack gopkg updates

This commit is contained in:
Derek Lemon -T (delemon - AEROTEK INC at Cisco) 2019-01-19 08:41:15 -07:00
commit c9b5911b1c
9 changed files with 155 additions and 11 deletions

3
Gopkg.lock generated
View File

@ -79,6 +79,7 @@
name = "github.com/aws/aws-sdk-go" name = "github.com/aws/aws-sdk-go"
packages = [ packages = [
"aws", "aws",
"aws/arn",
"aws/awserr", "aws/awserr",
"aws/awsutil", "aws/awsutil",
"aws/client", "aws/client",
@ -1865,6 +1866,6 @@
[solve-meta] [solve-meta]
analyzer-name = "dep" analyzer-name = "dep"
analyzer-version = 1 analyzer-version = 1
inputs-digest = "2dc4b42f3626cc35d2652f8e414ac007cbc222cf83b92116f56dfb9e2fdd5648" inputs-digest = "23caccb31c25104d99032cbd0e26e9c618dc410ba68d942a3e1f967a79d6b3bc"
solver-name = "gps-cdcl" solver-name = "gps-cdcl"
solver-version = 1 solver-version = 1

View File

@ -377,6 +377,8 @@ Specifying KubeDNS will install kube-dns as the default service discovery.
This will install [CoreDNS](https://coredns.io/) instead of kube-dns. This will install [CoreDNS](https://coredns.io/) instead of kube-dns.
**Note:** If you are upgrading to CoreDNS, kube-dns will be left in place and must be removed manually (you can scale the kube-dns and kube-dns-autoscaler deployments in the `kube-system` namespace to 0 as a starting point). The `kube-dns` Service itself should be left in place, as this retains the ClusterIP and eliminates the possibility of DNS outages in your cluster. If you would like to continue autoscaling, update the `kube-dns-autoscaler` Deployment container command for `--target=Deployment/kube-dns` to be `--target=Deployment/coredns`.
### kubeControllerManager ### kubeControllerManager
This block contains configurations for the `controller-manager`. This block contains configurations for the `controller-manager`.

View File

@ -501,7 +501,17 @@ var dockerVersions = []dockerVersion{
//Recommends: aufs-tools, ca-certificates, cgroupfs-mount | cgroup-lite, git, xz-utils, apparmor //Recommends: aufs-tools, ca-certificates, cgroupfs-mount | cgroup-lite, git, xz-utils, apparmor
}, },
// 17.09.0 - Centos / Rhel7 // 17.09.0 - Centos / Rhel7 (two packages)
{
DockerVersion: "17.09.0",
Name: "container-selinux-2",
Distros: []distros.Distribution{distros.DistributionRhel7, distros.DistributionCentos7},
Architectures: []Architecture{ArchitectureAmd64},
Version: "17.09.0.ce",
Source: "http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.68-1.el7.noarch.rpm",
Hash: "d9f87f7f4f2e8e611f556d873a17b8c0c580fec0",
Dependencies: []string{"policycoreutils-python"},
},
{ {
DockerVersion: "17.09.0", DockerVersion: "17.09.0",
Name: "docker-ce", Name: "docker-ce",
@ -540,7 +550,17 @@ var dockerVersions = []dockerVersion{
Dependencies: []string{"bridge-utils", "libapparmor1", "libltdl7", "perl"}, Dependencies: []string{"bridge-utils", "libapparmor1", "libltdl7", "perl"},
}, },
// 18.06.1 - CentOS / Rhel7 // 18.06.1 - CentOS / Rhel7 (two packages)
{
DockerVersion: "18.06.1",
Name: "container-selinux-2",
Distros: []distros.Distribution{distros.DistributionRhel7, distros.DistributionCentos7},
Architectures: []Architecture{ArchitectureAmd64},
Version: "18.06.1.ce",
Source: "http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.68-1.el7.noarch.rpm",
Hash: "d9f87f7f4f2e8e611f556d873a17b8c0c580fec0",
Dependencies: []string{"policycoreutils-python"},
},
{ {
DockerVersion: "18.06.1", DockerVersion: "18.06.1",
Name: "docker-ce", Name: "docker-ce",

View File

@ -22,6 +22,7 @@ go_library(
"//pkg/util/subnet:go_default_library", "//pkg/util/subnet:go_default_library",
"//upup/pkg/fi:go_default_library", "//upup/pkg/fi:go_default_library",
"//upup/pkg/fi/cloudup/awsup:go_default_library", "//upup/pkg/fi/cloudup/awsup:go_default_library",
"//vendor/github.com/aws/aws-sdk-go/aws/arn:go_default_library",
"//vendor/github.com/blang/semver:go_default_library", "//vendor/github.com/blang/semver:go_default_library",
"//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/golang/glog:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/validation:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/validation:go_default_library",

View File

@ -18,8 +18,9 @@ package validation
import ( import (
"fmt" "fmt"
"regexp" "strings"
"github.com/aws/aws-sdk-go/aws/arn"
"k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/kops/pkg/apis/kops" "k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/apis/kops/util" "k8s.io/kops/pkg/apis/kops/util"
@ -171,15 +172,13 @@ func validateExtraUserData(userData *kops.UserData) error {
return nil return nil
} }
// format is arn:aws:iam::123456789012:instance-profile/S3Access
var validARN = regexp.MustCompile(`^arn:aws:iam::\d+:instance-profile\/\S+$`)
// validateInstanceProfile checks the String values for the AuthProfile // validateInstanceProfile checks the String values for the AuthProfile
func validateInstanceProfile(v *kops.IAMProfileSpec, fldPath *field.Path) *field.Error { func validateInstanceProfile(v *kops.IAMProfileSpec, fldPath *field.Path) *field.Error {
if v != nil && v.Profile != nil { if v != nil && v.Profile != nil {
arn := *v.Profile instanceProfileARN := *v.Profile
if !validARN.MatchString(arn) { parsedARN, err := arn.Parse(instanceProfileARN)
return field.Invalid(fldPath.Child("Profile"), arn, if err != nil || !strings.HasPrefix(parsedARN.Resource, "instance-profile") {
return field.Invalid(fldPath.Child("Profile"), instanceProfileARN,
"Instance Group IAM Instance Profile must be a valid aws arn such as arn:aws:iam::123456789012:instance-profile/KopsExampleRole") "Instance Group IAM Instance Profile must be a valid aws arn such as arn:aws:iam::123456789012:instance-profile/KopsExampleRole")
} }
} }

View File

@ -86,6 +86,16 @@ func TestValidateInstanceProfile(t *testing.T) {
Profile: s("arn:aws:iam::123456789012:instance-profile/has/path/S3Access"), Profile: s("arn:aws:iam::123456789012:instance-profile/has/path/S3Access"),
}, },
}, },
{
Input: &kops.IAMProfileSpec{
Profile: s("arn:aws-cn:iam::123456789012:instance-profile/has/path/S3Access"),
},
},
{
Input: &kops.IAMProfileSpec{
Profile: s("arn:aws-us-gov:iam::123456789012:instance-profile/has/path/S3Access"),
},
},
{ {
Input: &kops.IAMProfileSpec{ Input: &kops.IAMProfileSpec{
Profile: s("42"), Profile: s("42"),

View File

@ -255,7 +255,7 @@ func (b *KubeAPIServerOptionsBuilder) BuildOptions(o interface{}) error {
} }
// Based on recommendations from: // Based on recommendations from:
// https://kubernetes.io/docs/admin/admission-controllers/#is-there-a-recommended-set-of-admission-controllers-to-use // https://kubernetes.io/docs/admin/admission-controllers/#is-there-a-recommended-set-of-admission-controllers-to-use
if b.IsKubernetesGTE("1.10") { if b.IsKubernetesGTE("1.10") && b.IsKubernetesLT("1.12") {
c.EnableAdmissionPlugins = []string{ c.EnableAdmissionPlugins = []string{
"Initializers", "Initializers",
"NamespaceLifecycle", "NamespaceLifecycle",
@ -270,6 +270,22 @@ func (b *KubeAPIServerOptionsBuilder) BuildOptions(o interface{}) error {
"ResourceQuota", "ResourceQuota",
} }
} }
// Based on recommendations from:
// https://kubernetes.io/docs/admin/admission-controllers/#is-there-a-recommended-set-of-admission-controllers-to-use
if b.IsKubernetesGTE("1.12") {
c.EnableAdmissionPlugins = []string{
"NamespaceLifecycle",
"LimitRanger",
"ServiceAccount",
"PersistentVolumeLabel",
"DefaultStorageClass",
"DefaultTolerationSeconds",
"MutatingAdmissionWebhook",
"ValidatingAdmissionWebhook",
"NodeRestriction",
"ResourceQuota",
}
}
// We make sure to disable AnonymousAuth from when it was introduced // We make sure to disable AnonymousAuth from when it was introduced
if b.IsKubernetesGTE("1.5") { if b.IsKubernetesGTE("1.5") {

9
vendor/github.com/aws/aws-sdk-go/aws/arn/BUILD.bazel generated vendored Normal file
View File

@ -0,0 +1,9 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["arn.go"],
importmap = "k8s.io/kops/vendor/github.com/aws/aws-sdk-go/aws/arn",
importpath = "github.com/aws/aws-sdk-go/aws/arn",
visibility = ["//visibility:public"],
)

86
vendor/github.com/aws/aws-sdk-go/aws/arn/arn.go generated vendored Normal file
View File

@ -0,0 +1,86 @@
// Package arn provides a parser for interacting with Amazon Resource Names.
package arn
import (
"errors"
"strings"
)
const (
arnDelimiter = ":"
arnSections = 6
arnPrefix = "arn:"
// zero-indexed
sectionPartition = 1
sectionService = 2
sectionRegion = 3
sectionAccountID = 4
sectionResource = 5
// errors
invalidPrefix = "arn: invalid prefix"
invalidSections = "arn: not enough sections"
)
// ARN captures the individual fields of an Amazon Resource Name.
// See http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html for more information.
type ARN struct {
// The partition that the resource is in. For standard AWS regions, the partition is "aws". If you have resources in
// other partitions, the partition is "aws-partitionname". For example, the partition for resources in the China
// (Beijing) region is "aws-cn".
Partition string
// The service namespace that identifies the AWS product (for example, Amazon S3, IAM, or Amazon RDS). For a list of
// namespaces, see
// http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces.
Service string
// The region the resource resides in. Note that the ARNs for some resources do not require a region, so this
// component might be omitted.
Region string
// The ID of the AWS account that owns the resource, without the hyphens. For example, 123456789012. Note that the
// ARNs for some resources don't require an account number, so this component might be omitted.
AccountID string
// The content of this part of the ARN varies by service. It often includes an indicator of the type of resource —
// for example, an IAM user or Amazon RDS database - followed by a slash (/) or a colon (:), followed by the
// resource name itself. Some services allows paths for resource names, as described in
// http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arns-paths.
Resource string
}
// Parse parses an ARN into its constituent parts.
//
// Some example ARNs:
// arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/MyEnvironment
// arn:aws:iam::123456789012:user/David
// arn:aws:rds:eu-west-1:123456789012:db:mysql-db
// arn:aws:s3:::my_corporate_bucket/exampleobject.png
func Parse(arn string) (ARN, error) {
if !strings.HasPrefix(arn, arnPrefix) {
return ARN{}, errors.New(invalidPrefix)
}
sections := strings.SplitN(arn, arnDelimiter, arnSections)
if len(sections) != arnSections {
return ARN{}, errors.New(invalidSections)
}
return ARN{
Partition: sections[sectionPartition],
Service: sections[sectionService],
Region: sections[sectionRegion],
AccountID: sections[sectionAccountID],
Resource: sections[sectionResource],
}, nil
}
// String returns the canonical representation of the ARN
func (arn ARN) String() string {
return arnPrefix +
arn.Partition + arnDelimiter +
arn.Service + arnDelimiter +
arn.Region + arnDelimiter +
arn.AccountID + arnDelimiter +
arn.Resource
}