Skip to content
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

Make taints updatable #275

Merged
merged 3 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions src/main/java/gyro/google/gke/GkeNodeConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ public void setWorkloadMetadataConfig(GkeWorkloadMetadataConfig workloadMetadata
*
* @subresource gyro.google.gke.GkeNodeTaint
*/
@Updatable
public Set<GkeNodeTaint> getTaint() {
if (taint == null) {
taint = new HashSet<>();
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/gyro/google/gke/GkeNodePool.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.google.container.v1beta1.GetNodePoolRequest;
import com.google.container.v1beta1.NodeLabels;
import com.google.container.v1beta1.NodePool;
import com.google.container.v1beta1.NodeTaints;
import com.google.container.v1beta1.SetNodePoolAutoscalingRequest;
import com.google.container.v1beta1.SetNodePoolSizeRequest;
import com.google.container.v1beta1.UpdateNodePoolRequest;
Expand Down Expand Up @@ -359,6 +360,12 @@ protected void doUpdate(GyroUI ui, State state, Resource current, Set<String> ch
builder.setLabels(nlBuilder.build());
}

if (getConfig().getTaint() != null) {
NodeTaints.Builder ntBuilder = NodeTaints.newBuilder();
getConfig().getTaint().stream().map(GkeNodeTaint::toNodeTaint).forEach(ntBuilder::addTaints);
builder.setTaints(ntBuilder.build());
}

builder.setImageType(getConfig().getImageType());
updateCluster(client, builder);
builder.clear();
Expand Down
Loading