Skip to content

Commit

Permalink
Merge branch 'master' into capacity-rebalance
Browse files Browse the repository at this point in the history
  • Loading branch information
heybronson committed Nov 21, 2022
2 parents 06c85b7 + aa6d86b commit 7282aea
Show file tree
Hide file tree
Showing 661 changed files with 16,970 additions and 53,089 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/depsreview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- name: 'Checkout Repository'
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- name: 'Review Dependencies'
uses: actions/dependency-review-action@30d582111533d59ab793fd9f971817241654f3ec
uses: actions/dependency-review-action@11310527b429536e263dc6cc47873e608189ba21
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,6 @@ verify-shellcheck:
verify-terraform:
hack/verify-terraform.sh

.PHONE: verify-cloudformation
verify-cloudformation:
hack/verify-cloudformation.sh

.PHONY: verify-hashes
verify-hashes:
hack/verify-hashes.sh
Expand Down
14 changes: 7 additions & 7 deletions channels/pkg/channels/addons_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func Test_GetRequiredUpdates(t *testing.T) {
addon := &Addon{
Name: "test",
Spec: &api.AddonSpec{
Name: fi.String("test"),
Name: fi.PtrTo("test"),
NeedsPKI: true,
},
}
Expand Down Expand Up @@ -173,7 +173,7 @@ func Test_NeedsRollingUpdate(t *testing.T) {
newAddon: &Addon{
Name: "test",
Spec: &api.AddonSpec{
Name: fi.String("test"),
Name: fi.PtrTo("test"),
ManifestHash: "originalHash",
NeedsRollingUpdate: "all",
},
Expand All @@ -183,7 +183,7 @@ func Test_NeedsRollingUpdate(t *testing.T) {
newAddon: &Addon{
Name: "test",
Spec: &api.AddonSpec{
Name: fi.String("test"),
Name: fi.PtrTo("test"),
ManifestHash: "newHash",
NeedsRollingUpdate: "all",
},
Expand All @@ -195,7 +195,7 @@ func Test_NeedsRollingUpdate(t *testing.T) {
newAddon: &Addon{
Name: "test",
Spec: &api.AddonSpec{
Name: fi.String("test"),
Name: fi.PtrTo("test"),
ManifestHash: "newHash",
NeedsRollingUpdate: "worker",
},
Expand All @@ -207,7 +207,7 @@ func Test_NeedsRollingUpdate(t *testing.T) {
newAddon: &Addon{
Name: "test",
Spec: &api.AddonSpec{
Name: fi.String("test"),
Name: fi.PtrTo("test"),
ManifestHash: "newHash",
NeedsRollingUpdate: "control-plane",
},
Expand All @@ -219,7 +219,7 @@ func Test_NeedsRollingUpdate(t *testing.T) {
newAddon: &Addon{
Name: "test",
Spec: &api.AddonSpec{
Name: fi.String("test"),
Name: fi.PtrTo("test"),
ManifestHash: "newHash",
NeedsRollingUpdate: "all",
},
Expand Down Expand Up @@ -338,7 +338,7 @@ func Test_InstallPKI(t *testing.T) {
addon := &Addon{
Name: "test",
Spec: &api.AddonSpec{
Name: fi.String("test"),
Name: fi.PtrTo("test"),
NeedsPKI: true,
},
}
Expand Down
2 changes: 1 addition & 1 deletion channels/pkg/cmd/apply_channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestGetUpdates(t *testing.T) {
"aws-ebs-csi-driver.addons.k8s.io": {
Name: "aws-ebs-csi-driver.addons.k8s.io",
Spec: &api.AddonSpec{
Name: fi.String("aws-ebs-csi-driver.addons.k8s.io"),
Name: fi.PtrTo("aws-ebs-csi-driver.addons.k8s.io"),
Id: "k8s-1.17",
ManifestHash: "abc",
},
Expand Down
2 changes: 1 addition & 1 deletion cloudmock/openstack/mockcompute/flavors.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (m *MockClient) createFlavor(w http.ResponseWriter, r *http.Request) {
Name: create.Flavor.Name,
RAM: create.Flavor.RAM,
VCPUs: create.Flavor.VCPUs,
Disk: fi.IntValue(create.Flavor.Disk),
Disk: fi.ValueOf(create.Flavor.Disk),
}
m.flavors[flavor.ID] = flavor

Expand Down
2 changes: 1 addition & 1 deletion cloudmock/openstack/mockcompute/servers.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func (m *MockClient) createServer(w http.ResponseWriter, r *http.Request) {

portID := create.Server.Networks[0].Port
ports.Update(m.networkClient, portID, ports.UpdateOpts{
DeviceID: fi.String(server.ID),
DeviceID: fi.PtrTo(server.ID),
})

// Assign an IP address
Expand Down
2 changes: 1 addition & 1 deletion cloudmock/openstack/mocknetworking/ports.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func (m *MockClient) updatePort(w http.ResponseWriter, r *http.Request) {

deviceID := update.Port.DeviceID
if deviceID != nil {
port.DeviceID = fi.StringValue(deviceID)
port.DeviceID = fi.ValueOf(deviceID)
}
m.ports[portID] = port

Expand Down
2 changes: 1 addition & 1 deletion cmd/kops-controller/controllers/awsipam.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (r *AWSIPAMReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
eni, err := r.ec2Client.DescribeNetworkInterfaces(&ec2.DescribeNetworkInterfacesInput{
Filters: []*ec2.Filter{
{
Name: fi.String("attachment.instance-id"),
Name: fi.PtrTo("attachment.instance-id"),
Values: []*string{
&instanceID,
},
Expand Down
22 changes: 15 additions & 7 deletions cmd/kops/create_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,12 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
// TODO complete VFS paths
}

cmd.Flags().StringVar(&options.KubernetesVersion, "kubernetes-version", options.KubernetesVersion, "Version of kubernetes to run (defaults to version in channel)")
cmd.Flags().StringVar(&options.KubernetesVersion, "kubernetes-version", options.KubernetesVersion, "Version of Kubernetes to run (defaults to version in channel)")
cmd.RegisterFlagCompletionFunc("kubernetes-version", completeKubernetesVersion)

cmd.Flags().StringSliceVar(&options.KubernetesFeatureGates, "kubernetes-feature-gates", options.KubernetesFeatureGates, "List of Kubernetes feature gates to enable/disable")
cmd.RegisterFlagCompletionFunc("kubernetes-version", completeKubernetesFeatureGates)

cmd.Flags().StringVar(&options.ContainerRuntime, "container-runtime", options.ContainerRuntime, "Container runtime to use: containerd, docker")
cmd.RegisterFlagCompletionFunc("container-runtime", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return []string{"containerd", "docker"}, cobra.ShellCompDirectiveNoFileComp
Expand Down Expand Up @@ -327,7 +330,7 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
cmd.RegisterFlagCompletionFunc("channel", completeChannel)

// Network topology
cmd.Flags().StringVarP(&options.Topology, "topology", "t", options.Topology, "Network topology for the cluster: public or private")
cmd.Flags().StringVarP(&options.Topology, "topology", "t", options.Topology, "Network topology for the cluster: 'public' or 'private'. Defaults to 'public' for IPv4 clusters and 'private' for IPv6 clusters.")
cmd.RegisterFlagCompletionFunc("topology", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return []string{api.TopologyPublic, api.TopologyPrivate}, cobra.ShellCompDirectiveNoFileComp
})
Expand Down Expand Up @@ -432,7 +435,7 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
cmd.RegisterFlagCompletionFunc("os-ext-net", completeOpenstackExternalNet)
cmd.Flags().StringVar(&options.OpenstackExternalSubnet, "os-ext-subnet", options.OpenstackExternalSubnet, "External floating subnet to use with the openstack router")
cmd.RegisterFlagCompletionFunc("os-ext-subnet", completeOpenstackExternalSubnet)
cmd.Flags().StringVar(&options.OpenstackLBSubnet, "os-lb-floating-subnet", options.OpenstackLBSubnet, "External subnet to use with the kubernetes api")
cmd.Flags().StringVar(&options.OpenstackLBSubnet, "os-lb-floating-subnet", options.OpenstackLBSubnet, "External subnet to use with the Kubernetes API")
cmd.RegisterFlagCompletionFunc("os-lb-floating-subnet", completeOpenstackLBSubnet)
cmd.Flags().BoolVar(&options.OpenstackStorageIgnoreAZ, "os-kubelet-ignore-az", options.OpenstackStorageIgnoreAZ, "Attach volumes across availability zones")
cmd.Flags().BoolVar(&options.OpenstackLBOctavia, "os-octavia", options.OpenstackLBOctavia, "Use octavia load balancer API")
Expand Down Expand Up @@ -578,13 +581,13 @@ func RunCreateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *Cr

if c.MasterVolumeSize != 0 {
for _, group := range masters {
group.Spec.RootVolumeSize = fi.Int32(c.MasterVolumeSize)
group.Spec.RootVolumeSize = fi.PtrTo(c.MasterVolumeSize)
}
}

if c.NodeVolumeSize != 0 {
for _, group := range nodes {
group.Spec.RootVolumeSize = fi.Int32(c.NodeVolumeSize)
group.Spec.RootVolumeSize = fi.PtrTo(c.NodeVolumeSize)
}
}

Expand All @@ -601,11 +604,11 @@ func RunCreateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *Cr
}

if c.DisableSubnetTags {
cluster.Spec.TagSubnets = fi.Bool(false)
cluster.Spec.TagSubnets = fi.PtrTo(false)
}

if c.MasterPublicName != "" {
cluster.Spec.MasterPublicName = c.MasterPublicName
cluster.Spec.API.PublicName = c.MasterPublicName
}

if err := commands.UnsetClusterFields(c.Unsets, cluster); err != nil {
Expand Down Expand Up @@ -908,6 +911,11 @@ func completeKubernetesVersion(cmd *cobra.Command, args []string, toComplete str
return versions.List(), cobra.ShellCompDirectiveNoFileComp
}

func completeKubernetesFeatureGates(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
// TODO check if there's a way to get the full list of feature gates from k8s libs
return nil, cobra.ShellCompDirectiveNoFileComp
}

func completeInstanceImage(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
// TODO call into cloud provider(s) to get list of valid images
return nil, cobra.ShellCompDirectiveNoFileComp
Expand Down
5 changes: 5 additions & 0 deletions cmd/kops/create_cluster_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ func TestCreateClusterOverride(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/overrides", "v1alpha2")
}

// TestCreateClusterKubernetesFeatureGates tests the override flag
func TestCreateClusterKubernetesFeatureGates(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal_feature-gates", "v1alpha2")
}

// TestCreateClusterComplex runs kops create cluster, with a grab-bag of edge cases
func TestCreateClusterComplex(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/complex", "v1alpha2")
Expand Down
2 changes: 1 addition & 1 deletion cmd/kops/get_keypairs.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func listKeypairs(keyStore fi.CAStore, names []string, includeDistrusted bool) (
keypair.AlternateNames = alternateNames
}
if rsaKey, ok := cert.PublicKey.(*rsa.PublicKey); ok {
keypair.KeyLength = fi.Int(rsaKey.N.BitLen())
keypair.KeyLength = fi.PtrTo(rsaKey.N.BitLen())
}
}
items = append(items, &keypair)
Expand Down

0 comments on commit 7282aea

Please sign in to comment.