Skip to content

Commit

Permalink
Handle internal PC Version names in v4 compatibility check
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderboltsid committed Jul 25, 2024
1 parent 8516a15 commit 447cd6a
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 26 deletions.
11 changes: 11 additions & 0 deletions controllers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,8 @@ func getPrismCentralV4ClientForCluster(ctx context.Context, cluster *infrav1.Nut

// isPrismCentralV4Compatible checks if the Prism Central is v4 API compatible
func isPrismCentralV4Compatible(ctx context.Context, v3Client *prismclientv3.Client) (bool, error) {
log := ctrl.LoggerFrom(ctx)
internalPCNames := []string{"master", "fraser"}
pcVersion, err := getPrismCentralVersion(ctx, v3Client)
if err != nil {
return false, fmt.Errorf("failed to get Prism Central version: %w", err)
Expand All @@ -830,6 +832,15 @@ func isPrismCentralV4Compatible(ctx context.Context, v3Client *prismclientv3.Cli
return false, errors.New("version is empty")
}

for _, internalPCName := range internalPCNames {
// TODO(sid): This is a naive check to see if the PC version is an internal build. This can potentially lead to failures
// if internal fraser build is not v4 compatible.
if strings.Contains(pcVersion, internalPCName) {
log.Info(fmt.Sprintf("Prism Central version %s is an internal build; assuming it is v4 compatible", pcVersion))
return true, nil
}
}

// Remove the prefix "pc."
version := strings.TrimPrefix(pcVersion, "pc.")
// Split the version string by "." to extract the year part
Expand Down
4 changes: 2 additions & 2 deletions devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"envsubst@1.4.2",
"fping@latest",
"gnumake@4.4.1",
"ginkgo@2.17.0",
"ginkgo@2.19.0",
"go@1.22.1",
"gotestsum@1.6.4",
"kubernetes-helm@latest",
"kind@0.22.0",
"kind@0.23.0",
"ko@0.15.2",
"kubectl@latest",
"kubernetes-code-generator@0.25.4",
Expand Down
68 changes: 48 additions & 20 deletions devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -181,51 +181,51 @@
}
}
},
"ginkgo@2.17.0": {
"last_modified": "2024-03-19T05:49:19Z",
"resolved": "github:NixOS/nixpkgs/5710127d9693421e78cca4f74fac2db6d67162b1#ginkgo",
"ginkgo@2.19.0": {
"last_modified": "2024-07-07T07:43:47Z",
"resolved": "github:NixOS/nixpkgs/b60793b86201040d9dee019a05089a9150d08b5b#ginkgo",
"source": "devbox-search",
"version": "2.17.0",
"version": "2.19.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/lxq0cx9km60yjwf63pmf1j3rbfr82q7x-ginkgo-2.17.0",
"path": "/nix/store/0df3v1l69507ch21m4f5yjmqph6njr2a-ginkgo-2.19.0",
"default": true
}
],
"store_path": "/nix/store/lxq0cx9km60yjwf63pmf1j3rbfr82q7x-ginkgo-2.17.0"
"store_path": "/nix/store/0df3v1l69507ch21m4f5yjmqph6njr2a-ginkgo-2.19.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/1bf8v0b9k0pmmrs06h6zw13cxl0pmd9q-ginkgo-2.17.0",
"path": "/nix/store/n71yvwix1rkji7y2p0hird6rzxnb7hly-ginkgo-2.19.0",
"default": true
}
],
"store_path": "/nix/store/1bf8v0b9k0pmmrs06h6zw13cxl0pmd9q-ginkgo-2.17.0"
"store_path": "/nix/store/n71yvwix1rkji7y2p0hird6rzxnb7hly-ginkgo-2.19.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/7qyd3jfipsx9gj0wbkms245hkidlfb0f-ginkgo-2.17.0",
"path": "/nix/store/hhr3kz63pcpvbrhlsvwrriqwdkyqi1dw-ginkgo-2.19.0",
"default": true
}
],
"store_path": "/nix/store/7qyd3jfipsx9gj0wbkms245hkidlfb0f-ginkgo-2.17.0"
"store_path": "/nix/store/hhr3kz63pcpvbrhlsvwrriqwdkyqi1dw-ginkgo-2.19.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/bavqnxdhcvlpmkjvd0hcnhj3dlrrysmc-ginkgo-2.17.0",
"path": "/nix/store/8dkncfjlj1iavhvc5bym480c9asazlgh-ginkgo-2.19.0",
"default": true
}
],
"store_path": "/nix/store/bavqnxdhcvlpmkjvd0hcnhj3dlrrysmc-ginkgo-2.17.0"
"store_path": "/nix/store/8dkncfjlj1iavhvc5bym480c9asazlgh-ginkgo-2.19.0"
}
}
},
Expand Down Expand Up @@ -283,23 +283,51 @@
}
}
},
"kind@0.22.0": {
"last_modified": "2024-02-24T23:06:34Z",
"resolved": "github:NixOS/nixpkgs/9a9dae8f6319600fa9aebde37f340975cab4b8c0#kind",
"kind@0.23.0": {
"last_modified": "2024-07-07T07:43:47Z",
"resolved": "github:NixOS/nixpkgs/b60793b86201040d9dee019a05089a9150d08b5b#kind",
"source": "devbox-search",
"version": "0.22.0",
"version": "0.23.0",
"systems": {
"aarch64-darwin": {
"store_path": "/nix/store/s1p8n64s110a0c8px2d5k3d69lza5qzq-kind-0.22.0"
"outputs": [
{
"name": "out",
"path": "/nix/store/kn3x8vljiwhbz2p9fh6dhvff2r57m892-kind-0.23.0",
"default": true
}
],
"store_path": "/nix/store/kn3x8vljiwhbz2p9fh6dhvff2r57m892-kind-0.23.0"
},
"aarch64-linux": {
"store_path": "/nix/store/cskgcb61xxqjvc24h6x2qdjlx7in9z94-kind-0.22.0"
"outputs": [
{
"name": "out",
"path": "/nix/store/pwmwgq2jfnxhzg7n7f4bl7b0pqjdiw5s-kind-0.23.0",
"default": true
}
],
"store_path": "/nix/store/pwmwgq2jfnxhzg7n7f4bl7b0pqjdiw5s-kind-0.23.0"
},
"x86_64-darwin": {
"store_path": "/nix/store/5z2dird3mwkikxli3l108bd2nyqqm97m-kind-0.22.0"
"outputs": [
{
"name": "out",
"path": "/nix/store/84yfg589787wmrvcb9i3vchv3l9yrd05-kind-0.23.0",
"default": true
}
],
"store_path": "/nix/store/84yfg589787wmrvcb9i3vchv3l9yrd05-kind-0.23.0"
},
"x86_64-linux": {
"store_path": "/nix/store/8i78jy3332ja1i5knwdi88240i90f69z-kind-0.22.0"
"outputs": [
{
"name": "out",
"path": "/nix/store/myyvm5vrs2axpahfw74bgpax6fw7nmxa-kind-0.23.0",
"default": true
}
],
"store_path": "/nix/store/myyvm5vrs2axpahfw74bgpax6fw7nmxa-kind-0.23.0"
}
}
},
Expand Down
8 changes: 4 additions & 4 deletions templates/cluster-template-csi3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: ${CLUSTER_NAME}-pc-trusted-ca-bundle
name: nutanix-ccm-pc-trusted-ca-bundle
namespace: kube-system
binaryData:
ca.crt: ${NUTANIX_ADDITIONAL_TRUST_BUNDLE=""}
Expand Down Expand Up @@ -45,7 +45,7 @@ data:
},
"additionalTrustBundle": {
"kind": "ConfigMap",
"name": "${CLUSTER_NAME}-pc-trusted-ca-bundle",
"name": "nutanix-ccm-pc-trusted-ca-bundle",
"namespace": "kube-system"
}
},
Expand Down Expand Up @@ -197,7 +197,7 @@ data:
key: node.kubernetes.io/not-ready
operator: Exists
containers:
- image: "${CCM_REPO=ghcr.io/nutanix-cloud-native/cloud-provider-nutanix/controller}:${CCM_TAG=v0.3.2}"
- image: "${CCM_REPO=ghcr.io/nutanix-cloud-native/cloud-provider-nutanix/controller}:${CCM_TAG=v0.4.0}"
imagePullPolicy: IfNotPresent
name: nutanix-cloud-controller-manager
env:
Expand Down Expand Up @@ -2519,7 +2519,7 @@ spec:
spec:
containers:
- name: kube-vip
image: ghcr.io/kube-vip/kube-vip:v0.6.4
image: ghcr.io/kube-vip/kube-vip:v0.8.2
imagePullPolicy: IfNotPresent
args:
- manager
Expand Down

0 comments on commit 447cd6a

Please sign in to comment.