-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2021-01-31 kickoff #1191
2021-01-31 kickoff #1191
Conversation
dc30a27
to
763c506
Compare
/azp run e2e |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -0,0 +1,53 @@ | |||
package redhatopenshiftpreview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we just admit defeat and go to pkg/util/azureclient/mgmt/redhatopenshift/2021-01-31-preview/redhatopenshift ?
pkg/util/cluster/cluster.go
Outdated
groups features.ResourceGroupsClient | ||
applications graphrbac.ApplicationsClient | ||
serviceprincipals graphrbac.ServicePrincipalClient | ||
openshiftclusters redhatopenshift.OpenShiftClustersClient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
call this something awful like openshiftclusters20200430 or something
pkg/util/cluster/cluster.go
Outdated
@@ -368,6 +388,54 @@ func (c *Cluster) createCluster(ctx context.Context, clusterName, clientID, clie | |||
return c.openshiftclusters.CreateOrUpdateAndWait(ctx, c.ResourceGroup(), clusterName, oc) | |||
} | |||
|
|||
func (c *Cluster) createClusterPreview(ctx context.Context, clusterName, clientID, clientSecret string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
investigate to see if we can define the cluster in the internal representation and use api converters to generate the correct api manifest for the version of client that's being used
pkg/util/cluster/cluster.go
Outdated
err = c.openshiftclusterspreview.DeleteAndWait(ctx, c.ResourceGroup(), clusterName) | ||
if err != nil { | ||
errs = append(errs, err) | ||
} | ||
} else { | ||
err := c.openshiftclusters.DeleteAndWait(ctx, c.ResourceGroup(), clusterName) | ||
if err != nil { | ||
errs = append(errs, err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is worth it
@@ -4,7 +4,7 @@ | |||
import urllib3 | |||
|
|||
from azext_aro.custom import rp_mode_development | |||
from azext_aro.vendored_sdks.azure.mgmt.redhatopenshift.v2020_04_30 import AzureRedHatOpenShiftClient | |||
from azext_aro.vendored_sdks.azure.mgmt.redhatopenshift.v2021_01_31_preview import AzureRedHatOpenShiftClient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's think about and discuss the az side of this a bit more.
Please rebase pull request. |
3e15dc0
to
022fe2e
Compare
"github.com/Azure/ARO-RP/pkg/api" | ||
v20200430 "github.com/Azure/ARO-RP/pkg/api/v20200430" | ||
v2021131preview "github.com/Azure/ARO-RP/pkg/api/v20210131preview" | ||
mgmtopenshiftclustersv20200430 "github.com/Azure/ARO-RP/pkg/client/services/redhatopenshift/mgmt/2020-04-30/redhatopenshift" | ||
mgmtopenshiftclustersv20210131preview "github.com/Azure/ARO-RP/pkg/client/services/redhatopenshift/mgmt/2021-01-31-preview/redhatopenshift" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont know what is better. Keeping this or having createCluster 2 methods...
ext := api.APIs[v20200430.APIVersion].OpenShiftClusterConverter().ToExternal(&oc) | ||
data, err := json.Marshal(ext) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
ocExt := mgmtopenshiftclustersv20200430.OpenShiftCluster{} | ||
err = json.Unmarshal(data, &ocExt) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return c.openshiftclustersv20200430.CreateOrUpdateAndWait(ctx, c.env.ResourceGroup(), clusterName, ocExt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where create magic happens.
@@ -4,7 +4,7 @@ | |||
import random | |||
import os | |||
|
|||
import azext_aro.vendored_sdks.azure.mgmt.redhatopenshift.v2020_04_30.models as v2020_04_30 | |||
import azext_aro.vendored_sdks.azure.mgmt.redhatopenshift.v2020_04_30.models as openshiftcluster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will make future renames easier when we agree what we want to do with this
@@ -26,7 +26,7 @@ var _ = Describe("[Admin API] List Azure resources action", func() { | |||
resourceID := resourceIDFromEnv() | |||
|
|||
By("getting the resource group where cluster resources live in") | |||
oc, err := clients.OpenshiftClusters.Get(ctx, _env.ResourceGroup(), clusterName) | |||
oc, err := clients.OpenshiftClustersv20200430.Get(ctx, _env.ResourceGroup(), clusterName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now E2E are using old API. So this basically scatters our e2e. Cluster will be created with new API. So any new future tests should be not API binded. In example.
If we create FIPs cluster, we should write tests which currently run in dev only and uses Kubernetes API to check it. Not ARO...
💩 a bit. Not sure how we can do this without copy-paste test cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't agree with this or see the problem. Let's discuss tomorrow.
022fe2e
to
069c8dc
Compare
/azp run e2e |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor fixes requested. I'm OK with this.
...oft.RedHatOpenShift/stable/2021-01-31-preview/examples/OpenShiftClusters_CreateOrUpdate.json
Outdated
Show resolved
Hide resolved
...ft/resource-manager/Microsoft.RedHatOpenShift/stable/2021-01-31-preview/redhatopenshift.json
Outdated
Show resolved
Hide resolved
@@ -26,7 +26,7 @@ var _ = Describe("[Admin API] List Azure resources action", func() { | |||
resourceID := resourceIDFromEnv() | |||
|
|||
By("getting the resource group where cluster resources live in") | |||
oc, err := clients.OpenshiftClusters.Get(ctx, _env.ResourceGroup(), clusterName) | |||
oc, err := clients.OpenshiftClustersv20200430.Get(ctx, _env.ResourceGroup(), clusterName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't agree with this or see the problem. Let's discuss tomorrow.
cdc2237
to
bf946be
Compare
bf946be
to
65e048b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is good, if @mjudeikis does.
65e048b
to
184f35e
Compare
Which issue this PR addresses:
Enables us to start developing new API 2020-01-31-preview and test it in dev
What this PR does / why we need it:
This will make an extension to call preview API exclusively.If you are using an extension to interact with production RP - this will stop working. Please offload the extension for these activities.Pulled back ^ as we might want to discuss more. But I have a feeling this will be "Told you so". Sometimes we have to break things for sake of progress...
All E2E in dev will be running on preview API.
All E2E in PROD and INT will be running on stable API
Next will be swagger and cli generation WITH new fields and submission initial swagger for review: https://github.com/Azure/ARO-RP/compare/master...mjudeikis:api.skeleton?expand=1
Test plan for issue:
In development
Is there any documentation that needs to be updated for this PR?
This is just the beginning. Later - yet.