Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions app/authenticated/cluster/edit/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { scheduleOnce } from '@ember/runloop';
export default Route.extend({
access: service(),
globalStore: service(),
k3s: service(),
releaseVersions: service(),
clusterTemplateService: service('clusterTemplates'),
roleTemplateService: service('roleTemplate'),

Expand All @@ -20,6 +20,7 @@ export default Route.extend({
let modelOut = {
originalCluster: cluster,
cluster: cluster.clone(),
cloudCredentials: globalStore.findAll('cloudcredential'),
kontainerDrivers: globalStore.findAll('kontainerDriver'),
nodeTemplates: globalStore.findAll('nodeTemplate'),
nodeDrivers: globalStore.findAll('nodeDriver'),
Expand All @@ -30,8 +31,8 @@ export default Route.extend({
me: get(this, 'access.principal'),
};

if (cluster.driver === 'k3s') {
modelOut['k3sVersions'] = this.k3s.getAllVersions();
if (cluster.driver === 'k3s' || cluster.driver === 'rke2') {
this.releaseVersions.getAllVersions(cluster.driver);
}

if (!isEmpty(cluster.clusterTemplateRevisionId)) {
Expand Down
2 changes: 1 addition & 1 deletion app/authenticated/cluster/edit/template.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section class="header">
<h1>
{{t "clustersPage.editClusterName" name=model.originalCluster.displayName}} ({{driver-name provider}})
{{t "clustersPage.editClusterName" name=model.originalCluster.displayName}} ({{model.originalCluster.displayProvider}})
</h1>
</section>

Expand Down
21 changes: 17 additions & 4 deletions app/models/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ export default Resource.extend(Grafana, ResourceUsage, {
switch ( get(this, 'configName') ) {
case 'amazonElasticContainerServiceConfig':
return 'amazoneks';
case 'eksConfig':
return 'amazoneksv2';
case 'azureKubernetesServiceConfig':
return 'azureaks';
case 'googleKubernetesEngineConfig':
Expand All @@ -169,6 +171,8 @@ export default Resource.extend(Grafana, ResourceUsage, {
return 'huaweicce';
case 'okeEngineConfig':
return 'oracleoke';
case 'rke2Config':
return 'rke2';
case 'rancherKubernetesEngineConfig':
if ( !pools.length ) {
return 'custom';
Expand All @@ -189,9 +193,11 @@ export default Resource.extend(Grafana, ResourceUsage, {
const intl = get(this, 'intl');
const pools = get(this, 'nodePools');
const firstPool = (pools || []).objectAt(0);
const configName = get(this, 'configName');

switch ( get(this, 'configName') ) {
switch ( configName ) {
case 'amazonElasticContainerServiceConfig':
case 'eksConfig':
return intl.t('clusterNew.amazoneks.shortLabel');
case 'azureKubernetesServiceConfig':
return intl.t('clusterNew.azureaks.shortLabel');
Expand All @@ -205,14 +211,17 @@ export default Resource.extend(Grafana, ResourceUsage, {
return intl.t('clusterNew.huaweicce.shortLabel');
case 'okeEngineConfig':
return intl.t('clusterNew.oracleoke.shortLabel');
case 'k3sconfig':
case 'k3sConfig':
return intl.t('clusterNew.k3simport.shortLabel');
case 'rke2Config':
case 'rancherKubernetesEngineConfig':
var shortLabel = configName === 'rancherKubernetesEngineConfig' ? 'clusterNew.rke.shortLabel' : 'clusterNew.rke2.shortLabel';

if ( !!pools ) {
if ( firstPool ) {
return get(firstPool, 'displayProvider') ? get(firstPool, 'displayProvider') : intl.t('clusterNew.rke.shortLabel');
return get(firstPool, 'displayProvider') ? get(firstPool, 'displayProvider') : intl.t(shortLabel);
} else {
return intl.t('clusterNew.rke.shortLabel');
return intl.t(shortLabel);
}
} else {
return intl.t('clusterNew.custom.shortLabel');
Expand Down Expand Up @@ -500,6 +509,10 @@ export default Resource.extend(Grafana, ResourceUsage, {
}
};

if (provider === 'amazoneks' && !isEmpty(get(this, 'eksConfig'))) {
set(queryParams, 'queryParams.provider', 'amazoneksv2');
}

if (this.clusterTemplateRevisionId) {
set(queryParams, 'queryParams.clusterTemplateRevision', this.clusterTemplateRevisionId);
}
Expand Down
2 changes: 1 addition & 1 deletion app/styles/components/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ select {
// firefox quirk, options were not inheriting there parents color styles
option,
optgroup {
color: $input-color;
color: $label-color;
background: $input-bg;
}

Expand Down
18 changes: 18 additions & 0 deletions app/styles/pages/_host.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
&.import { @include import; }
&.aliyunecs { @include aliyunecs; }
&.amazoneks { @include amazoneks; }
&.amazoneksv2 { @include amazoneks; }
&.azureaks { @include azureaks; }
&.googlegke { @include googlegke; }
&.tencenttke { @include tencenttke; }
Expand All @@ -82,6 +83,7 @@
padding: 15px 0px;
max-height: 130px;
text-decoration: none;
position: relative;

&.small {
max-height: 100px;
Expand All @@ -98,6 +100,22 @@
outline: 4px solid $link-color;
border-color: $link-color;
}

&.active:after {
content: $icon-check;
top: -15px;
right: -15px;
font-family: 'rancher-icons';
font-size: 18px;
position: absolute;
background-color: $info;
height: 29px;
width: 29px;
line-height: 29px;
border-radius: 50%;
color: white;
padding-left: 5px;
}
}
.machine-driver {
height: 100px;
Expand Down
2 changes: 1 addition & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ module.exports = function(defaults) {
app.import('vendor/icons/style.css');

app.import('node_modules/ember-source/dist/ember-template-compiler.js');
app.import('vendor/aws-sdk-eks-ec2-iam-2.348.0.min.js');
app.import('vendor/aws-sdk-eks-ec2-iam-kms-2.705.0.min.js');
app.import('vendor/ember-shortcuts.js');
app.import('vendor/aliyun-sdk.js');
app.import('vendor/cce-sdk.js');
Expand Down
3 changes: 2 additions & 1 deletion lib/global-admin/addon/clusters/new/launch/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ export default Controller.extend({
growl: service(),
settings: service(),

queryParams: ['clusterTemplateRevision'],
queryParams: ['clusterTemplateRevision', 'importProvider'],

clusterTemplateRevision: null,
importProvider: null,

cluster: alias('model.cluster'),

Expand Down
10 changes: 8 additions & 2 deletions lib/global-admin/addon/clusters/new/launch/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ export default Route.extend({

resetController(controller, isExiting, transition) {
if (isExiting && transition.targetName !== 'error') {
controller.set('clusterTemplateRevision', null);
controller.setProperties({
clusterTemplateRevision: null,
importProvider: null
});
}
},

Expand All @@ -119,5 +122,8 @@ export default Route.extend({
}
},

queryParams: { clusterTemplateRevision: { refreshModel: true } }
queryParams: {
clusterTemplateRevision: { refreshModel: true },
importProvider: { refreshModel: true },
}
});
11 changes: 10 additions & 1 deletion lib/global-admin/addon/clusters/new/select/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ export default Controller.extend({
driver: 'amazoneks',
kontainerId: 'amazonelasticcontainerservice',
},
// No driver entry exists for this since it is not a kontainerEngine driver
{
displayName: 'Amazon EKS',
driver: 'eks',
name: 'amazoneksv2',
nodePool: false,
nodeWhich: 'eks',
preSave: false,
},
{
name: 'azureaks',
driver: 'azureaks',
Expand All @@ -103,7 +112,7 @@ export default Controller.extend({
},
];

out = out.filter( (o) => builtIn.findBy('id', o.kontainerId) );
out = out.filter( (o) => builtIn.findBy('id', o.kontainerId) || o.name === 'amazoneksv2' );

if (custom.length > 0) {
custom.forEach( (c) => {
Expand Down
Loading