Skip to content

Commit

Permalink
Update multicluster v2beta1 to v2 (#3560)
Browse files Browse the repository at this point in the history
Co-authored-by: skpratt <sarah.pratt@hashicorp.com>
(cherry picked from commit fdfb762)
  • Loading branch information
Chris S. Kim committed Feb 8, 2024
1 parent c1f763d commit 6c48da7
Show file tree
Hide file tree
Showing 19 changed files with 37 additions and 37 deletions.
4 changes: 2 additions & 2 deletions acceptance/tests/vault/vault_wan_fed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ func TestVault_WANFederationViaGateways(t *testing.T) {
}
srvCAAuthRoleConfigSecondary.ConfigureK8SAuthRole(t, vaultClient)

// // Move Vault CA secret from primary to secondary so that we can mount it to pods in the
// // secondary cluster.
// Move Vault CA secret from primary to secondary so that we can mount it to pods in the
// secondary cluster.
vaultCASecretName := vault.CASecretName(vaultReleaseName)
logger.Logf(t, "retrieving Vault CA secret %s from the primary cluster and applying to the secondary", vaultCASecretName)
vaultCASecret, err := primaryCtx.KubernetesClient(t).CoreV1().Secrets(ns).Get(context.Background(), vaultCASecretName, metav1.GetOptions{})
Expand Down
2 changes: 1 addition & 1 deletion charts/consul/templates/crd-exportedservices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v2beta1
name: v2
schema:
openAPIV3Schema:
description: ExportedServices is the Schema for the Exported Services API
Expand Down
4 changes: 2 additions & 2 deletions control-plane/api/mesh/v2beta1/api_gateway_types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// // Copyright (c) HashiCorp, Inc.
// // SPDX-License-Identifier: MPL-2.0
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package v2beta1

import (
Expand Down
4 changes: 2 additions & 2 deletions control-plane/api/mesh/v2beta1/gateway_class_config_types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// // Copyright (c) HashiCorp, Inc.
// // SPDX-License-Identifier: MPL-2.0
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package v2beta1

Expand Down
4 changes: 2 additions & 2 deletions control-plane/api/mesh/v2beta1/gateway_class_types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// // Copyright (c) HashiCorp, Inc.
// // SPDX-License-Identifier: MPL-2.0
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package v2beta1

import (
Expand Down
4 changes: 2 additions & 2 deletions control-plane/api/mesh/v2beta1/grpc_route_types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// // Copyright (c) HashiCorp, Inc.
// // SPDX-License-Identifier: MPL-2.0
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package v2beta1

import (
Expand Down
4 changes: 2 additions & 2 deletions control-plane/api/mesh/v2beta1/http_route_types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// // Copyright (c) HashiCorp, Inc.
// // SPDX-License-Identifier: MPL-2.0
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package v2beta1

import (
Expand Down
4 changes: 2 additions & 2 deletions control-plane/api/mesh/v2beta1/mesh_configuration_types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// // Copyright (c) HashiCorp, Inc.
// // SPDX-License-Identifier: MPL-2.0
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package v2beta1

import (
Expand Down
4 changes: 2 additions & 2 deletions control-plane/api/mesh/v2beta1/mesh_gateway_types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// // Copyright (c) HashiCorp, Inc.
// // SPDX-License-Identifier: MPL-2.0
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package v2beta1

import (
Expand Down
4 changes: 2 additions & 2 deletions control-plane/api/mesh/v2beta1/proxy_configuration_types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// // Copyright (c) HashiCorp, Inc.
// // SPDX-License-Identifier: MPL-2.0
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package v2beta1

import (
Expand Down
4 changes: 2 additions & 2 deletions control-plane/api/mesh/v2beta1/tcp_route_types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// // Copyright (c) HashiCorp, Inc.
// // SPDX-License-Identifier: MPL-2.0
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package v2beta1

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// // Copyright (c) HashiCorp, Inc.
// // SPDX-License-Identifier: MPL-2.0
package v2beta1
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package v2

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

// Package v2beta1 contains API Schema definitions for the consul.hashicorp.com v2beta1 API group
// Package v2 contains API Schema definitions for the consul.hashicorp.com v2 API group
// +kubebuilder:object:generate=true
// +groupName=multicluster.consul.hashicorp.com
package v2beta1
package v2

import (
"k8s.io/apimachinery/pkg/runtime/schema"
Expand All @@ -17,7 +17,7 @@ var (
MultiClusterGroup = "multicluster.consul.hashicorp.com"

// MultiClusterGroupVersion is group version used to register these objects.
MultiClusterGroupVersion = schema.GroupVersion{Group: MultiClusterGroup, Version: "v2beta1"}
MultiClusterGroupVersion = schema.GroupVersion{Group: MultiClusterGroup, Version: "v2"}

// MultiClusterSchemeBuilder is used to add go types to the GroupVersionKind scheme.
MultiClusterSchemeBuilder = &scheme.Builder{GroupVersion: MultiClusterGroupVersion}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package v2beta1
package v2

import (
"github.com/hashicorp/consul-k8s/control-plane/api/common"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package v2beta1
package v2

import (
corev1 "k8s.io/api/core/v1"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v2beta1
name: v2
schema:
openAPIV3Schema:
description: ExportedServices is the Schema for the Exported Services API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

multiclusterv2beta1 "github.com/hashicorp/consul-k8s/control-plane/api/multicluster/v2beta1"
multiclusterv2 "github.com/hashicorp/consul-k8s/control-plane/api/multicluster/v2"
"github.com/hashicorp/consul-k8s/control-plane/gateways"
)

Expand All @@ -29,7 +29,7 @@ type ExportedServicesController struct {
// +kubebuilder:rbac:groups=multicluster.consul.hashicorp.com,resources=exportedservices/status,verbs=get;update;patch

func (r *ExportedServicesController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
return r.Controller.ReconcileResource(ctx, r, req, &multiclusterv2beta1.ExportedServices{})
return r.Controller.ReconcileResource(ctx, r, req, &multiclusterv2.ExportedServices{})
}

func (r *ExportedServicesController) Logger(name types.NamespacedName) logr.Logger {
Expand All @@ -41,5 +41,5 @@ func (r *ExportedServicesController) UpdateStatus(ctx context.Context, obj clien
}

func (r *ExportedServicesController) SetupWithManager(mgr ctrl.Manager) error {
return setupWithManager(mgr, &multiclusterv2beta1.ExportedServices{}, r)
return setupWithManager(mgr, &multiclusterv2.ExportedServices{}, r)
}
6 changes: 3 additions & 3 deletions control-plane/subcommand/inject-connect/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (

authv2beta1 "github.com/hashicorp/consul-k8s/control-plane/api/auth/v2beta1"
meshv2beta1 "github.com/hashicorp/consul-k8s/control-plane/api/mesh/v2beta1"
multiclusterv2beta1 "github.com/hashicorp/consul-k8s/control-plane/api/multicluster/v2beta1"
multiclusterv2 "github.com/hashicorp/consul-k8s/control-plane/api/multicluster/v2"
"github.com/hashicorp/consul-k8s/control-plane/api/v1alpha1"
"github.com/hashicorp/consul-k8s/control-plane/connect-inject/constants"
"github.com/hashicorp/consul-k8s/control-plane/subcommand/common"
Expand Down Expand Up @@ -171,9 +171,9 @@ func init() {
// V2 resources
utilruntime.Must(authv2beta1.AddAuthToScheme(scheme))
utilruntime.Must(meshv2beta1.AddMeshToScheme(scheme))
utilruntime.Must(multiclusterv2beta1.AddMultiClusterToScheme(scheme))
utilruntime.Must(multiclusterv2.AddMultiClusterToScheme(scheme))

//+kubebuilder:scaffold:scheme
// +kubebuilder:scaffold:scheme
}

func (c *Command) init() {
Expand Down

0 comments on commit 6c48da7

Please sign in to comment.